summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/views/projects/commit/_commit_box.html.haml4
-rw-r--r--db/migrate/20200212133945_add_group_hooks_to_plan_limits.rb9
-rw-r--r--db/migrate/20200212134201_insert_group_hooks_plan_limits.rb23
-rw-r--r--db/schema.rb1
-rw-r--r--doc/administration/instance_limits.md22
-rw-r--r--doc/development/event_tracking/index.md4
-rw-r--r--doc/development/instrumentation.md4
-rw-r--r--doc/user/project/integrations/webhooks.md16
-rw-r--r--locale/gitlab.pot3
-rw-r--r--spec/javascripts/helpers/tracking_helper.js28
10 files changed, 79 insertions, 35 deletions
diff --git a/app/views/projects/commit/_commit_box.html.haml b/app/views/projects/commit/_commit_box.html.haml
index d07407a6d13..88d1ec54cb0 100644
--- a/app/views/projects/commit/_commit_box.html.haml
+++ b/app/views/projects/commit/_commit_box.html.haml
@@ -66,13 +66,13 @@
- @commit.parents.each do |parent|
= link_to parent.short_id, project_commit_path(@project, parent), class: "commit-sha"
.commit-info.branches
- %i.fa.fa-spinner.fa-spin
+ .spinner.vertical-align-middle
.well-segment.merge-request-info
.icon-container
= custom_icon('mr_bold')
%span.commit-info.merge-requests{ 'data-project-commit-path' => merge_requests_project_commit_path(@project, @commit.id, format: :json) }
- = icon('spinner spin')
+ .spinner.vertical-align-middle
- last_pipeline = @commit.last_pipeline
- if can?(current_user, :read_pipeline, last_pipeline)
diff --git a/db/migrate/20200212133945_add_group_hooks_to_plan_limits.rb b/db/migrate/20200212133945_add_group_hooks_to_plan_limits.rb
new file mode 100644
index 00000000000..4e279ff903d
--- /dev/null
+++ b/db/migrate/20200212133945_add_group_hooks_to_plan_limits.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class AddGroupHooksToPlanLimits < ActiveRecord::Migration[6.0]
+ DOWNTIME = false
+
+ def change
+ add_column(:plan_limits, :group_hooks, :integer, default: 0, null: false)
+ end
+end
diff --git a/db/migrate/20200212134201_insert_group_hooks_plan_limits.rb b/db/migrate/20200212134201_insert_group_hooks_plan_limits.rb
new file mode 100644
index 00000000000..a2963cfaf4d
--- /dev/null
+++ b/db/migrate/20200212134201_insert_group_hooks_plan_limits.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class InsertGroupHooksPlanLimits < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def up
+ return unless Gitlab.com?
+
+ create_or_update_plan_limit('group_hooks', 'bronze', 50)
+ create_or_update_plan_limit('group_hooks', 'silver', 50)
+ create_or_update_plan_limit('group_hooks', 'gold', 50)
+ end
+
+ def down
+ return unless Gitlab.com?
+
+ create_or_update_plan_limit('group_hooks', 'bronze', 0)
+ create_or_update_plan_limit('group_hooks', 'silver', 0)
+ create_or_update_plan_limit('group_hooks', 'gold', 0)
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 36bf8ad5e01..ac647a9eadf 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -3109,6 +3109,7 @@ ActiveRecord::Schema.define(version: 2020_02_24_163804) do
t.integer "ci_pipeline_size", default: 0, null: false
t.integer "ci_active_jobs", default: 0, null: false
t.integer "project_hooks", default: 0, null: false
+ t.integer "group_hooks", default: 0, null: false
t.index ["plan_id"], name: "index_plan_limits_on_plan_id", unique: true
end
diff --git a/doc/administration/instance_limits.md b/doc/administration/instance_limits.md
index 6928ea8ec22..f4f70995731 100644
--- a/doc/administration/instance_limits.md
+++ b/doc/administration/instance_limits.md
@@ -35,13 +35,23 @@ Read more in the [CI documentation](../ci/yaml/README.md#processing-git-pushes).
Activity history for projects and individuals' profiles was limited to one year until [GitLab 11.4](https://gitlab.com/gitlab-org/gitlab-foss/issues/52246) when it was extended to two years, and in [GitLab 12.4](https://gitlab.com/gitlab-org/gitlab/issues/33840) to three years.
-## Number of project webhooks
+## Number of webhooks
+
+A maximum number of webhooks applies to each GitLab.com tier. Limits apply to project and group webhooks.
+
+### Project Webhooks
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/20730) in GitLab 12.6.
-A maximum number of project webhooks applies to each GitLab.com tier. Check the
-[Maximum number of webhooks (per tier)](../user/project/integrations/webhooks.md#maximum-number-of-webhooks-per-tier)
-section in the Webhooks page.
+Check the [Maximum number of project webhooks (per tier)](../user/project/integrations/webhooks.md#maximum-number-of-project-webhooks-per-tier) section in the Webhooks page.
+
+### Group Webhooks
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/25129) in GitLab 12.9.
+
+Check the [Maximum number of group webhooks (per tier)](../user/project/integrations/webhooks.md#maximum-number-of-group-webhooks-per-tier) section in the Webhooks page.
+
+### Setting the limit on a self-hosted installation
To set this limit on a self-hosted installation, run the following in the
[GitLab Rails console](https://docs.gitlab.com/omnibus/maintenance/#starting-a-rails-console-session):
@@ -50,7 +60,11 @@ To set this limit on a self-hosted installation, run the following in the
# If limits don't exist for the default plan, you can create one with:
# Plan.default.create_limits!
+# For project webhooks
Plan.default.limits.update!(project_hooks: 100)
+
+# For group webhooks
+Plan.default.limits.update!(group_hooks: 100)
```
NOTE: **Note:** Set the limit to `0` to disable it.
diff --git a/doc/development/event_tracking/index.md b/doc/development/event_tracking/index.md
index 39714cf4af3..10e99e845d6 100644
--- a/doc/development/event_tracking/index.md
+++ b/doc/development/event_tracking/index.md
@@ -1,4 +1,4 @@
-# Product Analytics
+# Event tracking
At GitLab, we encourage event tracking so we can iterate on and improve the project and user experience.
@@ -44,7 +44,7 @@ From the backend, the events that are tracked will likely consist of things like
See [Backend tracking guide](backend.md).
-Also, see [Application performance metrics](../instrumentation.md) if you are after instrumenting application performance metrics.
+Also, see [Instrumenting Ruby code](../instrumentation.md) if you are instrumenting application performance metrics for Ruby code.
## Enabling tracking
diff --git a/doc/development/instrumentation.md b/doc/development/instrumentation.md
index 3ce6fda441a..290a3eac758 100644
--- a/doc/development/instrumentation.md
+++ b/doc/development/instrumentation.md
@@ -1,11 +1,11 @@
-# Application Performance Metrics for Ruby Code
+# Instrumenting Ruby code
[GitLab Performance Monitoring](../administration/monitoring/performance/index.md) allows instrumenting of both methods and custom
blocks of Ruby code. Method instrumentation is the primary form of
instrumentation with block-based instrumentation only being used when we want to
drill down to specific regions of code within a method.
-Please refer to [Product analytics](event_tracking/index.md) if you are after tracking product usage patterns.
+Please refer to [Event tracking](event_tracking/index.md) if you are tracking product usage patterns.
## Instrumenting Methods
diff --git a/doc/user/project/integrations/webhooks.md b/doc/user/project/integrations/webhooks.md
index 202490f2638..0896faa5e9d 100644
--- a/doc/user/project/integrations/webhooks.md
+++ b/doc/user/project/integrations/webhooks.md
@@ -47,7 +47,7 @@ and **per project and per group** for **GitLab Enterprise Edition**.
Navigate to the webhooks page by going to your project's
**Settings ➔ Webhooks**.
-## Maximum number of webhooks (per tier)
+## Maximum number of project webhooks (per tier)
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/20730) in GitLab 12.6.
@@ -61,6 +61,20 @@ tier](https://about.gitlab.com/pricing/), as shown in the following table:
| Silver | 100 |
| Gold | 100 |
+## Maximum number of group webhooks (per tier)
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/25129) in GitLab 12.9.
+
+A maximum number of group webhooks applies to each [GitLab.com
+tier](https://about.gitlab.com/pricing/), as shown in the following table:
+
+| Tier | Number of webhooks per group |
+|----------|--------------------------------|
+| Free | feature not available |
+| Bronze | 50 |
+| Silver | 50 |
+| Gold | 50 |
+
## Use-cases
- You can set up a webhook in GitLab to send a notification to
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index ac8fdcedd79..6af3f15f31b 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -11972,6 +11972,9 @@ msgstr ""
msgid "Maximum number of comments exceeded"
msgstr ""
+msgid "Maximum number of group hooks (%{count}) exceeded"
+msgstr ""
+
msgid "Maximum number of mirrors that can be synchronizing at the same time."
msgstr ""
diff --git a/spec/javascripts/helpers/tracking_helper.js b/spec/javascripts/helpers/tracking_helper.js
index bd3bd24028c..ea322de46f4 100644
--- a/spec/javascripts/helpers/tracking_helper.js
+++ b/spec/javascripts/helpers/tracking_helper.js
@@ -1,25 +1,5 @@
-import Tracking from '~/tracking';
+// No new code should be added to this file. Instead, modify the
+// file this one re-exports from. For more detail about why, see:
+// https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/31349
-export default Tracking;
-
-let document;
-let handlers;
-
-export function mockTracking(category = '_category_', documentOverride, spyMethod) {
- document = documentOverride || window.document;
- window.snowplow = () => {};
- handlers = Tracking.bindDocument(category, document);
- return spyMethod ? spyMethod(Tracking, 'event') : null;
-}
-
-export function unmockTracking() {
- window.snowplow = undefined;
- handlers.forEach(event => document.removeEventListener(event.name, event.func));
-}
-
-export function triggerEvent(selectorOrEl, eventName = 'click') {
- const event = new Event(eventName, { bubbles: true });
- const el = typeof selectorOrEl === 'string' ? document.querySelector(selectorOrEl) : selectorOrEl;
-
- el.dispatchEvent(event);
-}
+export * from '../../frontend/helpers/tracking_helper';