diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-16 00:08:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-16 00:08:49 +0300 |
commit | cf1d4237a4f226ba2deed26240544da0675a41e5 (patch) | |
tree | 926a71b9279659bc52db0187b463603934718bf2 /lib | |
parent | 0ac82f99553ce12009970a14c0afc02d1f6515bb (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/helpers/services_helpers.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/metrics/dashboard/url.rb | 18 | ||||
-rw-r--r-- | lib/gitlab/usage_data.rb | 2 |
3 files changed, 11 insertions, 11 deletions
diff --git a/lib/api/helpers/services_helpers.rb b/lib/api/helpers/services_helpers.rb index 096c465c873..4c44aca2de4 100644 --- a/lib/api/helpers/services_helpers.rb +++ b/lib/api/helpers/services_helpers.rb @@ -161,6 +161,7 @@ module API def self.services { + 'alerts' => [], 'asana' => [ { required: true, @@ -729,6 +730,7 @@ module API def self.service_classes [ + ::AlertsService, ::AsanaService, ::AssemblaService, ::BambooService, diff --git a/lib/gitlab/metrics/dashboard/url.rb b/lib/gitlab/metrics/dashboard/url.rb index 1239b103cde..1d948883151 100644 --- a/lib/gitlab/metrics/dashboard/url.rb +++ b/lib/gitlab/metrics/dashboard/url.rb @@ -8,6 +8,10 @@ module Gitlab class << self include Gitlab::Utils::StrongMemoize + QUERY_PATTERN = '(?<query>\?[a-zA-Z0-9%.()+_=-]+(&[a-zA-Z0-9%.()+_=-]+)*)?' + ANCHOR_PATTERN = '(?<anchor>\#[a-z0-9_-]+)?' + OPTIONAL_DASH_PATTERN = '(?:/-)?' + # Matches urls for a metrics dashboard. This could be # either the /metrics endpoint or the /metrics_dashboard # endpoint. @@ -63,10 +67,10 @@ module Gitlab (?<url> #{gitlab_host_pattern} #{project_path_pattern} - (?:/-)? + #{OPTIONAL_DASH_PATTERN} #{path_suffix_pattern} - #{query_pattern} - #{anchor_pattern} + #{QUERY_PATTERN} + #{ANCHOR_PATTERN} ) }x end @@ -78,14 +82,6 @@ module Gitlab def project_path_pattern "\/#{Project.reference_pattern}" end - - def query_pattern - '(?<query>\?[a-zA-Z0-9%.()+_=-]+(&[a-zA-Z0-9%.()+_=-]+)*)?' - end - - def anchor_pattern - '(?<anchor>\#[a-z0-9_-]+)?' - end end end end diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb index f10eb82e03e..23c3259b828 100644 --- a/lib/gitlab/usage_data.rb +++ b/lib/gitlab/usage_data.rb @@ -87,6 +87,7 @@ module Gitlab issues_with_associated_zoom_link: count(ZoomMeeting.added_to_issue), issues_using_zoom_quick_actions: count(ZoomMeeting.select(:issue_id).distinct), issues_with_embedded_grafana_charts_approx: ::Gitlab::GrafanaEmbedUsageData.issue_count, + incident_issues: count(::Issue.authored(::User.alert_bot)), keys: count(Key), label_lists: count(List.label), lfs_objects: count(LfsObject), @@ -98,6 +99,7 @@ module Gitlab projects_imported_from_github: count(Project.where(import_type: 'github')), projects_with_repositories_enabled: count(ProjectFeature.where('repository_access_level > ?', ProjectFeature::DISABLED)), projects_with_error_tracking_enabled: count(::ErrorTracking::ProjectErrorTrackingSetting.where(enabled: true)), + projects_with_alerts_service_enabled: count(AlertsService.active), protected_branches: count(ProtectedBranch), releases: count(Release), remote_mirrors: count(RemoteMirror), |