Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-10-19 09:09:36 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-10-19 09:09:36 +0300
commita04f7f36d7a8fb7657de899879f904e23b93ce42 (patch)
treee9e1afe2ecdfb62a9677944f63ee4d49e01d9f64
parentdc97e5514114912508318ada1d35666d85fd3ab7 (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--.gitlab/ci/rules.gitlab-ci.yml4
-rw-r--r--app/controllers/admin/runners_controller.rb8
-rw-r--r--app/models/ci/runner.rb6
-rw-r--r--app/models/clusters/cluster.rb4
-rw-r--r--app/models/clusters/integrations/prometheus.rb7
-rw-r--r--app/models/merge_request.rb14
-rw-r--r--app/models/user.rb4
-rw-r--r--app/services/clusters/integrations/prometheus_health_check_service.rb (renamed from app/services/clusters/applications/prometheus_health_check_service.rb)32
-rw-r--r--app/workers/all_queues.yml4
-rw-r--r--app/workers/clusters/integrations/check_prometheus_health_worker.rb (renamed from app/workers/clusters/applications/check_prometheus_health_worker.rb)6
-rw-r--r--config/feature_flags/development/avoid_cross_joins_environments_merge_request.yml8
-rw-r--r--db/migrate/20211008193137_add_health_status_column_on_clusters_integration_prometheus.rb8
-rw-r--r--db/schema_migrations/202110081931371
-rw-r--r--db/structure.sql3
-rw-r--r--doc/ci/pipelines/schedules.md10
-rw-r--r--doc/ci/yaml/index.md3
-rw-r--r--doc/development/elasticsearch.md10
-rw-r--r--doc/development/go_guide/index.md3
-rw-r--r--doc/development/internal_api.md2
-rw-r--r--doc/development/iterating_tables_in_batches.md6
-rw-r--r--doc/development/redis.md6
-rw-r--r--doc/development/sidekiq_style_guide.md3
-rw-r--r--doc/install/installation.md2
-rw-r--r--doc/integration/gmail_action_buttons_for_gitlab.md2
-rw-r--r--doc/integration/salesforce.md4
-rw-r--r--doc/subscriptions/self_managed/index.md9
-rw-r--r--doc/system_hooks/system_hooks.md4
-rw-r--r--doc/topics/autodevops/multiple_clusters_auto_devops.md4
-rw-r--r--doc/update/index.md52
-rw-r--r--doc/user/infrastructure/iac/mr_integration.md3
-rw-r--r--doc/user/project/clusters/serverless/aws.md4
-rw-r--r--doc/user/project/merge_requests/code_quality.md3
-rw-r--r--doc/user/project/pages/getting_started/pages_ci_cd_template.md3
-rw-r--r--doc/user/search/index.md2
-rw-r--r--lib/api/entities/ci/runner_details.rb8
-rw-r--r--spec/models/clusters/cluster_spec.rb6
-rw-r--r--spec/services/clusters/integrations/prometheus_health_check_service_spec.rb (renamed from spec/services/clusters/applications/prometheus_health_check_service_spec.rb)32
-rw-r--r--spec/support/database/cross-join-allowlist.yml1
-rw-r--r--spec/workers/clusters/integrations/check_prometheus_health_worker_spec.rb (renamed from spec/workers/clusters/applications/check_prometheus_health_worker_spec.rb)8
39 files changed, 169 insertions, 130 deletions
diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml
index 4e3ca064708..009a1d9dd7c 100644
--- a/.gitlab/ci/rules.gitlab-ci.yml
+++ b/.gitlab/ci/rules.gitlab-ci.yml
@@ -1429,7 +1429,6 @@
allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request
changes: *qa-patterns
- allow_failure: true
- <<: *if-dot-com-gitlab-org-schedule
.review:rules:review-build-cng:
@@ -1445,7 +1444,6 @@
allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request
changes: *qa-patterns
- allow_failure: true
- <<: *if-dot-com-gitlab-org-schedule-child-pipeline
.review:rules:review-deploy:
@@ -1456,13 +1454,11 @@
changes: *ci-review-patterns
- <<: *if-dot-com-gitlab-org-merge-request
changes: *frontend-patterns
- allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request
changes: *code-patterns
allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request
changes: *qa-patterns
- allow_failure: true
- <<: *if-dot-com-gitlab-org-schedule-child-pipeline
allow_failure: true
diff --git a/app/controllers/admin/runners_controller.rb b/app/controllers/admin/runners_controller.rb
index 8c74352a179..2dd6de971cc 100644
--- a/app/controllers/admin/runners_controller.rb
+++ b/app/controllers/admin/runners_controller.rb
@@ -86,9 +86,11 @@ class Admin::RunnersController < Admin::ApplicationController
Project.all
end
- @projects = @projects.where.not(id: runner.projects.select(:id)) if runner.projects.any?
- @projects = @projects.inc_routes
- @projects = @projects.page(params[:page]).per(30).without_count
+ ::Gitlab::Database.allow_cross_joins_across_databases(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/338659') do
+ @projects = @projects.where.not(id: runner.projects.select(:id)) if runner.projects.any?
+ @projects = @projects.inc_routes
+ @projects = @projects.page(params[:page]).per(30).without_count
+ end
end
# rubocop: enable CodeReuse/ActiveRecord
end
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb
index 2f718ad7582..2f8a04eefb3 100644
--- a/app/models/ci/runner.rb
+++ b/app/models/ci/runner.rb
@@ -82,7 +82,9 @@ module Ci
groups = Gitlab::ObjectHierarchy.new(groups).base_and_ancestors
end
- joins(:runner_namespaces).where(ci_runner_namespaces: { namespace_id: groups })
+ joins(:runner_namespaces)
+ .where(ci_runner_namespaces: { namespace_id: groups })
+ .allow_cross_joins_across_databases(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/336433')
}
scope :belonging_to_group_or_project, -> (group_id, project_id) {
@@ -111,7 +113,7 @@ module Ci
instance_type
],
remove_duplicates: false
- )
+ ).allow_cross_joins_across_databases(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/336433')
end
scope :assignable_for, ->(project) do
diff --git a/app/models/clusters/cluster.rb b/app/models/clusters/cluster.rb
index feac7bbc363..73ee4aca43c 100644
--- a/app/models/clusters/cluster.rb
+++ b/app/models/clusters/cluster.rb
@@ -150,9 +150,7 @@ module Clusters
scope :for_project_namespace, -> (namespace_id) { joins(:projects).where(projects: { namespace_id: namespace_id }) }
scope :with_name, -> (name) { where(name: name) }
- # with_application_prometheus scope is deprecated, and scheduled for removal
- # in %14.0. See https://gitlab.com/groups/gitlab-org/-/epics/4280
- scope :with_application_prometheus, -> { includes(:application_prometheus).joins(:application_prometheus) }
+ scope :with_integration_prometheus, -> { includes(:integration_prometheus).joins(:integration_prometheus) }
scope :with_project_http_integrations, -> (project_ids) do
conditions = { projects: :alert_management_http_integrations }
includes(conditions).joins(conditions).where(projects: { id: project_ids })
diff --git a/app/models/clusters/integrations/prometheus.rb b/app/models/clusters/integrations/prometheus.rb
index d745a49afc1..8b21fa351a3 100644
--- a/app/models/clusters/integrations/prometheus.rb
+++ b/app/models/clusters/integrations/prometheus.rb
@@ -14,6 +14,13 @@ module Clusters
validates :cluster, presence: true
validates :enabled, inclusion: { in: [true, false] }
+ # Periodically checked and kept up to date for Monitor demo projects
+ enum health_status: {
+ unknown: 0,
+ healthy: 1,
+ unhealthy: 2
+ }
+
attr_encrypted :alert_manager_token,
mode: :per_attribute_iv,
key: Settings.attr_encrypted_db_key_base_32,
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index 15862fb2bfa..9da6bb86b02 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -1409,7 +1409,19 @@ class MergeRequest < ApplicationRecord
def environments
return Environment.none unless actual_head_pipeline&.merge_request?
- actual_head_pipeline.environments
+ if ::Feature.enabled?(:avoid_cross_joins_environments_merge_request, default_enabled: :yaml)
+ build_for_actual_head_pipeline = Ci::Build.latest.where(pipeline: actual_head_pipeline)
+
+ environments = build_for_actual_head_pipeline.joins(:metadata)
+ .where.not('ci_builds_metadata.expanded_environment_name' => nil)
+ .distinct('ci_builds_metadata.expanded_environment_name')
+ .limit(100)
+ .pluck(:expanded_environment_name)
+
+ Environment.where(project: project, name: environments)
+ else
+ actual_head_pipeline.environments
+ end
end
def fetch_ref!
diff --git a/app/models/user.rb b/app/models/user.rb
index 25a2588a6a7..02011de8103 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1610,8 +1610,6 @@ class User < ApplicationRecord
true
end
- # TODO Please check all callers and remove allow_cross_joins_across_databases,
- # when https://gitlab.com/gitlab-org/gitlab/-/issues/336436 is done.
def ci_owned_runners
@ci_owned_runners ||= begin
project_runners = Ci::RunnerProject
@@ -1624,7 +1622,7 @@ class User < ApplicationRecord
.joins(:runner)
.select('ci_runners.*')
- Ci::Runner.from_union([project_runners, group_runners])
+ Ci::Runner.from_union([project_runners, group_runners]).allow_cross_joins_across_databases(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/336436')
end
end
diff --git a/app/services/clusters/applications/prometheus_health_check_service.rb b/app/services/clusters/integrations/prometheus_health_check_service.rb
index eda47f56e72..cd06e59449c 100644
--- a/app/services/clusters/applications/prometheus_health_check_service.rb
+++ b/app/services/clusters/integrations/prometheus_health_check_service.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module Clusters
- module Applications
+ module Integrations
class PrometheusHealthCheckService
include Gitlab::Utils::StrongMemoize
include Gitlab::Routing
@@ -14,7 +14,7 @@ module Clusters
def execute
raise 'Invalid cluster type. Only project types are allowed.' unless @cluster.project_type?
- return unless prometheus_application.installed?
+ return unless prometheus_integration.enabled
project = @cluster.clusterable
@@ -28,32 +28,46 @@ module Clusters
send_notification(project) if became_unhealthy?
- prometheus_application.update_columns(healthy: currently_healthy?) if health_changed?
+ prometheus_integration.update_columns(health_status: current_health_status) if health_changed?
end
private
- def prometheus_application
- strong_memoize(:prometheus_application) do
- @cluster.application_prometheus
+ def prometheus_integration
+ strong_memoize(:prometheus_integration) do
+ @cluster.integration_prometheus
+ end
+ end
+
+ def current_health_status
+ if currently_healthy?
+ :healthy
+ else
+ :unhealthy
end
end
def currently_healthy?
strong_memoize(:currently_healthy) do
- prometheus_application.prometheus_client.healthy?
+ prometheus_integration.prometheus_client.healthy?
end
end
def became_unhealthy?
strong_memoize(:became_unhealthy) do
- (was_healthy? || was_healthy?.nil?) && !currently_healthy?
+ (was_healthy? || was_unknown?) && !currently_healthy?
end
end
def was_healthy?
strong_memoize(:was_healthy) do
- prometheus_application.healthy
+ prometheus_integration.healthy?
+ end
+ end
+
+ def was_unknown?
+ strong_memoize(:was_unknown) do
+ prometheus_integration.unknown?
end
end
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml
index c7ce2eb8d00..2bb961bb8c6 100644
--- a/app/workers/all_queues.yml
+++ b/app/workers/all_queues.yml
@@ -1069,8 +1069,8 @@
:idempotent:
:tags:
- :needs_own_queue
-- :name: incident_management:clusters_applications_check_prometheus_health
- :worker_name: Clusters::Applications::CheckPrometheusHealthWorker
+- :name: incident_management:clusters_integrations_check_prometheus_health
+ :worker_name: Clusters::Integrations::CheckPrometheusHealthWorker
:feature_category: :incident_management
:has_external_dependencies: true
:urgency: :low
diff --git a/app/workers/clusters/applications/check_prometheus_health_worker.rb b/app/workers/clusters/integrations/check_prometheus_health_worker.rb
index 4f85c5c5b7a..0a583003e6f 100644
--- a/app/workers/clusters/applications/check_prometheus_health_worker.rb
+++ b/app/workers/clusters/integrations/check_prometheus_health_worker.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module Clusters
- module Applications
+ module Integrations
class CheckPrometheusHealthWorker
include ApplicationWorker
@@ -22,11 +22,11 @@ module Clusters
def perform
demo_project_ids = Gitlab::Monitor::DemoProjects.primary_keys
- clusters = Clusters::Cluster.with_application_prometheus
+ clusters = Clusters::Cluster.with_integration_prometheus
.with_project_http_integrations(demo_project_ids)
# Move to a seperate worker with scoped context if expanded to do work on customer projects
- clusters.each { |cluster| Clusters::Applications::PrometheusHealthCheckService.new(cluster).execute }
+ clusters.each { |cluster| Clusters::Integrations::PrometheusHealthCheckService.new(cluster).execute }
end
end
end
diff --git a/config/feature_flags/development/avoid_cross_joins_environments_merge_request.yml b/config/feature_flags/development/avoid_cross_joins_environments_merge_request.yml
new file mode 100644
index 00000000000..98e745f74a1
--- /dev/null
+++ b/config/feature_flags/development/avoid_cross_joins_environments_merge_request.yml
@@ -0,0 +1,8 @@
+---
+name: avoid_cross_joins_environments_merge_request
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/71591
+rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/343236
+milestone: '14.5'
+type: development
+group: group::sharding
+default_enabled: false
diff --git a/db/migrate/20211008193137_add_health_status_column_on_clusters_integration_prometheus.rb b/db/migrate/20211008193137_add_health_status_column_on_clusters_integration_prometheus.rb
new file mode 100644
index 00000000000..a69d12d4e52
--- /dev/null
+++ b/db/migrate/20211008193137_add_health_status_column_on_clusters_integration_prometheus.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+class AddHealthStatusColumnOnClustersIntegrationPrometheus < Gitlab::Database::Migration[1.0]
+ def change
+ # For now, health checks will only run on monitor demo projects
+ add_column :clusters_integration_prometheus, :health_status, :smallint, limit: 2, default: 0, null: false
+ end
+end
diff --git a/db/schema_migrations/20211008193137 b/db/schema_migrations/20211008193137
new file mode 100644
index 00000000000..57d2f8cfbc8
--- /dev/null
+++ b/db/schema_migrations/20211008193137
@@ -0,0 +1 @@
+97efc3bb2039b66dac98135d93baefc780a62571bd80aa39d7458f37ce92905b \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index d3882446f57..85a45c789ab 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -12619,7 +12619,8 @@ CREATE TABLE clusters_integration_prometheus (
cluster_id bigint NOT NULL,
enabled boolean DEFAULT false NOT NULL,
encrypted_alert_manager_token text,
- encrypted_alert_manager_token_iv text
+ encrypted_alert_manager_token_iv text,
+ health_status smallint DEFAULT 0 NOT NULL
);
CREATE TABLE clusters_kubernetes_namespaces (
diff --git a/doc/ci/pipelines/schedules.md b/doc/ci/pipelines/schedules.md
index 90494a715ea..692460120fe 100644
--- a/doc/ci/pipelines/schedules.md
+++ b/doc/ci/pipelines/schedules.md
@@ -12,14 +12,16 @@ Pipelines are normally run based on certain conditions being met. For example, w
Pipeline schedules can be used to also run [pipelines](index.md) at specific intervals. For example:
-- Every month on the 22nd for a certain branch.
-- Once every day.
+- Every month on the 22nd (cron example: `0 0 22 * *`) for a certain branch.
+- Every month on the 2nd Monday (cron example: `0 0 * * 1#2`).
+- Every other Sunday at 0900 hours (cron example: `0 9 * * sun%2`).
+- Once every day (cron example: `0 0 * * *`).
+
+Schedule timing is configured with cron notation, parsed by [Fugit](https://github.com/floraison/fugit).
In addition to using the GitLab UI, pipeline schedules can be maintained using the
[Pipeline schedules API](../../api/pipeline_schedules.md).
-Schedule timing is configured with cron notation, parsed by [Fugit](https://github.com/floraison/fugit).
-
## Prerequisites
In order for a scheduled pipeline to be created successfully:
diff --git a/doc/ci/yaml/index.md b/doc/ci/yaml/index.md
index aa44400fffc..30325756f45 100644
--- a/doc/ci/yaml/index.md
+++ b/doc/ci/yaml/index.md
@@ -558,6 +558,9 @@ include:
All [nested includes](#nested-includes) are executed in the scope of the target project.
You can use local (relative to target project), project, remote, or template includes.
+NOTE:
+When including a YAML file from another private project, the user running the pipeline must be a member of both projects and have the appropriate permissions to run pipelines. A `not found or access denied` error may be shown if the user does not have access to any of the included files.
+
##### Multiple files from a project
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/26793) in GitLab 13.6.
diff --git a/doc/development/elasticsearch.md b/doc/development/elasticsearch.md
index 68d8b424331..946f3185423 100644
--- a/doc/development/elasticsearch.md
+++ b/doc/development/elasticsearch.md
@@ -359,17 +359,15 @@ being upgraded to, we do the following:
### Prometheus
-GitLab exports [Prometheus
-metrics](../administration/monitoring/prometheus/gitlab_metrics.md) relating to
-the number of requests and timing for all web/API requests and Sidekiq jobs,
+GitLab exports [Prometheus metrics](../administration/monitoring/prometheus/gitlab_metrics.md)
+relating to the number of requests and timing for all web/API requests and Sidekiq jobs,
which can help diagnose performance trends and compare how Elasticsearch timing
is impacting overall performance relative to the time spent doing other things.
#### Indexing queues
-GitLab also exports [Prometheus
-metrics](../administration/monitoring/prometheus/gitlab_metrics.md) for
-indexing queues, which can help diagnose performance bottlenecks and determine
+GitLab also exports [Prometheus metrics](../administration/monitoring/prometheus/gitlab_metrics.md)
+for indexing queues, which can help diagnose performance bottlenecks and determine
whether or not your GitLab instance or Elasticsearch server can keep up with
the volume of updates.
diff --git a/doc/development/go_guide/index.md b/doc/development/go_guide/index.md
index 44f8924be04..c594c67728f 100644
--- a/doc/development/go_guide/index.md
+++ b/doc/development/go_guide/index.md
@@ -364,8 +364,7 @@ JSON format, as all our infrastructure assumes that. When using
[Logrus](https://github.com/sirupsen/logrus) you can turn on structured
logging simply by using the build in [JSON
formatter](https://github.com/sirupsen/logrus#formatters). This follows the
-same logging type we use in our [Ruby
-applications](../logging.md#use-structured-json-logging).
+same logging type we use in our [Ruby applications](../logging.md#use-structured-json-logging).
#### How to use Logrus
diff --git a/doc/development/internal_api.md b/doc/development/internal_api.md
index 660d8c60ba8..652fd69622b 100644
--- a/doc/development/internal_api.md
+++ b/doc/development/internal_api.md
@@ -300,7 +300,7 @@ personal access token.
| `scopes` | string array | yes | The authorization scopes for the new token, these must be valid token scopes |
| `expires_at` | string | no | The expiry date for the new token |
| `key_id` | integer | no | The ID of the SSH key used as found in the authorized-keys file or through the `/authorized_keys` check |
-| `user_id` | integer | no | User\_id for which to generate the new token |
+| `user_id` | integer | no | User ID for which to generate the new token |
```plaintext
POST /internal/personal_access_token
diff --git a/doc/development/iterating_tables_in_batches.md b/doc/development/iterating_tables_in_batches.md
index fba6f2f616d..9ea7fd3dc29 100644
--- a/doc/development/iterating_tables_in_batches.md
+++ b/doc/development/iterating_tables_in_batches.md
@@ -142,7 +142,7 @@ database query:
SELECT "users"."id" FROM "users" ORDER BY "users"."id" ASC LIMIT 1
```
-![Reading the start id value](img/each_batch_users_table_iteration_1_v13_7.png)
+![Reading the start `id` value](img/each_batch_users_table_iteration_1_v13_7.png)
Notice that the query only reads data from the index (`INDEX ONLY SCAN`), the table is not
accessed. Database indexes are sorted so taking out the first item is a very cheap operation.
@@ -155,7 +155,7 @@ to get a "shifted" `id` value.
SELECT "users"."id" FROM "users" WHERE "users"."id" >= 1 ORDER BY "users"."id" ASC LIMIT 1 OFFSET 5
```
-![Reading the end id value](img/each_batch_users_table_iteration_2_v13_7.png)
+![Reading the end `id` value](img/each_batch_users_table_iteration_2_v13_7.png)
Again, the query only looks into the index. The `OFFSET 5` takes out the sixth `id` value: this
query reads a maximum of six items from the index regardless of the table size or the iteration
@@ -181,7 +181,7 @@ previous iteration in order to find out the next end `id` value.
SELECT "users"."id" FROM "users" WHERE "users"."id" >= 302 ORDER BY "users"."id" ASC LIMIT 1 OFFSET 5
```
-![Reading the second end id value](img/each_batch_users_table_iteration_4_v13_7.png)
+![Reading the second end `id` value](img/each_batch_users_table_iteration_4_v13_7.png)
Now we can easily construct the `users` query for the second iteration.
diff --git a/doc/development/redis.md b/doc/development/redis.md
index fa07cebdc61..75170b8c746 100644
--- a/doc/development/redis.md
+++ b/doc/development/redis.md
@@ -21,8 +21,7 @@ GitLab uses [Redis](https://redis.io) for the following distinct purposes:
In most environments (including the GDK), all of these point to the same
Redis instance.
-On GitLab.com, we use [separate Redis
-instances](../administration/redis/replication_and_failover.md#running-multiple-redis-clusters).
+On GitLab.com, we use [separate Redis instances](../administration/redis/replication_and_failover.md#running-multiple-redis-clusters).
See the [Redis SRE guide](https://gitlab.com/gitlab-com/runbooks/-/blob/master/docs/redis/redis-survival-guide-for-sres.md)
for more details on our setup.
@@ -121,8 +120,7 @@ on GitLab.com
On GitLab.com, entries from the [Redis
slow log](https://redis.io/commands/slowlog) are available in the
-`pubsub-redis-inf-gprd*` index with the [`redis.slowlog`
-tag](https://log.gprd.gitlab.net/app/kibana#/discover?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-1d,to:now))&_a=(columns:!(json.type,json.command,json.exec_time_s),filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,index:AWSQX_Vf93rHTYrsexmk,key:json.tag,negate:!f,params:(query:redis.slowlog),type:phrase),query:(match:(json.tag:(query:redis.slowlog,type:phrase))))),index:AWSQX_Vf93rHTYrsexmk)).
+`pubsub-redis-inf-gprd*` index with the [`redis.slowlog` tag](https://log.gprd.gitlab.net/app/kibana#/discover?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-1d,to:now))&_a=(columns:!(json.type,json.command,json.exec_time_s),filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,index:AWSQX_Vf93rHTYrsexmk,key:json.tag,negate:!f,params:(query:redis.slowlog),type:phrase),query:(match:(json.tag:(query:redis.slowlog,type:phrase))))),index:AWSQX_Vf93rHTYrsexmk)).
This shows commands that have taken a long time and may be a performance
concern.
diff --git a/doc/development/sidekiq_style_guide.md b/doc/development/sidekiq_style_guide.md
index d45e2073fe7..e6288d254d3 100644
--- a/doc/development/sidekiq_style_guide.md
+++ b/doc/development/sidekiq_style_guide.md
@@ -740,8 +740,7 @@ We use the following approach to determine whether a worker is CPU-bound:
## Feature category
-All Sidekiq workers must define a known [feature
-category](feature_categorization/index.md#sidekiq-workers).
+All Sidekiq workers must define a known [feature category](feature_categorization/index.md#sidekiq-workers).
## Job weights
diff --git a/doc/install/installation.md b/doc/install/installation.md
index 7ecd40a2911..73b7d0d8837 100644
--- a/doc/install/installation.md
+++ b/doc/install/installation.md
@@ -1027,7 +1027,7 @@ misconfigured GitLab Workhorse instance. Double-check that you've
[installed Go](#3-go), [installed GitLab Workhorse](#install-gitlab-workhorse),
and correctly [configured NGINX](#site-configuration).
-### `google-protobuf` "LoadError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found"
+### `google-protobuf` "LoadError: /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.14' not found"
This can happen on some platforms for some versions of the
`google-protobuf` gem. The workaround is to install a source-only
diff --git a/doc/integration/gmail_action_buttons_for_gitlab.md b/doc/integration/gmail_action_buttons_for_gitlab.md
index 0468e5d0a42..8b984122c8b 100644
--- a/doc/integration/gmail_action_buttons_for_gitlab.md
+++ b/doc/integration/gmail_action_buttons_for_gitlab.md
@@ -10,7 +10,7 @@ GitLab supports [Google actions in email](https://developers.google.com/gmail/ma
If correctly set up, emails that require an action are marked in Gmail.
-![GMail actions button](img/gmail_action_buttons_for_gitlab.png)
+![Gmail actions button](img/gmail_action_buttons_for_gitlab.png)
To get this functioning, you must be registered with Google. For instructions, see
[Register with Google](https://developers.google.com/gmail/markup/registering-with-google).
diff --git a/doc/integration/salesforce.md b/doc/integration/salesforce.md
index 9555c762761..e63ecc5d8b3 100644
--- a/doc/integration/salesforce.md
+++ b/doc/integration/salesforce.md
@@ -79,7 +79,9 @@ To get the credentials (a pair of Client ID and Client Secret), you must [create
![Salesforce App Secret Details](img/salesforce_app_secret_details.png)
1. Save the configuration file.
-1. [Reconfigure GitLab]( ../administration/restart_gitlab.md#omnibus-gitlab-reconfigure ) or [restart GitLab]( ../administration/restart_gitlab.md#installations-from-source ) for the changes to take effect if you installed GitLab via Omnibus or from source respectively.
+1. [Reconfigure GitLab](../administration/restart_gitlab.md#omnibus-gitlab-reconfigure) or
+ [restart GitLab](../administration/restart_gitlab.md#installations-from-source) for the changes
+ to take effect if you installed GitLab via Omnibus or from source respectively.
On the sign in page, there should now be a Salesforce icon below the regular sign in form.
Click the icon to begin the authentication process. Salesforce asks the user to sign in and authorize the GitLab application.
diff --git a/doc/subscriptions/self_managed/index.md b/doc/subscriptions/self_managed/index.md
index acdbdefc671..9650f043470 100644
--- a/doc/subscriptions/self_managed/index.md
+++ b/doc/subscriptions/self_managed/index.md
@@ -181,9 +181,9 @@ The daily job provides **only** the following information to the Customers Porta
- Instance ID
- MD5 hash of license
-<details>
-<summary>Click here to view an example of a cloud licensing sync request.</summary>
-<pre><code>
+Example of a cloud licensing sync request:
+
+```json
{
"gitlab_version": "14.1.0-pre",
"timestamp": "2021-06-14T12:00:09Z",
@@ -231,8 +231,7 @@ The daily job provides **only** the following information to the Customers Porta
"instance_id": "9367590b-82ad-48cb-9da7-938134c29088",
"license_md5": "002f02470fe45ef6a333a4282aca6222"
}
-</code></pre>
-</details>
+```
#### Sync subscription details
diff --git a/doc/system_hooks/system_hooks.md b/doc/system_hooks/system_hooks.md
index fbeee7b96bc..dcab56a0d0f 100644
--- a/doc/system_hooks/system_hooks.md
+++ b/doc/system_hooks/system_hooks.md
@@ -1,6 +1,6 @@
---
-stage: none
-group: unassigned
+stage: Ecosystem
+group: Integrations
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
type: reference
---
diff --git a/doc/topics/autodevops/multiple_clusters_auto_devops.md b/doc/topics/autodevops/multiple_clusters_auto_devops.md
index 2191ab9ee8b..c6df5ac9e02 100644
--- a/doc/topics/autodevops/multiple_clusters_auto_devops.md
+++ b/doc/topics/autodevops/multiple_clusters_auto_devops.md
@@ -35,8 +35,8 @@ To add a different cluster for each environment:
1. Navigate to your project's **Infrastructure > Kubernetes clusters**.
1. Create the Kubernetes clusters with their respective environment scope, as
described from the table above.
-1. After creating the clusters, navigate to each cluster and [install
- Ingress](quick_start_guide.md#install-ingress). Wait for the Ingress IP address to be assigned.
+1. After creating the clusters, navigate to each cluster and [install Ingress](quick_start_guide.md#install-ingress).
+ Wait for the Ingress IP address to be assigned.
1. Make sure you've [configured your DNS](requirements.md#auto-devops-base-domain) with the
specified Auto DevOps domains.
1. Navigate to each cluster's page, through **Infrastructure > Kubernetes clusters**,
diff --git a/doc/update/index.md b/doc/update/index.md
index b719c47ae26..973e111fe3c 100644
--- a/doc/update/index.md
+++ b/doc/update/index.md
@@ -163,12 +163,10 @@ To address the above two scenario's, it is advised to do the following prior to
## Checking for pending Advanced Search migrations
-This section is only applicable if you have enabled the [Elasticsearch
-integration](../integration/elasticsearch.md).
+This section is only applicable if you have enabled the [Elasticsearch integration](../integration/elasticsearch.md).
-Major releases require all [Advanced Search
-migrations](../integration/elasticsearch.md#advanced-search-migrations) to
-be finished from the most recent minor release in your current version
+Major releases require all [Advanced Search migrations](../integration/elasticsearch.md#advanced-search-migrations)
+to be finished from the most recent minor release in your current version
before the major version upgrade. You can find pending migrations by
running the following command:
@@ -187,8 +185,7 @@ sudo -u git -H bundle exec rake gitlab:elastic:list_pending_migrations
### What do I do if my Advanced Search migrations are stuck?
-See [how to retry a halted
-migration](../integration/elasticsearch.md#retry-a-halted-migration).
+See [how to retry a halted migration](../integration/elasticsearch.md#retry-a-halted-migration).
## Upgrade paths
@@ -234,12 +231,11 @@ It's also important to ensure that any background migrations have been fully com
before upgrading to a new major version. To see the current size of the `background_migration` queue,
[Check for background migrations before upgrading](#checking-for-background-migrations-before-upgrading).
-If you have enabled the [Elasticsearch
-integration](../integration/elasticsearch.md), then ensure
+If you have enabled the [Elasticsearch integration](../integration/elasticsearch.md), then ensure
all Advanced Search migrations are completed in the last minor version within
-your current version. Be sure to [check for pending Advanced Search
-migrations](#checking-for-pending-advanced-search-migrations) before proceeding
-with the major version upgrade.
+your current version. Be sure to
+[check for pending Advanced Search migrations](#checking-for-pending-advanced-search-migrations)
+before proceeding with the major version upgrade.
If your GitLab instance has any runners associated with it, it is very
important to upgrade GitLab Runner to match the GitLab minor version that was
@@ -314,7 +310,7 @@ Git 2.33.x and later is required. We recommend you use the
### 14.3.0
-Ruby 2.7.4 is required. Refer to [the Ruby installation instructions](../install/installation.md#2-ruby)
+- Ruby 2.7.4 is required. Refer to [the Ruby installation instructions](../install/installation.md#2-ruby)
for how to proceed.
- GitLab 14.3.0 contains post-deployment migrations to [address Primary Key overflow risk for tables with an integer PK](https://gitlab.com/groups/gitlab-org/-/epics/4785) for the tables listed below:
@@ -366,25 +362,25 @@ for how to proceed.
### 14.1.0
-- Due to an issue where `BatchedBackgroundMigrationWorkers` were
- [not working](https://gitlab.com/gitlab-org/charts/gitlab/-/issues/2785#note_614738345)
- for self-managed instances, a [fix was created](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/65106)
- and a [14.0.Z](#1400) version was released. If you haven't updated to 14.0.5, you need
- to update to at least 14.1.0 that contains the same fix before you update to
- a later version.
+Due to an issue where `BatchedBackgroundMigrationWorkers` were
+[not working](https://gitlab.com/gitlab-org/charts/gitlab/-/issues/2785#note_614738345)
+for self-managed instances, a [fix was created](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/65106)
+and a [14.0.Z](#1400) version was released. If you haven't updated to 14.0.5, you need
+to update to at least 14.1.0 that contains the same fix before you update to
+a later version.
- After you update to 14.1.0,
- [batched background migrations need to finish](../user/admin_area/monitoring/background_migrations.md#check-the-status-of-background-migrations)
- before you update to a later version.
+After you update to 14.1.0,
+[batched background migrations need to finish](../user/admin_area/monitoring/background_migrations.md#check-the-status-of-background-migrations)
+before you update to a later version.
- If the migrations are not finished and you try to update to a later version,
- you'll see an error like:
+If the migrations are not finished and you try to update to a later version,
+you'll see an error like:
- ```plaintext
- Expected batched background migration for the given configuration to be marked as 'finished', but it is 'active':
- ```
+```plaintext
+Expected batched background migration for the given configuration to be marked as 'finished', but it is 'active':
+```
- See how to [resolve this error](../user/admin_area/monitoring/background_migrations.md#database-migrations-failing-because-of-batched-background-migration-not-finished).
+See how to [resolve this error](../user/admin_area/monitoring/background_migrations.md#database-migrations-failing-because-of-batched-background-migration-not-finished).
### 14.0.0
diff --git a/doc/user/infrastructure/iac/mr_integration.md b/doc/user/infrastructure/iac/mr_integration.md
index 853a39a59a8..3a86a7c0ea5 100644
--- a/doc/user/infrastructure/iac/mr_integration.md
+++ b/doc/user/infrastructure/iac/mr_integration.md
@@ -77,8 +77,7 @@ To manually configure a GitLab Terraform Report artifact:
terraform: $PLAN_JSON
```
- For a full example using the pre-built image, see [Example `.gitlab-ci.yml`
- file](#example-gitlab-ciyml-file).
+ For a full example using the pre-built image, see [Example `.gitlab-ci.yml` file](#example-gitlab-ciyml-file).
For an example displaying multiple reports, see [`.gitlab-ci.yml` multiple reports file](#multiple-terraform-plan-reports).
diff --git a/doc/user/project/clusters/serverless/aws.md b/doc/user/project/clusters/serverless/aws.md
index 6eafb4530d3..06fa18d80c9 100644
--- a/doc/user/project/clusters/serverless/aws.md
+++ b/doc/user/project/clusters/serverless/aws.md
@@ -434,11 +434,11 @@ To test the application you deployed, please go to the build log and follow the
1. Click on "Show complete raw" on the upper right-hand corner:
- ![sam-complete-raw](img/sam-complete-raw.png)
+ ![SAM complete raw](img/sam-complete-raw.png)
1. Look for HelloWorldApi – API Gateway endpoint similar to shown below:
- ![sam-api-endpoint](img/sam-api-endpoint.png)
+ ![SAM API endpoint](img/sam-api-endpoint.png)
1. Use curl to test the API. For example:
diff --git a/doc/user/project/merge_requests/code_quality.md b/doc/user/project/merge_requests/code_quality.md
index e9f1874eb96..9bfbbd8fc6f 100644
--- a/doc/user/project/merge_requests/code_quality.md
+++ b/doc/user/project/merge_requests/code_quality.md
@@ -343,8 +343,7 @@ It's possible to have a custom tool provide Code Quality reports in GitLab. To
do this:
1. Define a job in your `.gitlab-ci.yml` file that generates the
- [Code Quality report
- artifact](../../../ci/yaml/index.md#artifactsreportscodequality).
+ [Code Quality report artifact](../../../ci/yaml/index.md#artifactsreportscodequality).
1. Configure your tool to generate the Code Quality report artifact as a JSON
file that implements a subset of the [Code Climate
spec](https://github.com/codeclimate/platform/blob/master/spec/analyzers/SPEC.md#data-types).
diff --git a/doc/user/project/pages/getting_started/pages_ci_cd_template.md b/doc/user/project/pages/getting_started/pages_ci_cd_template.md
index 4f2b62beab1..74bc54c63f0 100644
--- a/doc/user/project/pages/getting_started/pages_ci_cd_template.md
+++ b/doc/user/project/pages/getting_started/pages_ci_cd_template.md
@@ -34,8 +34,7 @@ configuration for the Pages site to generate properly.
If you don't find a corresponding template, you can view the
[GitLab Pages group of sample projects](https://gitlab.com/pages).
These projects contain `.gitlab-ci.yml` files that you can modify for your needs.
- You can also [learn how to write your own `.gitlab-ci.yml`
- file for GitLab Pages](pages_from_scratch.md).
+ You can also [learn how to write your own `.gitlab-ci.yml` file for GitLab Pages](pages_from_scratch.md).
1. Save and commit the `.gitlab-ci.yml` file.
diff --git a/doc/user/search/index.md b/doc/user/search/index.md
index 7cf62f09303..f741743e6be 100644
--- a/doc/user/search/index.md
+++ b/doc/user/search/index.md
@@ -118,7 +118,7 @@ You can add this URL to your feed reader.
You can filter the **Issues** list to individual instances by their ID. For example, enter filter `#10` to return only issue 10. The same applies to the **Merge Requests** list. Enter filter `#30` to return only merge request 30.
-![filter issues by specific id](img/issue_search_by_id.png)
+![filter issues by specific ID](img/issue_search_by_id.png)
### Filtering merge requests by approvers **(PREMIUM)**
diff --git a/lib/api/entities/ci/runner_details.rb b/lib/api/entities/ci/runner_details.rb
index 9d44da7e5b3..6ded1296f2a 100644
--- a/lib/api/entities/ci/runner_details.rb
+++ b/lib/api/entities/ci/runner_details.rb
@@ -15,18 +15,18 @@ module API
# rubocop: disable CodeReuse/ActiveRecord
expose :projects, with: Entities::BasicProjectDetails do |runner, options|
if options[:current_user].admin? # rubocop: disable Cop/UserAdmin
- runner.projects
+ runner.projects.allow_cross_joins_across_databases(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/338659')
else
- options[:current_user].authorized_projects.where(id: runner.projects)
+ options[:current_user].authorized_projects.where(id: runner.projects).allow_cross_joins_across_databases(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/338659')
end
end
# rubocop: enable CodeReuse/ActiveRecord
# rubocop: disable CodeReuse/ActiveRecord
expose :groups, with: Entities::BasicGroupDetails do |runner, options|
if options[:current_user].admin? # rubocop: disable Cop/UserAdmin
- runner.groups
+ runner.groups.allow_cross_joins_across_databases(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/338659')
else
- options[:current_user].authorized_groups.where(id: runner.groups)
+ options[:current_user].authorized_groups.where(id: runner.groups).allow_cross_joins_across_databases(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/338659')
end
end
# rubocop: enable CodeReuse/ActiveRecord
diff --git a/spec/models/clusters/cluster_spec.rb b/spec/models/clusters/cluster_spec.rb
index 9d305e31bad..d61bed80aaa 100644
--- a/spec/models/clusters/cluster_spec.rb
+++ b/spec/models/clusters/cluster_spec.rb
@@ -178,13 +178,13 @@ RSpec.describe Clusters::Cluster, :use_clean_rails_memory_store_caching do
end
end
- describe '.with_application_prometheus' do
- subject { described_class.with_application_prometheus }
+ describe '.with_integration_prometheus' do
+ subject { described_class.with_integration_prometheus }
let!(:cluster) { create(:cluster) }
context 'cluster has prometheus application' do
- let!(:application) { create(:clusters_applications_prometheus, :installed, cluster: cluster) }
+ let!(:application) { create(:clusters_integrations_prometheus, cluster: cluster) }
it { is_expected.to include(cluster) }
end
diff --git a/spec/services/clusters/applications/prometheus_health_check_service_spec.rb b/spec/services/clusters/integrations/prometheus_health_check_service_spec.rb
index e6c7b147ab7..9db3b9d2417 100644
--- a/spec/services/clusters/applications/prometheus_health_check_service_spec.rb
+++ b/spec/services/clusters/integrations/prometheus_health_check_service_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Clusters::Applications::PrometheusHealthCheckService, '#execute' do
+RSpec.describe Clusters::Integrations::PrometheusHealthCheckService, '#execute' do
let(:service) { described_class.new(cluster) }
subject { service.execute }
@@ -26,10 +26,10 @@ RSpec.describe Clusters::Applications::PrometheusHealthCheckService, '#execute'
end
RSpec.shared_examples 'correct health stored' do
- it 'stores the correct health of prometheus app' do
+ it 'stores the correct health of prometheus' do
subject
- expect(prometheus.healthy).to eq(client_healthy)
+ expect(prometheus.healthy?).to eq(client_healthy)
end
end
@@ -43,19 +43,19 @@ RSpec.describe Clusters::Applications::PrometheusHealthCheckService, '#execute'
let_it_be(:project) { create(:project) }
let_it_be(:integration) { create(:alert_management_http_integration, project: project) }
- let(:applications_prometheus_healthy) { true }
- let(:prometheus) { create(:clusters_applications_prometheus, status: prometheus_status_value, healthy: applications_prometheus_healthy) }
- let(:cluster) { create(:cluster, :project, application_prometheus: prometheus, projects: [project]) }
+ let(:previous_health_status) { :healthy }
+ let(:prometheus) { create(:clusters_integrations_prometheus, enabled: prometheus_enabled, health_status: previous_health_status) }
+ let(:cluster) { create(:cluster, :project, integration_prometheus: prometheus, projects: [project]) }
- context 'when prometheus not installed' do
- let(:prometheus_status_value) { Clusters::Applications::Prometheus.state_machine.states[:installing].value }
+ context 'when prometheus not enabled' do
+ let(:prometheus_enabled) { false }
it { expect(subject).to eq(nil) }
include_examples 'no alert'
end
- context 'when prometheus installed' do
- let(:prometheus_status_value) { Clusters::Applications::Prometheus.state_machine.states[:installed].value }
+ context 'when prometheus enabled' do
+ let(:prometheus_enabled) { true }
before do
client = instance_double('PrometheusClient', healthy?: client_healthy)
@@ -63,7 +63,7 @@ RSpec.describe Clusters::Applications::PrometheusHealthCheckService, '#execute'
end
context 'when newly unhealthy' do
- let(:applications_prometheus_healthy) { true }
+ let(:previous_health_status) { :healthy }
let(:client_healthy) { false }
include_examples 'sends alert'
@@ -71,7 +71,7 @@ RSpec.describe Clusters::Applications::PrometheusHealthCheckService, '#execute'
end
context 'when newly healthy' do
- let(:applications_prometheus_healthy) { false }
+ let(:previous_health_status) { :unhealthy }
let(:client_healthy) { true }
include_examples 'no alert'
@@ -79,7 +79,7 @@ RSpec.describe Clusters::Applications::PrometheusHealthCheckService, '#execute'
end
context 'when continuously unhealthy' do
- let(:applications_prometheus_healthy) { false }
+ let(:previous_health_status) { :unhealthy }
let(:client_healthy) { false }
include_examples 'no alert'
@@ -87,7 +87,7 @@ RSpec.describe Clusters::Applications::PrometheusHealthCheckService, '#execute'
end
context 'when continuously healthy' do
- let(:applications_prometheus_healthy) { true }
+ let(:previous_health_status) { :healthy }
let(:client_healthy) { true }
include_examples 'no alert'
@@ -95,7 +95,7 @@ RSpec.describe Clusters::Applications::PrometheusHealthCheckService, '#execute'
end
context 'when first health check and healthy' do
- let(:applications_prometheus_healthy) { nil }
+ let(:previous_health_status) { :unknown }
let(:client_healthy) { true }
include_examples 'no alert'
@@ -103,7 +103,7 @@ RSpec.describe Clusters::Applications::PrometheusHealthCheckService, '#execute'
end
context 'when first health check and not healthy' do
- let(:applications_prometheus_healthy) { nil }
+ let(:previous_health_status) { :unknown }
let(:client_healthy) { false }
include_examples 'sends alert'
diff --git a/spec/support/database/cross-join-allowlist.yml b/spec/support/database/cross-join-allowlist.yml
index c209d275fc8..54375e43833 100644
--- a/spec/support/database/cross-join-allowlist.yml
+++ b/spec/support/database/cross-join-allowlist.yml
@@ -38,7 +38,6 @@
- "./spec/models/user_spec.rb"
- "./spec/presenters/packages/detail/package_presenter_spec.rb"
- "./spec/requests/api/ci/runner/runners_post_spec.rb"
-- "./spec/requests/api/ci/runners_spec.rb"
- "./spec/requests/api/graphql/ci/runner_spec.rb"
- "./spec/requests/api/graphql/group_query_spec.rb"
- "./spec/requests/api/graphql/packages/composer_spec.rb"
diff --git a/spec/workers/clusters/applications/check_prometheus_health_worker_spec.rb b/spec/workers/clusters/integrations/check_prometheus_health_worker_spec.rb
index fb779bf3b01..6f70870bd09 100644
--- a/spec/workers/clusters/applications/check_prometheus_health_worker_spec.rb
+++ b/spec/workers/clusters/integrations/check_prometheus_health_worker_spec.rb
@@ -2,16 +2,16 @@
require 'spec_helper'
-RSpec.describe Clusters::Applications::CheckPrometheusHealthWorker, '#perform' do
+RSpec.describe Clusters::Integrations::CheckPrometheusHealthWorker, '#perform' do
subject { described_class.new.perform }
it 'triggers health service' do
cluster = create(:cluster)
allow(Gitlab::Monitor::DemoProjects).to receive(:primary_keys)
- allow(Clusters::Cluster).to receive_message_chain(:with_application_prometheus, :with_project_http_integrations).and_return([cluster])
+ allow(Clusters::Cluster).to receive_message_chain(:with_integration_prometheus, :with_project_http_integrations).and_return([cluster])
- service_instance = instance_double(Clusters::Applications::PrometheusHealthCheckService)
- expect(Clusters::Applications::PrometheusHealthCheckService).to receive(:new).with(cluster).and_return(service_instance)
+ service_instance = instance_double(Clusters::Integrations::PrometheusHealthCheckService)
+ expect(Clusters::Integrations::PrometheusHealthCheckService).to receive(:new).with(cluster).and_return(service_instance)
expect(service_instance).to receive(:execute)
subject