diff --git a/.gitlab/ci/docs.gitlab-ci.yml b/.gitlab/ci/docs.gitlab-ci.yml
index eeccecafb8b..b258eb73515 100644
--- a/.gitlab/ci/docs.gitlab-ci.yml
+++ b/.gitlab/ci/docs.gitlab-ci.yml
@@ -42,7 +42,8 @@ docs-lint markdown:
extends:
- .default-retry
- .docs:rules:docs-lint
- image: "registry.gitlab.com/gitlab-org/gitlab-docs/lint:ruby-2.7.2-alpine-3.12-vale-2.4.3-markdownlint-0.24.0"
+ # When updating the image version here, update it in /scripts/lint-doc.sh too.
+ image: "registry.gitlab.com/gitlab-org/gitlab-docs/lint-markdown:alpine-3.12-vale-2.6.1-markdownlint-0.24.0"
stage: test
needs: []
script:
diff --git a/app/controllers/admin/application_settings_controller.rb b/app/controllers/admin/application_settings_controller.rb
index 9b380049583..56ec10fa43a 100644
--- a/app/controllers/admin/application_settings_controller.rb
+++ b/app/controllers/admin/application_settings_controller.rb
@@ -53,7 +53,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
def integrations
return not_found unless instance_level_integrations?
- @integrations = Service.find_or_initialize_all(Service.for_instance).sort_by(&:title)
+ @integrations = Service.find_or_initialize_all_non_project_specific(Service.for_instance).sort_by(&:title)
end
def update
diff --git a/app/controllers/admin/integrations_controller.rb b/app/controllers/admin/integrations_controller.rb
index 9a1d5a11f7f..aab8705f5cb 100644
--- a/app/controllers/admin/integrations_controller.rb
+++ b/app/controllers/admin/integrations_controller.rb
@@ -8,8 +8,8 @@ class Admin::IntegrationsController < Admin::ApplicationController
private
- def find_or_initialize_integration(name)
- Service.find_or_initialize_integration(name, instance: true)
+ def find_or_initialize_non_project_specific_integration(name)
+ Service.find_or_initialize_non_project_specific_integration(name, instance: true)
end
def integrations_enabled?
diff --git a/app/controllers/concerns/integrations_actions.rb b/app/controllers/concerns/integrations_actions.rb
index 39f63bbaaec..8e9b038437d 100644
--- a/app/controllers/concerns/integrations_actions.rb
+++ b/app/controllers/concerns/integrations_actions.rb
@@ -52,7 +52,7 @@ module IntegrationsActions
def integration
# Using instance variable `@service` still required as it's used in ServiceParams.
# Should be removed once that is refactored to use `@integration`.
- @integration = @service ||= find_or_initialize_integration(params[:id]) # rubocop:disable Gitlab/ModuleWithInstanceVariables
+ @integration = @service ||= find_or_initialize_non_project_specific_integration(params[:id]) # rubocop:disable Gitlab/ModuleWithInstanceVariables
end
def success_message
diff --git a/app/controllers/groups/settings/integrations_controller.rb b/app/controllers/groups/settings/integrations_controller.rb
index 035b1714b69..a66372b3571 100644
--- a/app/controllers/groups/settings/integrations_controller.rb
+++ b/app/controllers/groups/settings/integrations_controller.rb
@@ -10,7 +10,7 @@ module Groups
feature_category :integrations
def index
- @integrations = Service.find_or_initialize_all(Service.for_group(group)).sort_by(&:title)
+ @integrations = Service.find_or_initialize_all_non_project_specific(Service.for_group(group)).sort_by(&:title)
end
def edit
@@ -21,8 +21,8 @@ module Groups
private
- def find_or_initialize_integration(name)
- Service.find_or_initialize_integration(name, group_id: group.id)
+ def find_or_initialize_non_project_specific_integration(name)
+ Service.find_or_initialize_non_project_specific_integration(name, group_id: group.id)
end
def integrations_enabled?
diff --git a/app/graphql/types/projects/service_type_enum.rb b/app/graphql/types/projects/service_type_enum.rb
index 340fdff6b86..34e06c67be6 100644
--- a/app/graphql/types/projects/service_type_enum.rb
+++ b/app/graphql/types/projects/service_type_enum.rb
@@ -5,7 +5,7 @@ module Types
class ServiceTypeEnum < BaseEnum
graphql_name 'ServiceType'
- ::Service.services_types.each do |service_type|
+ ::Service.available_services_types(include_dev: false).each do |service_type|
value service_type.underscore.upcase, value: service_type
end
end
diff --git a/app/models/project.rb b/app/models/project.rb
index 68d498c2bd5..ebd8e56246d 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1341,8 +1341,7 @@ class Project < ApplicationRecord
end
def find_or_initialize_services
- available_services_names =
- Service.available_services_names + Service.project_specific_services_names - disabled_services
+ available_services_names = Service.available_services_names - disabled_services
available_services_names.map do |service_name|
find_or_initialize_service(service_name)
diff --git a/app/models/service.rb b/app/models/service.rb
index c544c5a53c1..2b6971954e3 100644
--- a/app/models/service.rb
+++ b/app/models/service.rb
@@ -17,6 +17,7 @@ class Service < ApplicationRecord
pivotaltracker prometheus pushover redmine slack slack_slash_commands teamcity unify_circuit webex_teams youtrack
].freeze
+ # Fake services to help with local development.
DEV_SERVICE_NAMES = %w[
mock_ci mock_deployment mock_monitoring
].freeze
@@ -65,9 +66,9 @@ class Service < ApplicationRecord
scope :by_type, -> (type) { where(type: type) }
scope :by_active_flag, -> (flag) { where(active: flag) }
scope :inherit_from_id, -> (id) { where(inherit_from_id: id) }
- scope :for_group, -> (group) { where(group_id: group, type: available_services_types) }
- scope :for_template, -> { where(template: true, type: available_services_types) }
- scope :for_instance, -> { where(instance: true, type: available_services_types) }
+ scope :for_group, -> (group) { where(group_id: group, type: available_services_types(include_project_specific: false)) }
+ scope :for_template, -> { where(template: true, type: available_services_types(include_project_specific: false)) }
+ scope :for_instance, -> { where(instance: true, type: available_services_types(include_project_specific: false)) }
scope :push_hooks, -> { where(push_events: true, active: true) }
scope :tag_push_hooks, -> { where(tag_push_events: true, active: true) }
@@ -168,13 +169,13 @@ class Service < ApplicationRecord
end
private_class_method :create_nonexistent_templates
- def self.find_or_initialize_integration(name, instance: false, group_id: nil)
- if name.in?(available_services_names)
+ def self.find_or_initialize_non_project_specific_integration(name, instance: false, group_id: nil)
+ if name.in?(available_services_names(include_project_specific: false))
"#{name}_service".camelize.constantize.find_or_initialize_by(instance: instance, group_id: group_id)
end
end
- def self.find_or_initialize_all(scope)
+ def self.find_or_initialize_all_non_project_specific(scope)
scope + build_nonexistent_services_for(scope)
end
@@ -188,13 +189,14 @@ class Service < ApplicationRecord
def self.list_nonexistent_services_for(scope)
# Using #map instead of #pluck to save one query count. This is because
# ActiveRecord loaded the object here, so we don't need to query again later.
- available_services_types - scope.map(&:type)
+ available_services_types(include_project_specific: false) - scope.map(&:type)
end
private_class_method :list_nonexistent_services_for
- def self.available_services_names
+ def self.available_services_names(include_project_specific: true, include_dev: true)
service_names = services_names
- service_names += dev_services_names
+ service_names += project_specific_services_names if include_project_specific
+ service_names += dev_services_names if include_dev
service_names.sort_by(&:downcase)
end
@@ -213,12 +215,10 @@ class Service < ApplicationRecord
[]
end
- def self.available_services_types
- available_services_names.map { |service_name| "#{service_name}_service".camelize }
- end
-
- def self.services_types
- services_names.map { |service_name| "#{service_name}_service".camelize }
+ def self.available_services_types(include_project_specific: true, include_dev: true)
+ available_services_names(include_project_specific: include_project_specific, include_dev: include_dev).map do |service_name|
+ "#{service_name}_service".camelize
+ end
end
def self.build_from_integration(integration, project_id: nil, group_id: nil)
diff --git a/app/services/git/branch_hooks_service.rb b/app/services/git/branch_hooks_service.rb
index 93a0d139001..d00ca83441a 100644
--- a/app/services/git/branch_hooks_service.rb
+++ b/app/services/git/branch_hooks_service.rb
@@ -84,7 +84,6 @@ module Git
end
def enqueue_metrics_dashboard_sync
- return unless Feature.enabled?(:sync_metrics_dashboards, project)
return unless default_branch?
::Metrics::Dashboard::SyncDashboardsWorker.perform_async(project.id)
diff --git a/changelogs/unreleased/rc-remove_sync_metrics_dashboard_ff.yml b/changelogs/unreleased/rc-remove_sync_metrics_dashboard_ff.yml
new file mode 100644
index 00000000000..d23fc9c5a3b
--- /dev/null
+++ b/changelogs/unreleased/rc-remove_sync_metrics_dashboard_ff.yml
@@ -0,0 +1,5 @@
+---
+title: Add alerting support for custom dashboards
+merge_request: 47704
+author:
+type: added
diff --git a/config/feature_flags/development/sync_metrics_dashboards.yml b/config/feature_flags/development/sync_metrics_dashboards.yml
deleted file mode 100644
index 84dc6bdb41e..00000000000
--- a/config/feature_flags/development/sync_metrics_dashboards.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-name: sync_metrics_dashboards
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/39658
-rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/241793
-milestone: '13.5'
-type: development
-group: group::apm
-default_enabled: false
diff --git a/doc/.vale/vale.tmpl b/doc/.vale/vale.tmpl
new file mode 100644
index 00000000000..36dfbd6b778
--- /dev/null
+++ b/doc/.vale/vale.tmpl
@@ -0,0 +1,51 @@
+{{- /* Modify Vale's output https://docs.errata.ai/vale/cli#--output */ -}}
+
+{{- /* Keep track of our various counts */ -}}
+
+{{- $e := 0 -}}
+{{- $w := 0 -}}
+{{- $s := 0 -}}
+{{- $f := 0 -}}
+
+{{- /* Range over the linted files */ -}}
+
+{{- range .Files}}
+
+{{- $f = add1 $f -}}
+{{- $path := .Path | underline -}}
+
+{{- /* Range over the file's alerts */ -}}
+
+{{- range .Alerts -}}
+
+{{- $error := "" -}}
+{{- if eq .Severity "error" -}}
+ {{- $error = .Severity | red -}}
+ {{- $e = add1 $e -}}
+{{- else if eq .Severity "warning" -}}
+ {{- $error = .Severity | yellow -}}
+ {{- $w = add1 $w -}}
+{{- else -}}
+ {{- $error = .Severity | blue -}}
+ {{- $s = add1 $s -}}
+{{- end}}
+
+{{- /* Variables setup */ -}}
+
+{{- $path = $path -}}
+{{- $loc := printf "Line %d, position %d" .Line (index .Span 0) -}}
+{{- $check := printf "%s" .Check -}}
+{{- $message := printf "%s" .Message -}}
+{{- $link := printf "%s" .Link -}}
+
+{{- /* Output */ -}}
+
+{{ $path }}:
+ {{ $loc }} (rule {{ $check }})
+ {{ $error }}: {{ $message }}
+ More information: {{ $link }}
+
+{{end -}}
+{{end -}}
+
+{{- $e}} {{"errors" | red}}, {{$w}} {{"warnings" | yellow}}, and {{$s}} {{"suggestions" | blue}} found in {{$f}} {{$f | int | plural "file" "files"}}.
diff --git a/doc/README.md b/doc/README.md
index 17ac5d578b8..759b5dda32b 100644
--- a/doc/README.md
+++ b/doc/README.md
@@ -23,14 +23,14 @@ Here you can access the complete documentation for GitLab, the single applicatio
No matter how you use GitLab, we have documentation for you.
-| Essential documentation | Essential documentation |
-|:-------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------|
+| Essential documentation | Essential documentation |
+|:------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------|
| [**User documentation**](user/index.md)
Discover features and concepts for GitLab users. | [**Administrator documentation**](administration/index.md)
Everything GitLab self-managed administrators need to know. |
-| [**Contributing to GitLab**](#contributing-to-gitlab)
At GitLab, everyone can contribute! | [**New to Git and GitLab?**](#new-to-git-and-gitlab)
We have the resources to get you started. |
-| [**Build an integration with GitLab**](#build-an-integration-with-gitlab)
Consult our automation and integration documentation. | [**Coming to GitLab from another platform?**](#coming-to-gitlab-from-another-platform)
Consult our handy guides. |
-| [**Install GitLab**](https://about.gitlab.com/install/)
Installation options for different platforms. | [**Customers**](subscriptions/index.md)
Information for new and existing customers. |
-| [**Update GitLab**](update/README.md)
Update your GitLab self-managed instance to the latest version. | [**Reference Architectures**](administration/reference_architectures/index.md)
GitLab's reference architectures |
-| [**GitLab releases**](https://about.gitlab.com/releases/)
What's new in GitLab. | |
+| [**Contributing to GitLab**](#contributing-to-gitlab)
At GitLab, everyone can contribute! | [**New to Git and GitLab?**](#new-to-git-and-gitlab)
We have the resources to get you started. |
+| [**Build an integration with GitLab**](#build-an-integration-with-gitlab)
Consult our automation and integration documentation. | [**Coming to GitLab from another platform?**](#coming-to-gitlab-from-another-platform)
Consult our guides. |
+| [**Install GitLab**](https://about.gitlab.com/install/)
Installation options for different platforms. | [**Customers**](subscriptions/index.md)
Information for new and existing customers. |
+| [**Update GitLab**](update/README.md)
Update your GitLab self-managed instance to the latest version. | [**Reference Architectures**](administration/reference_architectures/index.md)
GitLab's reference architectures |
+| [**GitLab releases**](https://about.gitlab.com/releases/)
What's new in GitLab. | |
## Popular topics
@@ -92,11 +92,11 @@ GitLab provides statistics and insights into ways you can maximize the value of
The following documentation relates to the DevOps **Manage** stage:
-| Manage topics | Description |
-|:--------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| [Authentication and
Authorization](administration/auth/README.md) **(CORE ONLY)** | Supported authentication and authorization providers. |
-| [GitLab Value Stream Analytics](user/analytics/value_stream_analytics.md) | Measure the time it takes to go from an [idea to production](https://about.gitlab.com/blog/2016/08/05/continuous-integration-delivery-and-deployment-with-gitlab/#from-idea-to-production-with-gitlab) for each project you have. |
-| [Instance-level analytics](user/admin_area/analytics/index.md) | Discover statistics on how many GitLab features you use and user activity. |
+| Manage topics | Description |
+|:--------------------------------------------------------------------------------------|:---------------------------------------------------------------------------|
+| [Authentication and
Authorization](administration/auth/README.md) **(CORE ONLY)** | Supported authentication and authorization providers. |
+| [GitLab Value Stream Analytics](user/analytics/value_stream_analytics.md) | Measure the time it takes to go from an [idea to production](https://about.gitlab.com/blog/2016/08/05/continuous-integration-delivery-and-deployment-with-gitlab/#from-idea-to-production-with-gitlab) for each project you have. |
+| [Instance-level analytics](user/admin_area/analytics/index.md) | Discover statistics on how many GitLab features you use and user activity. |