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>2022-10-25 00:09:11 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-10-25 00:09:11 +0300
commit76bbc06371e3ea6cffa4fda45e7773006ec76dd7 (patch)
tree4a6623f22ae576ba2436168d9a256c4eb1e9c382
parent84cacdae74db0de90cf88ceef2191f399e9659b2 (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--.rubocop_todo/layout/space_inside_parens.yml19
-rw-r--r--CHANGELOG.md7
-rw-r--r--app/helpers/application_settings_helper.rb1
-rw-r--r--app/models/application_setting.rb5
-rw-r--r--app/models/application_setting_implementation.rb1
-rw-r--r--app/views/admin/application_settings/_jira_connect.html.haml (renamed from app/views/admin/application_settings/_jira_connect_application_key.html.haml)6
-rw-r--r--app/views/admin/application_settings/general.html.haml2
-rw-r--r--db/migrate/20220920135632_add_jira_connect_proxy_url_setting.rb10
-rw-r--r--db/migrate/20220920135717_add_textlimit_to_jira_connect_proxy_url_setting.rb13
-rw-r--r--db/schema_migrations/202209201356321
-rw-r--r--db/schema_migrations/202209201357171
-rw-r--r--db/structure.sql2
-rw-r--r--doc/administration/job_artifacts.md2
-rw-r--r--doc/ci/directed_acyclic_graph/index.md2
-rw-r--r--doc/ci/environments/incremental_rollouts.md2
-rw-r--r--doc/ci/environments/index.md2
-rw-r--r--doc/ci/environments/protected_environments.md4
-rw-r--r--doc/ci/examples/end_to_end_testing_webdriverio/index.md2
-rw-r--r--doc/ci/examples/laravel_with_gitlab_and_envoy/index.md6
-rw-r--r--doc/ci/interactive_web_terminal/index.md2
-rw-r--r--doc/ci/jobs/index.md2
-rw-r--r--doc/ci/pipelines/index.md2
-rw-r--r--doc/ci/troubleshooting.md4
-rw-r--r--doc/ci/yaml/index.md5
-rw-r--r--doc/development/cached_queries.md2
-rw-r--r--doc/development/database/batched_background_migrations.md13
-rw-r--r--doc/development/database_review.md2
-rw-r--r--doc/development/distributed_tracing.md2
-rw-r--r--doc/development/multi_version_compatibility.md2
-rw-r--r--doc/development/packages/cleanup_policies.md122
-rw-r--r--doc/development/packages/index.md1
-rw-r--r--doc/development/secure_coding_guidelines.md2
-rw-r--r--doc/development/service_ping/metrics_instrumentation.md7
-rw-r--r--doc/development/testing_guide/end_to_end/style_guide.md8
-rw-r--r--doc/integration/advanced_search/elasticsearch.md2
-rw-r--r--doc/integration/jira/configure.md2
-rw-r--r--doc/operations/error_tracking.md13
-rw-r--r--doc/operations/incident_management/alerts.md4
-rw-r--r--doc/operations/incident_management/incidents.md2
-rw-r--r--doc/operations/incident_management/integrations.md4
-rw-r--r--doc/operations/metrics/dashboards/index.md4
-rw-r--r--doc/operations/metrics/dashboards/templating_variables.md10
-rw-r--r--doc/user/application_security/terminology/index.md2
-rw-r--r--doc/user/project/clusters/runbooks/index.md4
-rw-r--r--doc/user/project/merge_requests/reviews/suggestions.md2
-rw-r--r--doc/user/project/pages/getting_started/pages_ci_cd_template.md6
-rw-r--r--doc/user/project/pages/pages_access_control.md2
-rw-r--r--doc/user/project/quick_actions.md2
-rw-r--r--doc/user/project/repository/web_editor.md18
-rw-r--r--doc/user/project/requirements/index.md4
-rw-r--r--doc/user/project/web_ide/index.md4
-rw-r--r--lib/atlassian/jira_connect/jwt/asymmetric.rb20
-rw-r--r--lib/gitlab/background_migration/backfill_cluster_agents_has_vulnerabilities.rb7
-rw-r--r--lib/gitlab/background_migration/backfill_group_features.rb2
-rw-r--r--lib/gitlab/background_migration/backfill_imported_issue_search_data.rb6
-rw-r--r--lib/gitlab/background_migration/backfill_internal_on_notes.rb3
-rw-r--r--lib/gitlab/background_migration/backfill_namespace_details.rb4
-rw-r--r--lib/gitlab/background_migration/backfill_namespace_id_of_vulnerability_reads.rb4
-rw-r--r--lib/gitlab/background_migration/backfill_project_feature_package_registry_access_level.rb4
-rw-r--r--lib/gitlab/background_migration/backfill_project_import_level.rb4
-rw-r--r--lib/gitlab/background_migration/backfill_project_namespace_details.rb4
-rw-r--r--lib/gitlab/background_migration/backfill_project_namespace_on_issues.rb3
-rw-r--r--lib/gitlab/background_migration/backfill_vulnerability_reads_cluster_agent.rb4
-rw-r--r--lib/gitlab/background_migration/backfill_work_item_type_id_for_issues.rb2
-rw-r--r--lib/gitlab/background_migration/batched_migration_job.rb14
-rw-r--r--lib/gitlab/background_migration/copy_column_using_background_migration_job.rb3
-rw-r--r--lib/gitlab/background_migration/delete_orphaned_operational_vulnerabilities.rb3
-rw-r--r--lib/gitlab/background_migration/destroy_invalid_group_members.rb4
-rw-r--r--lib/gitlab/background_migration/destroy_invalid_members.rb3
-rw-r--r--lib/gitlab/background_migration/destroy_invalid_project_members.rb3
-rw-r--r--lib/gitlab/background_migration/disable_legacy_open_source_licence_for_recent_public_projects.rb3
-rw-r--r--lib/gitlab/background_migration/disable_legacy_open_source_license_for_inactive_public_projects.rb3
-rw-r--r--lib/gitlab/background_migration/disable_legacy_open_source_license_for_no_issues_no_repo_projects.rb3
-rw-r--r--lib/gitlab/background_migration/disable_legacy_open_source_license_for_one_member_no_repo_projects.rb3
-rw-r--r--lib/gitlab/background_migration/disable_legacy_open_source_license_for_projects_less_than_one_mb.rb3
-rw-r--r--lib/gitlab/background_migration/expire_o_auth_tokens.rb3
-rw-r--r--lib/gitlab/background_migration/populate_operation_visibility_permissions_from_operations.rb4
-rw-r--r--lib/gitlab/background_migration/remove_backfilled_job_artifacts_expire_at.rb6
-rw-r--r--lib/gitlab/background_migration/remove_self_managed_wiki_notes.rb6
-rw-r--r--lib/gitlab/background_migration/rename_task_system_note_to_checklist_item.rb4
-rw-r--r--lib/gitlab/background_migration/reset_duplicate_ci_runners_token_encrypted_values.rb4
-rw-r--r--lib/gitlab/background_migration/reset_duplicate_ci_runners_token_values.rb4
-rw-r--r--lib/gitlab/background_migration/set_correct_vulnerability_state.rb3
-rw-r--r--lib/gitlab/background_migration/set_legacy_open_source_license_available_for_non_public_projects.rb3
-rw-r--r--lib/gitlab/background_migration/update_delayed_project_removal_to_null_for_user_namespaces.rb6
-rw-r--r--lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml2
-rw-r--r--lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml2
-rw-r--r--lib/gitlab/ci/templates/Jobs/Deploy.latest.gitlab-ci.yml2
-rw-r--r--lib/gitlab/instrumentation/redis_interceptor.rb8
-rw-r--r--locale/gitlab.pot3
-rw-r--r--qa/lib/gitlab/page/group/settings/usage_quotas.rb5
-rw-r--r--qa/lib/gitlab/page/group/settings/usage_quotas.stub.rb (renamed from qa/lib/gitlab/page/group/settings/usage_quota.stub.rb)302
-rw-r--r--spec/controllers/admin/topics_controller_spec.rb2
-rw-r--r--spec/controllers/groups/children_controller_spec.rb2
-rw-r--r--spec/controllers/groups/registry/repositories_controller_spec.rb2
-rw-r--r--spec/controllers/groups/releases_controller_spec.rb4
-rw-r--r--spec/controllers/groups/runners_controller_spec.rb12
-rw-r--r--spec/controllers/groups_controller_spec.rb2
-rw-r--r--spec/controllers/omniauth_callbacks_controller_spec.rb2
-rw-r--r--spec/controllers/projects/environments_controller_spec.rb8
-rw-r--r--spec/controllers/projects/issues_controller_spec.rb4
-rw-r--r--spec/controllers/projects/registry/repositories_controller_spec.rb2
-rw-r--r--spec/controllers/projects/releases_controller_spec.rb2
-rw-r--r--spec/controllers/projects/runners_controller_spec.rb2
-rw-r--r--spec/features/admin/admin_settings_spec.rb2
-rw-r--r--spec/lib/atlassian/jira_connect/jwt/asymmetric_spec.rb35
-rw-r--r--spec/lib/gitlab/background_migration/batched_migration_job_spec.rb77
-rw-r--r--spec/lib/gitlab/ci/parsers/security/common_spec.rb8
-rw-r--r--spec/services/web_hook_service_spec.rb16
-rw-r--r--spec/support/shared_examples/workers/batched_background_migration_worker_shared_examples.rb2
-rw-r--r--spec/views/admin/application_settings/_jira_connect.html.haml_spec.rb23
-rw-r--r--spec/views/admin/application_settings/general.html.haml_spec.rb6
112 files changed, 754 insertions, 287 deletions
diff --git a/.rubocop_todo/layout/space_inside_parens.yml b/.rubocop_todo/layout/space_inside_parens.yml
index a3c78432a66..d153d951de5 100644
--- a/.rubocop_todo/layout/space_inside_parens.yml
+++ b/.rubocop_todo/layout/space_inside_parens.yml
@@ -47,14 +47,6 @@ Layout/SpaceInsideParens:
- 'ee/app/services/sitemap/create_service.rb'
- 'ee/lib/ee/gitlab/auth/ldap/access.rb'
- 'ee/lib/gitlab/auth/smartcard/session.rb'
- - 'ee/spec/controllers/admin/licenses_controller_spec.rb'
- - 'ee/spec/controllers/ee/groups_controller_spec.rb'
- - 'ee/spec/controllers/groups/analytics/productivity_analytics_controller_spec.rb'
- - 'ee/spec/controllers/projects/issues_controller_spec.rb'
- - 'ee/spec/controllers/projects/merge_requests/creations_controller_spec.rb'
- - 'ee/spec/controllers/projects/merge_requests_controller_spec.rb'
- - 'ee/spec/controllers/projects/security/vulnerabilities_controller_spec.rb'
- - 'ee/spec/controllers/projects/settings/operations_controller_spec.rb'
- 'ee/spec/features/account_recovery_regular_check_spec.rb'
- 'ee/spec/features/billings/billing_plans_spec.rb'
- 'ee/spec/features/boards/board_filters_spec.rb'
@@ -167,17 +159,6 @@ Layout/SpaceInsideParens:
- 'qa/qa/tools/delete_subgroups.rb'
- 'qa/spec/runtime/feature_spec.rb'
- 'qa/spec/scenario/template_spec.rb'
- - 'spec/controllers/boards/issues_controller_spec.rb'
- - 'spec/controllers/groups/children_controller_spec.rb'
- - 'spec/controllers/groups/registry/repositories_controller_spec.rb'
- - 'spec/controllers/groups/releases_controller_spec.rb'
- - 'spec/controllers/groups/runners_controller_spec.rb'
- - 'spec/controllers/groups_controller_spec.rb'
- - 'spec/controllers/omniauth_callbacks_controller_spec.rb'
- - 'spec/controllers/projects/environments_controller_spec.rb'
- - 'spec/controllers/projects/issues_controller_spec.rb'
- - 'spec/controllers/projects/registry/repositories_controller_spec.rb'
- - 'spec/controllers/projects/runners_controller_spec.rb'
- 'spec/dependencies/omniauth_saml_spec.rb'
- 'spec/factories/usage_data.rb'
- 'spec/features/boards/board_filters_spec.rb'
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 48dde99aacb..f671ae43238 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,13 @@
documentation](doc/development/changelog.md) for instructions on adding your own
entry.
+## 15.5.1 (2022-10-24)
+
+### Fixed (2 changes)
+
+- [Batch records when preloading for indexing](gitlab-org/gitlab@43f0f24d5985ab2d731ab022aa5a498cfee5789b) ([merge request](gitlab-org/gitlab!101927)) **GitLab Enterprise Edition**
+- [Specify certificates when connecting to KAS using TLS](gitlab-org/gitlab@f445f3f11d93eef56793fc116c7b2f1a4d030701) ([merge request](gitlab-org/gitlab!101927))
+
## 15.5.0 (2022-10-21)
### Added (159 changes)
diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb
index 21b18203677..37196764974 100644
--- a/app/helpers/application_settings_helper.rb
+++ b/app/helpers/application_settings_helper.rb
@@ -278,6 +278,7 @@ module ApplicationSettingsHelper
:inactive_projects_send_warning_email_after_months,
:invisible_captcha_enabled,
:jira_connect_application_key,
+ :jira_connect_proxy_url,
:max_artifacts_size,
:max_attachment_size,
:max_export_size,
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb
index a1bef44a815..173a897e4a3 100644
--- a/app/models/application_setting.rb
+++ b/app/models/application_setting.rb
@@ -527,6 +527,11 @@ class ApplicationSetting < ApplicationRecord
length: { maximum: 255, message: N_('is too long (maximum is %{count} characters)') },
allow_blank: true
+ validates :jira_connect_proxy_url,
+ length: { maximum: 255, message: N_('is too long (maximum is %{count} characters)') },
+ allow_blank: true,
+ addressable_url: true
+
with_options(presence: true, numericality: { only_integer: true, greater_than: 0 }) do
validates :throttle_unauthenticated_api_requests_per_period
validates :throttle_unauthenticated_api_period_in_seconds
diff --git a/app/models/application_setting_implementation.rb b/app/models/application_setting_implementation.rb
index dee4bd07fd9..d78c6d4a503 100644
--- a/app/models/application_setting_implementation.rb
+++ b/app/models/application_setting_implementation.rb
@@ -103,6 +103,7 @@ module ApplicationSettingImplementation
invisible_captcha_enabled: false,
issues_create_limit: 300,
jira_connect_application_key: nil,
+ jira_connect_proxy_url: nil,
local_markdown_version: 0,
login_recaptcha_protection_enabled: false,
mailgun_signing_key: nil,
diff --git a/app/views/admin/application_settings/_jira_connect_application_key.html.haml b/app/views/admin/application_settings/_jira_connect.html.haml
index b67e7680720..ad0660797ee 100644
--- a/app/views/admin/application_settings/_jira_connect_application_key.html.haml
+++ b/app/views/admin/application_settings/_jira_connect.html.haml
@@ -18,4 +18,10 @@
.form-group
= f.label :jira_connect_application_key, s_('JiraConnect|Jira Connect Application ID'), class: 'label-bold'
= f.text_field :jira_connect_application_key, class: 'form-control gl-form-input'
+
+ %fieldset
+ .form-group
+ = f.label :jira_connect_proxy_url, s_('JiraConnect|Jira Connect Proxy URL'), class: 'label-bold'
+ = f.text_field :jira_connect_proxy_url, class: 'form-control gl-form-input'
+
= f.submit _('Save changes'), pajamas_button: true
diff --git a/app/views/admin/application_settings/general.html.haml b/app/views/admin/application_settings/general.html.haml
index db407ae35c4..99abddac41b 100644
--- a/app/views/admin/application_settings/general.html.haml
+++ b/app/views/admin/application_settings/general.html.haml
@@ -123,4 +123,4 @@
= render 'admin/application_settings/eks'
= render 'admin/application_settings/floc'
= render_if_exists 'admin/application_settings/add_license'
-= render 'admin/application_settings/jira_connect_application_key' if Feature.enabled?(:jira_connect_oauth_self_managed_setting, current_user)
+= render 'admin/application_settings/jira_connect' if Feature.enabled?(:jira_connect_oauth_self_managed_setting, current_user)
diff --git a/db/migrate/20220920135632_add_jira_connect_proxy_url_setting.rb b/db/migrate/20220920135632_add_jira_connect_proxy_url_setting.rb
new file mode 100644
index 00000000000..c5842b6c787
--- /dev/null
+++ b/db/migrate/20220920135632_add_jira_connect_proxy_url_setting.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+class AddJiraConnectProxyUrlSetting < Gitlab::Database::Migration[2.0]
+ # rubocop:disable Migration/AddLimitToTextColumns
+ # limit is added in 20220920135717_add_textlimit_to_jira_connect_proxy_url_setting.rb
+ def change
+ add_column :application_settings, :jira_connect_proxy_url, :text
+ end
+ # rubocop:enable Migration/AddLimitToTextColumns
+end
diff --git a/db/migrate/20220920135717_add_textlimit_to_jira_connect_proxy_url_setting.rb b/db/migrate/20220920135717_add_textlimit_to_jira_connect_proxy_url_setting.rb
new file mode 100644
index 00000000000..3a571580e79
--- /dev/null
+++ b/db/migrate/20220920135717_add_textlimit_to_jira_connect_proxy_url_setting.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddTextlimitToJiraConnectProxyUrlSetting < Gitlab::Database::Migration[2.0]
+ disable_ddl_transaction!
+
+ def up
+ add_text_limit :application_settings, :jira_connect_proxy_url, 255
+ end
+
+ def down
+ remove_text_limit :application_settings, :jira_connect_proxy_url
+ end
+end
diff --git a/db/schema_migrations/20220920135632 b/db/schema_migrations/20220920135632
new file mode 100644
index 00000000000..b20c7886bf9
--- /dev/null
+++ b/db/schema_migrations/20220920135632
@@ -0,0 +1 @@
+ec4d492f229e78a8f0efd8691a0a3f04d5f8125d8e1c7d0f93b45faa034108f7 \ No newline at end of file
diff --git a/db/schema_migrations/20220920135717 b/db/schema_migrations/20220920135717
new file mode 100644
index 00000000000..7e64f02956c
--- /dev/null
+++ b/db/schema_migrations/20220920135717
@@ -0,0 +1 @@
+06c73930dcc4ce0edfe5fa57ff721b6799f6458ff68f3c37c0eaf1745c8db1f1 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 7b6c5bccca1..0a37fee1686 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -11488,6 +11488,7 @@ CREATE TABLE application_settings (
lock_maven_package_requests_forwarding boolean DEFAULT false NOT NULL,
lock_pypi_package_requests_forwarding boolean DEFAULT false NOT NULL,
lock_npm_package_requests_forwarding boolean DEFAULT false NOT NULL,
+ jira_connect_proxy_url text,
password_expiration_enabled boolean DEFAULT false NOT NULL,
password_expires_in_days integer DEFAULT 90 NOT NULL,
password_expires_notice_before_days integer DEFAULT 7 NOT NULL,
@@ -11510,6 +11511,7 @@ CREATE TABLE application_settings (
CONSTRAINT check_3455368420 CHECK ((char_length(database_grafana_api_url) <= 255)),
CONSTRAINT check_3559645ae5 CHECK ((char_length(container_registry_import_target_plan) <= 255)),
CONSTRAINT check_3def0f1829 CHECK ((char_length(sentry_clientside_dsn) <= 255)),
+ CONSTRAINT check_4847426287 CHECK ((char_length(jira_connect_proxy_url) <= 255)),
CONSTRAINT check_492cc1354d CHECK ((char_length(error_tracking_api_url) <= 255)),
CONSTRAINT check_4f8b811780 CHECK ((char_length(sentry_dsn) <= 255)),
CONSTRAINT check_51700b31b5 CHECK ((char_length(default_branch_name) <= 255)),
diff --git a/doc/administration/job_artifacts.md b/doc/administration/job_artifacts.md
index 1e9f20ded55..5f3c68a9bc2 100644
--- a/doc/administration/job_artifacts.md
+++ b/doc/administration/job_artifacts.md
@@ -301,7 +301,7 @@ I/O. It instead inspects the metadata file which contains all the relevant
information. This is especially important when there is a lot of artifacts, or
an archive is a very large file.
-When clicking on a specific file, [GitLab Workhorse](https://gitlab.com/gitlab-org/gitlab-workhorse) extracts it
+When selecting a specific file, [GitLab Workhorse](https://gitlab.com/gitlab-org/gitlab-workhorse) extracts it
from the archive and the download begins. This implementation saves space,
memory and disk I/O.
diff --git a/doc/ci/directed_acyclic_graph/index.md b/doc/ci/directed_acyclic_graph/index.md
index ded91edeff5..39f45471021 100644
--- a/doc/ci/directed_acyclic_graph/index.md
+++ b/doc/ci/directed_acyclic_graph/index.md
@@ -91,7 +91,7 @@ To see the needs visualization, select **Needs** when viewing a pipeline that us
![Needs visualization example](img/dag_graph_example_v13_1.png)
-Clicking a node highlights all the job paths it depends on.
+Selecting a node highlights all the job paths it depends on.
![Needs visualization with path highlight](img/dag_graph_example_clicked_v13_1.png)
diff --git a/doc/ci/environments/incremental_rollouts.md b/doc/ci/environments/incremental_rollouts.md
index af431a9812e..10cda68c4b5 100644
--- a/doc/ci/environments/incremental_rollouts.md
+++ b/doc/ci/environments/incremental_rollouts.md
@@ -76,7 +76,7 @@ available, demonstrating manually triggered incremental rollouts.
## Timed Rollouts
Timed rollouts behave in the same way as manual rollouts, except that each job is defined with a
-delay in minutes before it deploys. Clicking the job reveals the countdown.
+delay in minutes before it deploys. Selecting the job reveals the countdown.
![Timed rollout](img/timed_rollout_v12_7.png)
diff --git a/doc/ci/environments/index.md b/doc/ci/environments/index.md
index 29aa3bf932f..a14a62e5d81 100644
--- a/doc/ci/environments/index.md
+++ b/doc/ci/environments/index.md
@@ -178,7 +178,7 @@ deploy_prod:
The `when: manual` action:
- Exposes a play button for the job in the GitLab UI, with the text **Can be manually deployed to &lt;environment&gt;**.
-- Means the `deploy_prod` job is only triggered when the play button is clicked.
+- Means the `deploy_prod` job is only triggered when the play button is selected.
You can find the play button in the pipelines, environments, deployments, and jobs views.
diff --git a/doc/ci/environments/protected_environments.md b/doc/ci/environments/protected_environments.md
index 0f943679c07..5c120da32a0 100644
--- a/doc/ci/environments/protected_environments.md
+++ b/doc/ci/environments/protected_environments.md
@@ -26,7 +26,7 @@ Maintainer role.
Prerequisites:
-- When granting the **Allowed to deploy** permission to a group or subgroup, the user configuring the protected environment must be a **direct member** of the group or subgroup to be added. Otherwise, the group or subgroup will not show up in the dropdown. For more information see [issue #345140](https://gitlab.com/gitlab-org/gitlab/-/issues/345140).
+- When granting the **Allowed to deploy** permission to a group or subgroup, the user configuring the protected environment must be a **direct member** of the group or subgroup to be added. Otherwise, the group or subgroup will not show up in the dropdown list. For more information see [issue #345140](https://gitlab.com/gitlab-org/gitlab/-/issues/345140).
To protect an environment:
@@ -147,7 +147,7 @@ Maintainers can:
- Update existing protected environments at any time by changing the access in the
**Allowed to Deploy** dropdown list.
-- Unprotect a protected environment by clicking the **Unprotect** button for that environment.
+- Unprotect a protected environment by selecting the **Unprotect** button for that environment.
After an environment is unprotected, all access entries are deleted and must
be re-entered if the environment is re-protected.
diff --git a/doc/ci/examples/end_to_end_testing_webdriverio/index.md b/doc/ci/examples/end_to_end_testing_webdriverio/index.md
index e9f126b0409..7b5690e2d3d 100644
--- a/doc/ci/examples/end_to_end_testing_webdriverio/index.md
+++ b/doc/ci/examples/end_to_end_testing_webdriverio/index.md
@@ -88,7 +88,7 @@ hit our 404 page. We can then use [`browser.getUrl`](http://v4.webdriver.io/api/
to verify that the current page is indeed at the location we specified. To interact with the page,
we can pass CSS selectors to
[`browser.element`](http://v4.webdriver.io/api/protocol/element.html) to get access to elements on the
-page and to interact with them - for example, to click on the link back to the home page.
+page and to interact with them - for example, to select the link back to the home page.
The simple test shown above
can already give us a lot of confidence if it passes: we know our deployment has succeeded, that the
diff --git a/doc/ci/examples/laravel_with_gitlab_and_envoy/index.md b/doc/ci/examples/laravel_with_gitlab_and_envoy/index.md
index 80e476f2a87..6c67d7ab212 100644
--- a/doc/ci/examples/laravel_with_gitlab_and_envoy/index.md
+++ b/doc/ci/examples/laravel_with_gitlab_and_envoy/index.md
@@ -628,11 +628,11 @@ To do that, commit and push `.gitlab-ci.yml` to the `main` branch. It will trigg
Here we see our **Test** and **Deploy** stages.
The **Test** stage has the `unit_test` build running.
-click on it to see the runner's output.
+Select it to see the runner's output.
![pipeline page](img/pipeline_page.png)
-After our code passed through the pipeline successfully, we can deploy to our production server by clicking the **play** button on the right side.
+After our code passed through the pipeline successfully, we can deploy to our production server by selecting the **play** button on the right side.
![pipelines page deploy button](img/pipelines_page_deploy_button.png)
@@ -644,7 +644,7 @@ If something doesn't work as expected, you can roll back to the latest working v
![environment page](img/environment_page.png)
-By clicking on the external link icon specified on the right side, GitLab opens the production website.
+By selecting the external link icon specified on the right side, GitLab opens the production website.
Our deployment successfully was done and we can see the application is live.
![Laravel welcome page](img/laravel_welcome_page.png)
diff --git a/doc/ci/interactive_web_terminal/index.md b/doc/ci/interactive_web_terminal/index.md
index a1df55cfc38..44c081b9d7f 100644
--- a/doc/ci/interactive_web_terminal/index.md
+++ b/doc/ci/interactive_web_terminal/index.md
@@ -65,7 +65,7 @@ for the current job.
![Example of job running with terminal available](img/interactive_web_terminal_running_job.png)
-When clicked, a new tab opens to the terminal page where you can access
+When selected, a new tab opens to the terminal page where you can access
the terminal and type commands like a normal shell.
![terminal of the job](img/interactive_web_terminal_page.png)
diff --git a/doc/ci/jobs/index.md b/doc/ci/jobs/index.md
index 492eac9b250..4eb8952dd73 100644
--- a/doc/ci/jobs/index.md
+++ b/doc/ci/jobs/index.md
@@ -37,7 +37,7 @@ independently from each other.
When you access a pipeline, you can see the related jobs for that pipeline.
-Clicking an individual job shows you its job log, and allows you to:
+Selecting an individual job shows you its job log, and allows you to:
- Cancel the job.
- Retry the job.
diff --git a/doc/ci/pipelines/index.md b/doc/ci/pipelines/index.md
index ed0583e0872..e9085a39d21 100644
--- a/doc/ci/pipelines/index.md
+++ b/doc/ci/pipelines/index.md
@@ -260,7 +260,7 @@ pipelines.
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/24851) in GitLab 12.7.
Users with the Owner role for a project can delete a pipeline
-by clicking on the pipeline in the **CI/CD > Pipelines** to get to the **Pipeline Details**
+by selecting the pipeline in the **CI/CD > Pipelines** to get to the **Pipeline Details**
page, then selecting **Delete**.
![Pipeline Delete](img/pipeline-delete.png)
diff --git a/doc/ci/troubleshooting.md b/doc/ci/troubleshooting.md
index eec6bcb6436..730ec39a90e 100644
--- a/doc/ci/troubleshooting.md
+++ b/doc/ci/troubleshooting.md
@@ -285,14 +285,14 @@ has failed or been canceled.
If a merge request pipeline or merged result pipeline was canceled or failed, you can:
-- Re-run the entire pipeline by clicking **Run pipeline** in the pipeline tab in the merge request.
+- Re-run the entire pipeline by selecting **Run pipeline** in the pipeline tab in the merge request.
- [Retry only the jobs that failed](pipelines/index.md#view-pipelines). If you re-run the entire pipeline, this is not necessary.
- Push a new commit to fix the failure.
If the merge train pipeline has failed, you can:
- Check the failure and determine if you can use the [`/merge` quick action](../user/project/quick_actions.md) to immediately add the merge request to the train again.
-- Re-run the entire pipeline by clicking **Run pipeline** in the pipeline tab in the merge request, then add the merge request to the train again.
+- Re-run the entire pipeline by selecting **Run pipeline** in the pipeline tab in the merge request, then add the merge request to the train again.
- Push a commit to fix the failure, then add the merge request to the train again.
If the merge train pipeline was canceled before the merge request was merged, without a failure, you can:
diff --git a/doc/ci/yaml/index.md b/doc/ci/yaml/index.md
index 7c322370e6a..3882bc67199 100644
--- a/doc/ci/yaml/index.md
+++ b/doc/ci/yaml/index.md
@@ -1749,6 +1749,11 @@ deploy:
deployment_tier: production
```
+**Additional details**:
+
+- Enviroments created from this job definition are assigned a [tier](../environments/index.md#deployment-tier-of-environments) based on this value.
+- Existing environments don't have their tier updated if this value is added later. Existing enviroments must have their tier updated via the [Environments API](../../api/environments.md#edit-an-existing-environment).
+
**Related topics**:
- [Deployment tier of environments](../environments/index.md#deployment-tier-of-environments).
diff --git a/doc/development/cached_queries.md b/doc/development/cached_queries.md
index fbb857106be..e4625a50d79 100644
--- a/doc/development/cached_queries.md
+++ b/doc/development/cached_queries.md
@@ -87,7 +87,7 @@ and the number of executed cached queries:
![Performance Bar Database Queries](img/performance_bar_members_page.png)
-The page included 55 cached queries. Clicking the number displays a modal window
+The page included 55 cached queries. Selecting the number displays a modal window
with more details about queries. Cached queries are marked with the `cached` label
below the query. You can see multiple duplicate cached queries in this modal window:
diff --git a/doc/development/database/batched_background_migrations.md b/doc/development/database/batched_background_migrations.md
index a48a9c42e27..ca11e9c8dd3 100644
--- a/doc/development/database/batched_background_migrations.md
+++ b/doc/development/database/batched_background_migrations.md
@@ -219,6 +219,7 @@ In this example, `copy_from` returns `name`, and `copy_to` returns `name_convert
```ruby
class CopyColumnUsingBackgroundMigrationJob < BatchedMigrationJob
job_arguments :copy_from, :copy_to
+ operation_name :update_all
def perform
from_column = connection.quote_column_name(copy_from)
@@ -226,7 +227,7 @@ class CopyColumnUsingBackgroundMigrationJob < BatchedMigrationJob
assignment_clause = "#{to_column} = #{from_column}"
- each_sub_batch(operation_name: :update_all) do |relation|
+ each_sub_batch do |relation|
relation.update_all(assignment_clause)
end
end
@@ -267,9 +268,10 @@ In the second (filtered) example, we know exactly 100 will be updated with each
```ruby
class BackfillNamespaceType < BatchedMigrationJob
scope_to ->(relation) { relation.where(type: nil) }
+ operation_name :update_all
def perform
- each_sub_batch(operation_name: :update_all) do |sub_batch|
+ each_sub_batch do |sub_batch|
sub_batch.update_all(type: 'User')
end
end
@@ -327,9 +329,10 @@ background migration.
# self.table_name = 'routes'
# end
+ operation_name :update_all
+
def perform
each_sub_batch(
- operation_name: :update_all,
batching_scope: -> (relation) { relation.where("source_type <> 'UnusedType'") }
) do |sub_batch|
sub_batch.update_all('namespace_id = source_id')
@@ -483,8 +486,10 @@ module Gitlab
class BatchProjectsWithIssues < Gitlab::BackgroundMigration::BatchedMigrationJob
include Gitlab::Database::DynamicModelHelpers
+ operation_name :backfill_issues
+
def perform
- distinct_each_batch(operation_name: :backfill_issues) do |batch|
+ distinct_each_batch do |batch|
project_ids = batch.pluck(batch_column)
# do something with the distinct project_ids
end
diff --git a/doc/development/database_review.md b/doc/development/database_review.md
index 58776c5330c..2af5cf3691f 100644
--- a/doc/development/database_review.md
+++ b/doc/development/database_review.md
@@ -176,7 +176,7 @@ Include in the MR description:
- The query plan for each raw SQL query included in the merge request along with the link to the query plan following each raw SQL snippet.
- Provide a public link to the plan from either:
- [postgres.ai](https://postgres.ai/): Follow the link in `#database-lab` and generate a shareable, public link
- by clicking **Share** in the upper right corner.
+ by selecting **Share** in the upper right corner.
- [explain.depesz.com](https://explain.depesz.com) or [explain.dalibo.com](https://explain.dalibo.com): Paste both the plan and the query used in the form.
- When providing query plans, make sure it hits enough data:
- You can use a GitLab production replica to test your queries on a large scale,
diff --git a/doc/development/distributed_tracing.md b/doc/development/distributed_tracing.md
index 0ca10bc93dd..9e62f019fbf 100644
--- a/doc/development/distributed_tracing.md
+++ b/doc/development/distributed_tracing.md
@@ -91,7 +91,7 @@ Once the performance bar is enabled, select **Trace** in the performance bar to
the Jaeger UI.
The Jaeger search UI returns a query for the `Correlation-ID` of the current request. Normally,
-this search should return a single trace result. Clicking this result shows the detail of the
+this search should return a single trace result. Selecting this result shows the detail of the
trace in a hierarchical time-line.
![Jaeger Search UI](img/distributed_tracing_jaeger_ui.png)
diff --git a/doc/development/multi_version_compatibility.md b/doc/development/multi_version_compatibility.md
index 808554d6027..8e2103b2f3e 100644
--- a/doc/development/multi_version_compatibility.md
+++ b/doc/development/multi_version_compatibility.md
@@ -258,7 +258,7 @@ For more information, see [the relevant issue](https://gitlab.com/gitlab-org/git
We bumped the Markdown cache version and found a bug when a user edited a description or comment which was generated from a different Markdown
cache version. The cached HTML wasn't generated properly after saving. In most cases, this wouldn't have happened because users would have
-viewed the Markdown before clicking **Edit** and that would mean the Markdown cache is refreshed. But because we run mixed versions, this is
+viewed the Markdown before selecting **Edit** and that would mean the Markdown cache is refreshed. But because we run mixed versions, this is
more likely to happen. Another user on a different version could view the same page and refresh the cache to the other version behind the scenes.
For more information, see [the relevant issue](https://gitlab.com/gitlab-org/gitlab/-/issues/208255).
diff --git a/doc/development/packages/cleanup_policies.md b/doc/development/packages/cleanup_policies.md
new file mode 100644
index 00000000000..ae6304e940d
--- /dev/null
+++ b/doc/development/packages/cleanup_policies.md
@@ -0,0 +1,122 @@
+---
+stage: Package
+group: Package
+info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
+---
+
+# Cleanup policies
+
+Cleanup policies are recurrent background processes that automatically remove
+objects according to some parameters set by users.
+
+## Container Registry
+
+Cleanup policies for the container registry work on all the container repositories
+hosted in a single project. All tags that match the cleanup parameters are removed.
+
+### Parameters
+
+The [ContainerExpirationPolicy](https://gitlab.com/gitlab-org/gitlab/-/blob/37a76cbfb54a9a3f0dba3c3748eaaac82fb8bf4b/app/models/container_expiration_policy.rb)
+holds all parameters for the container registry cleanup policies.
+
+The parameters are split into two groups:
+
+- The parameters that define tags to keep:
+ - `keep_n`. Keep the `n` most recent tags.
+ - `name_regex_keep`. Keep tags matching this regular expression.
+- The parameters that define tags to destroy:
+ - `older_than`. Destroy tags older than this timestamp.
+ - `name_regex`. Destroy tags matching this regular expression.
+
+The remaining parameters impact when the policy is executed:
+
+- `enabled`. Defines if the policy is enabled or not.
+- `cadence`. Defines the execution cadence of the policy.
+- `next_run_at`. Defines when the next execution should happen.
+
+### Execution
+
+Due to the large number of policies we need to process on GitLab.com, the execution
+follows this design.
+
+- Policy executions are limited in time.
+- Policy executions are either complete or partial.
+- The background jobs will consider the next job to be executed based on two
+priorities:
+ - Policy with a `next_run_at` in the past.
+ - Partially executed policies.
+
+To track the cleanup policy status on a container repository,
+we have an `expiration_policy_cleanup_status` on the `ContainerRepository`
+model.
+
+Background jobs for this execution are organized on:
+
+- A cron background job that runs every hour.
+- A set of background jobs that will loop on container repositories that need
+a policy execution.
+
+#### The cron background job
+
+The [cron background job](https://gitlab.com/gitlab-org/gitlab/-/blob/36454d77a8de76a25896efd7c051d6796985f579/app/workers/container_expiration_policy_worker.rb)
+is quite simple.
+Its main tasks are:
+
+1. Check if there are any container repositories in need of a cleanup. If any,
+enqueue as many limited capacity jobs as necessary, up to a limit.
+1. Compute metrics for cleanup policies and log them.
+
+#### The limited capacity job
+
+This [job](https://gitlab.com/gitlab-org/gitlab/-/blob/36454d77a8de76a25896efd7c051d6796985f579/app/workers/container_expiration_policies/cleanup_container_repository_worker.rb)
+is based on the [limited capacity concern](../sidekiq/limited_capacity_worker.md).
+
+This job will run in parallel up to [a specific capacity](settings.md#container-registry).
+
+The primary responsibility of this job is to select the next container
+repository that requires cleaning and call the related service on it.
+
+This is where the two priorities are evaluated in order. If a container repository
+is found, the cleanup service is called on it.
+
+To ensure that only one cleaning is executed on a given container repository
+at any time, we use a database lock along with the
+`expiration_policy_cleanup_status` column.
+
+This job will re-enqueue itself until no more container repositories require cleanup.
+
+#### Services
+
+Here is the services call that will happen from the limited capacity job:
+
+```mermaid
+flowchart TD
+ job[Limited capacity job] --> cleanup([ContainerExpirationPolicies::CleanupService])
+ cleanup --> cleanup_tags([Projects::ContainerRepository::CleanupTagsService])
+ cleanup_tags --> delete_tags([Projects::ContainerRepository::DeleteTagsService])
+```
+
+- [`ContainerExpirationPolicies::CleanupService`](https://gitlab.com/gitlab-org/gitlab/-/blob/6546ffc6fe4e9b447a1b7f050edddb8926fe4a3d/app/services/container_expiration_policies/cleanup_service.rb).
+This service mainly deals with container repository `expiration_policy_cleanup_status`
+updates and will call the cleanup tags service.
+- [`Projects::ContainerRepository::CleanupTagsService`](https://gitlab.com/gitlab-org/gitlab/-/blob/f23d70b7d638c38d71af102cfd32a3f6751596f9/app/services/projects/container_repository/cleanup_tags_service.rb).
+This service receives the policy parameters and builds the list of tags to
+destroy on the container registry.
+- [`Projects::ContainerRepository::DeleteTagsService`](https://gitlab.com/gitlab-org/gitlab/-/blob/f23d70b7d638c38d71af102cfd32a3f6751596f9/app/services/projects/container_repository/delete_tags_service.rb).
+This service receives a list of tags and loops on that list. For each tag,
+the service will call the container registry API endpoint to destroy the target tag.
+
+The cleanup tags service uses a very specific [execution order](../../user/packages/container_registry/reduce_container_registry_storage.md#how-the-cleanup-policy-works)
+to build the list of tags to destroy.
+
+Lastly, the cleanup tags service and delete tags service work using facades.
+The actual implementation depends on the type of container registry connected.
+If the GitLab container registry is connected, several improvements are available
+and used during cleanup policies execution, such as [better use of the container registry API](https://gitlab.com/groups/gitlab-org/-/epics/8379).
+
+### Historic reference links
+
+- [First iteration](https://gitlab.com/gitlab-org/gitlab/-/issues/15398)
+- [Throttling policy executions](https://gitlab.com/gitlab-org/gitlab/-/issues/208193)
+- [Adding caching](https://gitlab.com/gitlab-org/gitlab/-/issues/339129)
+- [Further improvements](https://gitlab.com/groups/gitlab-org/-/epics/8379)
diff --git a/doc/development/packages/index.md b/doc/development/packages/index.md
index 41d6e1b84fd..d587397adc7 100644
--- a/doc/development/packages/index.md
+++ b/doc/development/packages/index.md
@@ -10,6 +10,7 @@ Development and Architectural documentation for the package registry
- [Debian repository structure](debian_repository.md)
- [Dependency proxy structure](dependency_proxy.md)
+- [Cleanup policies](cleanup_policies.md)
- [Developing a new format](new_format_development.md)
- [Settings](settings.md)
- [Structure / Schema](structure.md)
diff --git a/doc/development/secure_coding_guidelines.md b/doc/development/secure_coding_guidelines.md
index 67f7c556055..59013c89687 100644
--- a/doc/development/secure_coding_guidelines.md
+++ b/doc/development/secure_coding_guidelines.md
@@ -1218,7 +1218,7 @@ GitLab-specific example can be found in [this issue](https://gitlab.com/gitlab-o
**Example 3:** you need to fetch a remote file, and perform a `HEAD` request to get and validate the content length and content type. When you subsequently make a `GET` request, though, the file delivered is a different size or different file type. (This is stretching the definition of TOCTOU, but things _have_ changed between time of check and time of use).
-**Example 4:** you allow users to upvote a comment if they haven't already. The server is multi-threaded, and you aren't using transactions or an applicable database index. By repeatedly clicking upvote in quick succession a malicious user is able to add multiple upvotes: the requests arrive at the same time, the checks run in parallel and confirm that no upvote exists yet, and so each upvote is written to the database.
+**Example 4:** you allow users to upvote a comment if they haven't already. The server is multi-threaded, and you aren't using transactions or an applicable database index. By repeatedly selecting upvote in quick succession a malicious user is able to add multiple upvotes: the requests arrive at the same time, the checks run in parallel and confirm that no upvote exists yet, and so each upvote is written to the database.
Here's some pseudocode showing an example of a potential TOCTOU bug:
diff --git a/doc/development/service_ping/metrics_instrumentation.md b/doc/development/service_ping/metrics_instrumentation.md
index 7a3f291460c..4b00d1fc56d 100644
--- a/doc/development/service_ping/metrics_instrumentation.md
+++ b/doc/development/service_ping/metrics_instrumentation.md
@@ -256,6 +256,13 @@ options:
## Aggregated metrics
+<div class="video-fallback">
+ See the video from: <a href="https://www.youtube.com/embed/22LbYqHwtUQ">Product Intelligence Office Hours Oct 6th</a> for an aggregated metrics walk-through.
+</div>
+<figure class="video-container">
+ <iframe src="https://www.youtube.com/embed/22LbYqHwtUQ" frameborder="0" allowfullscreen="true"> </iframe>
+</figure>
+
The aggregated metrics feature provides insight into the number of data attributes, for example `pseudonymized_user_ids`, that occurred in a collection of events. For example, you can aggregate the number of users who perform multiple actions such as creating a new issue and opening
a new merge request.
diff --git a/doc/development/testing_guide/end_to_end/style_guide.md b/doc/development/testing_guide/end_to_end/style_guide.md
index f380b24d7a5..419942d6b8f 100644
--- a/doc/development/testing_guide/end_to_end/style_guide.md
+++ b/doc/development/testing_guide/end_to_end/style_guide.md
@@ -12,7 +12,7 @@ This document describes the conventions used at GitLab for writing End-to-end (E
### When to use `click_`?
-When clicking in a single link to navigate, use `click_`.
+When selecting a single link to navigate, use `click_`.
For example:
@@ -24,9 +24,9 @@ def click_ci_cd_pipelines
end
```
-From a testing perspective, if we want to check that clicking a link, or a button (a single interaction) is working as intended, we would want the test to read as:
+From a testing perspective, if we want to check that selecting a link, or a button (a single interaction) is working as intended, we would want the test to read as:
-- Click a certain element
+- Select a certain element
- Verify the action took place
### When to use `go_to_`?
@@ -47,7 +47,7 @@ end
`go_to_` fits the definition of interacting with multiple elements very well given it's more of a meta-navigation action that includes multiple interactions.
-Notice that in the above example, before clicking the `:operations_environments_link`, another element is hovered over.
+Notice that in the above example, before selecting the `:operations_environments_link`, another element is hovered over.
> We can create these methods as helpers to abstract multi-step navigation.
diff --git a/doc/integration/advanced_search/elasticsearch.md b/doc/integration/advanced_search/elasticsearch.md
index 87b812f3f9b..94493aa6958 100644
--- a/doc/integration/advanced_search/elasticsearch.md
+++ b/doc/integration/advanced_search/elasticsearch.md
@@ -251,7 +251,7 @@ any subgroups and projects belonging to those subgroups to be indexed as well.
Advanced Search only provides cross-group code/commit search (global) if all name-spaces are indexed. In this particular scenario where only a subset of namespaces are indexed, a global search does not provide a code or commit scope. This is possible only in the scope of an indexed namespace. There is no way to code/commit search in multiple indexed namespaces (when only a subset of namespaces has been indexed). For example if two groups are indexed, there is no way to run a single code search on both. You can only run a code search on the first group and then on the second.
-You can filter the selection dropdown by writing part of the namespace or project name you're interested in.
+You can filter the selection dropdown list by writing part of the namespace or project name you're interested in.
![limit namespace filter](img/limit_namespace_filter.png)
diff --git a/doc/integration/jira/configure.md b/doc/integration/jira/configure.md
index 66339d5ec27..98d296db170 100644
--- a/doc/integration/jira/configure.md
+++ b/doc/integration/jira/configure.md
@@ -52,7 +52,7 @@ To configure your project:
can view all issues from the specified Jira project.
1. To enable [issue creation for vulnerabilities](../../user/application_security/vulnerabilities/index.md#create-a-jira-issue-for-a-vulnerability), select **Enable Jira issue creation from vulnerabilities**.
-1. Select the **Jira issue type**. If the dropdown is empty, select refresh (**{retry}**) and try again.
+1. Select the **Jira issue type**. If the dropdown list is empty, select refresh (**{retry}**) and try again.
1. To verify the Jira connection is working, select **Test settings**.
1. Select **Save changes**.
diff --git a/doc/operations/error_tracking.md b/doc/operations/error_tracking.md
index ebec8768b16..85b64eb7b3e 100644
--- a/doc/operations/error_tracking.md
+++ b/doc/operations/error_tracking.md
@@ -55,7 +55,7 @@ least Maintainer [permissions](../user/permissions.md) to enable the Sentry inte
1. Ensure the **Active** checkbox is selected.
1. In the **Sentry API URL** box, enter your Sentry hostname. For example, enter `https://sentry.example.com`. For the SaaS version of Sentry, the hostname is `https://sentry.io`.
1. In the **Auth Token** box, enter the token you previously generated.
-1. To test the connection to Sentry and populate the **Project** dropdown, select **Connect**.
+1. To test the connection to Sentry and populate the **Project** dropdown list, select **Connect**.
1. From the **Project** list, choose a Sentry project to link to your GitLab project.
1. Select **Save changes**.
@@ -131,12 +131,13 @@ If another event occurs, the error reverts to unresolved.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/329596) in GitLab 14.4.
> - [Disabled](https://gitlab.com/gitlab-org/gitlab/-/issues/353639) in GitLab 14.9 [with a flag](../administration/feature_flags.md) named `integrated_error_tracking`. Disabled by default.
+> - [Enabled on GitLab.com](https://gitlab.com/gitlab-com/gl-infra/production/-/issues/7586) in GitLab 15.6.
FLAG:
By default this feature is not available. To make it available on self-managed GitLab, ask an
administrator to [enable the feature flag](../administration/feature_flags.md)
named `integrated_error_tracking`. The feature is not ready for production use.
-On GitLab.com, please follow [our user guide](https://gitlab.com/gitlab-org/opstrace/opstrace/-/blob/main/docs/guides/user/error_tracking.md) to get started.
+On GitLab.com, this feature is available.
Integrated error tracking is a lightweight alternative to Sentry backend.
You still use Sentry SDK with your application. But you don't need to deploy Sentry
@@ -148,6 +149,14 @@ settings. By using a GitLab-provided DSN, your application connects to GitLab to
Those errors are stored in the GitLab database and rendered by the GitLab UI, in the same way as
Sentry integration.
+In GitLab 15.6 and later, the integrated error tracking is available as an
+[open Beta](../policy/alpha-beta-support.md#beta-features).
+It now uses a new backend based on the ClickHouse database that enables better scalability.
+Integrated error tracking remains limited in comparison to the Sentry backend, as only a small subset of the
+Sentry API is implemented.
+
+Changing the GitLab error UI to use the GitLab Observability UI is tracked in epic [19](https://gitlab.com/groups/gitlab-org/opstrace/-/epics/32).
+
### Project settings
You can find the feature configuration at **Settings > Monitor > Error Tracking**.
diff --git a/doc/operations/incident_management/alerts.md b/doc/operations/incident_management/alerts.md
index 32603aa3753..fbf7ba286cb 100644
--- a/doc/operations/incident_management/alerts.md
+++ b/doc/operations/incident_management/alerts.md
@@ -153,7 +153,7 @@ There are different actions available in GitLab to help triage and respond to al
**Triggered** is the default status for new alerts. For users with the Developer role or higher, the
alert status can be updated from these locations:
-- [Alert list](#alert-list): select the status dropdown corresponding to an alert, then select an
+- [Alert list](#alert-list): select the status dropdown list corresponding to an alert, then select an
alternate status.
- [Alert details page](#alert-details-page): select **Edit** in the right-hand side bar, then select
an alternate status.
@@ -213,7 +213,7 @@ To assign an alert:
GitLab creates a [to-do item](../../user/todos.md) for each user.
After completing their portion of investigating or fixing the alert, users can
-unassign themselves from the alert. To remove an assignee, select **Edit** next to the **Assignee** dropdown menu
+unassign themselves from the alert. To remove an assignee, select **Edit** next to the **Assignee** dropdown list
and clear the user from the list of assignees, or select **Unassigned**.
### Create a to-do item from an alert
diff --git a/doc/operations/incident_management/incidents.md b/doc/operations/incident_management/incidents.md
index edbe07f166c..a5d38b1a27c 100644
--- a/doc/operations/incident_management/incidents.md
+++ b/doc/operations/incident_management/incidents.md
@@ -35,7 +35,7 @@ To create an incident from the Issues List:
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/230857) in GitLab 13.4.
1. Go to **Issues > List**, and select **New issue**.
-1. In the **Type** dropdown, select **Incident**. Only fields relevant to
+1. In the **Type** dropdown list, select **Incident**. Only fields relevant to
incidents are displayed on the page.
1. Create the incident as needed, and select **Create issue** to save the
incident.
diff --git a/doc/operations/incident_management/integrations.md b/doc/operations/incident_management/integrations.md
index ae6ffe549d5..a54556bd3a2 100644
--- a/doc/operations/incident_management/integrations.md
+++ b/doc/operations/incident_management/integrations.md
@@ -36,7 +36,7 @@ receive alert payloads in JSON format. You can always
1. Sign in to GitLab as a user with the Maintainer role
for a project.
1. Navigate to **Settings > Monitor** in your project.
-1. Expand the **Alerts** section, and in the **Select integration type** dropdown menu,
+1. Expand the **Alerts** section, and in the **Select integration type** dropdown list,
select **HTTP Endpoint**.
1. Toggle the **Active** alert setting. The URL and Authorization Key for the webhook configuration
are available in the **View credentials** tab after you save the integration. You must also input
@@ -57,7 +57,7 @@ and you can [customize the payload](#customize-the-alert-payload-outside-of-gitl
1. For each endpoint you want to create:
1. Select **Add new integration**.
- 1. In the **Select integration type** dropdown menu, select **HTTP Endpoint**.
+ 1. In the **Select integration type** dropdown list, select **HTTP Endpoint**.
1. Name the integration.
1. Toggle the **Active** alert setting. The **URL** and **Authorization Key** for the webhook
configuration are available in the **View credentials** tab after you save the integration.
diff --git a/doc/operations/metrics/dashboards/index.md b/doc/operations/metrics/dashboards/index.md
index 4e0b50d1e04..aef9bcb4b22 100644
--- a/doc/operations/metrics/dashboards/index.md
+++ b/doc/operations/metrics/dashboards/index.md
@@ -66,7 +66,7 @@ To create a new dashboard from the command line:
1. Save the file, commit, and push to your repository. The file must be present in your **default** branch.
1. Navigate to your project's **Monitor > Metrics** and choose the custom
- dashboard from the dropdown.
+ dashboard from the dropdown list.
Your custom dashboard is available at `https://example.com/project/-/metrics/custom_dashboard_name.yml`.
@@ -125,7 +125,7 @@ can manage [the settings](settings.md) for your metrics dashboard.
## Chart Context Menu
You can take action related to a chart's data by selecting the
-**{ellipsis_v}** **More actions** dropdown box above the upper right corner of
+**{ellipsis_v}** **More actions** dropdown list above the upper right corner of
any chart on a dashboard:
![Context Menu](img/panel_context_menu_v14_0.png)
diff --git a/doc/operations/metrics/dashboards/templating_variables.md b/doc/operations/metrics/dashboards/templating_variables.md
index aac22236dc7..a1c2ce063bc 100644
--- a/doc/operations/metrics/dashboards/templating_variables.md
+++ b/doc/operations/metrics/dashboards/templating_variables.md
@@ -67,7 +67,7 @@ WARNING:
This variable type is an [Alpha](../../../policy/alpha-beta-support.md#alpha-features) feature, and is subject to change at any time
without prior notice!
-Each `custom` variable defined in the dashboard YAML creates a dropdown
+Each `custom` variable defined in the dashboard YAML creates a dropdown list
selector on the dashboard UI, allowing you to select a value for each variable.
The `custom` variable type supports a simple and a full syntax.
@@ -75,7 +75,7 @@ The `custom` variable type supports a simple and a full syntax.
### Simple syntax
This example creates a variable called `variable1`, with a default value of `value1`.
-The dashboard UI displays a dropdown with `value1`, `value2` and `value3`
+The dashboard UI displays a dropdown list with `value1`, `value2` and `value3`
as the choices.
```yaml
@@ -88,10 +88,10 @@ templating:
This example creates a variable called `variable1`, with a default value of `value_option_2`.
The label for the text box on the UI is the value of the `label` key.
-The dashboard UI displays a dropdown with `Option 1` and `Option 2`
+The dashboard UI displays a dropdown list with `Option 1` and `Option 2`
as the choices.
-If you select `Option 1` from the dropdown, the variable is replaced with `value option 1`.
+If you select `Option 1` from the dropdown list, the variable is replaced with `value option 1`.
Similarly, if you select `Option 2`, the variable is replaced with `value_option_2`:
```yaml
@@ -117,7 +117,7 @@ without prior notice!
### Full syntax
-This example creates a variable called `variable2`. The values of the dropdown are
+This example creates a variable called `variable2`. The values of the dropdown list are
all the different values of the `backend` label in the Prometheus series described by
`up{env="production"}`.
diff --git a/doc/user/application_security/terminology/index.md b/doc/user/application_security/terminology/index.md
index 085a762fffa..f156d60be8f 100644
--- a/doc/user/application_security/terminology/index.md
+++ b/doc/user/application_security/terminology/index.md
@@ -230,7 +230,7 @@ support for cheap scan is proposed in issue [349926](https://gitlab.com/gitlab-o
### Pre-filter
-An irreversible action that is done to filter out target(s) before analysis occurs. This is usually provided to allow
+An irreversible action that is done to filter out targets before analysis occurs. This is usually provided to allow
the user to reduce scope and noise as well as speed up the analysis. This should not be done if a record is needed as
we currently do not store anything related to the skipped/excluded code or assets.
diff --git a/doc/user/project/clusters/runbooks/index.md b/doc/user/project/clusters/runbooks/index.md
index c4ca82f7db4..df0ffff8561 100644
--- a/doc/user/project/clusters/runbooks/index.md
+++ b/doc/user/project/clusters/runbooks/index.md
@@ -166,11 +166,11 @@ the components outlined above and the pre-loaded demo runbook.
[GitLab Access Token](../../../profile/personal_access_tokens.md)
and your Project ID in the **Setup** section of the demo runbook:
- 1. Double-click the **DevOps-Runbook-Demo** folder located on the left panel.
+ 1. Select the **DevOps-Runbook-Demo** folder located on the left panel.
![demo runbook](img/demo-runbook.png)
- 1. Double-click the `Nurtch-DevOps-Demo.ipynb` runbook.
+ 1. Select the `Nurtch-DevOps-Demo.ipynb` runbook.
![sample runbook](img/sample-runbook.png)
diff --git a/doc/user/project/merge_requests/reviews/suggestions.md b/doc/user/project/merge_requests/reviews/suggestions.md
index 2d3682c62d4..1d91eee787b 100644
--- a/doc/user/project/merge_requests/reviews/suggestions.md
+++ b/doc/user/project/merge_requests/reviews/suggestions.md
@@ -12,7 +12,7 @@ type: index, reference
As a reviewer, you're able to suggest code changes with a Markdown syntax in merge request
diff threads. Then, the merge request author (or other users with appropriate
-[permission](../../../permissions.md)) can apply these suggestions with a click.
+[permission](../../../permissions.md)) can apply these suggestions.
This action generates a commit in the merge request, authored by the user that suggested the changes.
1. Choose a line of code to be changed, add a new comment, then select
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 01583dbe45d..3a7dd55b67a 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
@@ -18,9 +18,9 @@ these steps, you may have to do additional configuration for the Pages site to g
1. On the top bar, select **Main menu > Projects** and find your project.
1. On the left sidebar, select the project's name.
-1. From the **Add** (**{plus}**) dropdown, select **New file**.
-1. From the **Select a template type** dropdown, select `.gitlab-ci.yml`.
-1. From the **Apply a template** dropdown, in the **Pages** section, select the name of your SSG.
+1. From the **Add** (**{plus}**) dropdown list, select **New file**.
+1. From the **Select a template type** dropdown list, select `.gitlab-ci.yml`.
+1. From the **Apply a template** dropdown list, in the **Pages** section, select the name of your SSG.
1. In the **Commit message** box, type the commit message.
1. Select **Commit changes**.
diff --git a/doc/user/project/pages/pages_access_control.md b/doc/user/project/pages/pages_access_control.md
index be1ea236c87..b98772a6702 100644
--- a/doc/user/project/pages/pages_access_control.md
+++ b/doc/user/project/pages/pages_access_control.md
@@ -20,7 +20,7 @@ For a demonstration, see [Pages access controls](https://www.youtube.com/watch?v
1. Toggle the **Pages** button to enable the access control. If you don't see the toggle button,
that means it isn't enabled. Ask your administrator to [enable it](../../../administration/pages/index.md#access-control).
-1. The Pages access control dropdown allows you to set who can view pages hosted
+1. The Pages access control dropdown list allows you to set who can view pages hosted
with GitLab Pages, depending on your project's visibility:
- If your project is private:
diff --git a/doc/user/project/quick_actions.md b/doc/user/project/quick_actions.md
index 3471123f8b5..53b3212a164 100644
--- a/doc/user/project/quick_actions.md
+++ b/doc/user/project/quick_actions.md
@@ -80,7 +80,7 @@ threads. Some quick actions might not be available to all subscription tiers.
| `/iteration *iteration:"iteration name"` | **{check-circle}** Yes | **{dotted-circle}** No | **{dotted-circle}** No | Set iteration. For example, to set the `Late in July` iteration: `/iteration *iteration:"Late in July"` ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/196795) in GitLab 13.1). |
| `/label ~label1 ~label2` | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes | Add one or more labels. Label names can also start without a tilde (`~`), but mixed syntax is not supported. |
| `/lock` | **{check-circle}** Yes | **{check-circle}** Yes | **{dotted-circle}** No | Lock the discussions. |
-| `/link` | **{check-circle}** Yes | ****{dotted-circle}** No | **{dotted-circle}** No | Add a link and description to [linked resources](../../operations/incident_management/linked_resources.md) in an incident ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/374964) in GitLab 15.5). |
+| `/link` | **{check-circle}** Yes | **{dotted-circle}** No | **{dotted-circle}** No | Add a link and description to [linked resources](../../operations/incident_management/linked_resources.md) in an incident ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/374964) in GitLab 15.5). |
| `/merge` | **{dotted-circle}** No | **{check-circle}** Yes | **{dotted-circle}** No | Merge changes. Depending on the project setting, this may be [when the pipeline succeeds](merge_requests/merge_when_pipeline_succeeds.md), or adding to a [Merge Train](../../ci/pipelines/merge_trains.md). |
| `/milestone %milestone` | **{check-circle}** Yes | **{check-circle}** Yes | **{dotted-circle}** No | Set milestone. |
| `/move <path/to/project>` | **{check-circle}** Yes | **{dotted-circle}** No | **{dotted-circle}** No | Move this issue to another project. Be careful when moving an issue to a project with different access rules. Before moving the issue, make sure it does not contain sensitive data. |
diff --git a/doc/user/project/repository/web_editor.md b/doc/user/project/repository/web_editor.md
index e1f05cd5501..752d7e68d2d 100644
--- a/doc/user/project/repository/web_editor.md
+++ b/doc/user/project/repository/web_editor.md
@@ -10,13 +10,13 @@ Sometimes it's easier to make quick changes directly from the GitLab interface
than to clone the project and use the Git command-line tool. In this feature
highlight, we look at how you can create a new file, directory, branch, or
tag from the file browser. All of these actions are available from a single
-dropdown menu.
+dropdown list.
## Create a file
From a project's files page, select the '+' button to the right of the branch selector.
-Choose **New file** from the dropdown.
-![New file dropdown menu](img/web_editor_new_file_dropdown_v14_1.png)
+Choose **New file** from the dropdown list.
+![New file dropdown list](img/web_editor_new_file_dropdown_v14_1.png)
Enter a filename in the **Filename** box. Then, add file content in the editor
area. Add a descriptive commit message and choose a branch. The branch field
@@ -85,7 +85,7 @@ this case, you need to upload a file.
From a project's files page, select the '+' button to the right of the branch
selector. Choose **Upload file** from the dropdown:
-![Upload file dropdown menu](img/web_editor_upload_file_dropdown_v14_1.png)
+![Upload file dropdown list](img/web_editor_upload_file_dropdown_v14_1.png)
After the upload dialog pops up, there are two ways to upload your file. Either
drag and drop a file on the popup or use the **click to upload** link. After you
@@ -104,7 +104,7 @@ directory.
From a project's files page, select the plus button (`+`) to the right of the branch selector.
Choose **New directory** from the dropdown.
-![New directory dropdown](img/web_editor_new_directory_dropdown_v14_1.png)
+![New directory dropdown list](img/web_editor_new_directory_dropdown_v14_1.png)
In the new directory dialog, enter a directory name, a commit message, and choose
the target branch. Select **Create directory** to finish.
@@ -177,9 +177,9 @@ merge request is merged.
If you want to make changes to several files before creating a new merge
request, you can create a new branch upfront.
-1. From a project's files page, choose **New branch** from the dropdown.
+1. From a project's files page, choose **New branch** from the dropdown list.
- ![New branch dropdown](img/web_editor_new_branch_dropdown_v14_1.png)
+ ![New branch dropdown list](img/web_editor_new_branch_dropdown_v14_1.png)
1. Enter a new **Branch name**.
1. Optional. Change the **Create from** field to choose which branch, tag, or
@@ -202,9 +202,9 @@ Tags help you mark major milestones such as production releases and
release candidates. You can create a tag from a branch or a commit
SHA:
-1. From a project's files page, choose **New tag** from the dropdown.
+1. From a project's files page, choose **New tag** from the dropdown list.
- ![New tag dropdown](img/web_editor_new_tag_dropdown.png)
+ ![New tag dropdown list](img/web_editor_new_tag_dropdown.png)
1. Give the tag a name such as `v1.0.0`.
1. Choose the branch or SHA from which you want to create this new tag.
diff --git a/doc/user/project/requirements/index.md b/doc/user/project/requirements/index.md
index 3b1af1f688c..400f03ef0fe 100644
--- a/doc/user/project/requirements/index.md
+++ b/doc/user/project/requirements/index.md
@@ -120,8 +120,8 @@ You can search for a requirement from the requirements list page based on the fo
To search for a requirement:
1. In a project, go to **Issues > Requirements > List**.
-1. Select the **Search or filter results** field. A dropdown menu appears.
-1. Select the requirement author or status from the dropdown or enter plain text to search by requirement title.
+1. Select the **Search or filter results** field. A dropdown list appears.
+1. Select the requirement author or status from the dropdown list or enter plain text to search by requirement title.
1. Press <kbd>Enter</kbd> on your keyboard to filter the list.
You can also sort the requirements list by:
diff --git a/doc/user/project/web_ide/index.md b/doc/user/project/web_ide/index.md
index a0eac9376f2..7ecd1bb7782 100644
--- a/doc/user/project/web_ide/index.md
+++ b/doc/user/project/web_ide/index.md
@@ -202,12 +202,12 @@ left.
## Switching merge requests
To switch between your authored and assigned merge requests, select the
-dropdown in the top of the sidebar to open a list of merge requests. You must commit or discard all your changes before switching to a different merge
+dropdown list in the top of the sidebar to open a list of merge requests. You must commit or discard all your changes before switching to a different merge
request.
## Switching branches
-To switch between branches of the current project repository, select the dropdown
+To switch between branches of the current project repository, select the dropdown list
in the top of the sidebar to open a list of branches.
You must commit or discard all your changes before switching to a
different branch.
diff --git a/lib/atlassian/jira_connect/jwt/asymmetric.rb b/lib/atlassian/jira_connect/jwt/asymmetric.rb
index 0611a17c005..573a8022752 100644
--- a/lib/atlassian/jira_connect/jwt/asymmetric.rb
+++ b/lib/atlassian/jira_connect/jwt/asymmetric.rb
@@ -12,7 +12,8 @@ module Atlassian
KeyFetchError = Class.new(StandardError)
ALGORITHM = 'RS256'
- PUBLIC_KEY_CDN_URL = 'https://connect-install-keys.atlassian.com/'
+ DEFAULT_PUBLIC_KEY_CDN_URL = 'https://connect-install-keys.atlassian.com'
+ PROXY_PUBLIC_KEY_PATH = '/-/jira_connect/public_keys'
UUID4_REGEX = /\A[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\z/.freeze
def initialize(token, verification_claims)
@@ -60,7 +61,7 @@ module Atlassian
def retrieve_public_key(key_id)
raise KeyFetchError unless UUID4_REGEX.match?(key_id)
- public_key = Gitlab::HTTP.try_get(PUBLIC_KEY_CDN_URL + key_id).try(:body)
+ public_key = Gitlab::HTTP.try_get("#{public_key_cdn_url}/#{key_id}").try(:body)
raise KeyFetchError if public_key.blank?
@@ -74,6 +75,21 @@ module Atlassian
def verification_qsh
@verification_claims[:qsh]
end
+
+ def public_key_cdn_url
+ if public_key_cdn_url_setting.blank? || Feature.disabled?(:jira_connect_oauth_self_managed)
+ return DEFAULT_PUBLIC_KEY_CDN_URL
+ end
+
+ public_key_cdn_url_setting
+ end
+
+ def public_key_cdn_url_setting
+ @public_key_cdn_url_setting ||=
+ if Gitlab::CurrentSettings.jira_connect_proxy_url
+ Gitlab::Utils.append_path(Gitlab::CurrentSettings.jira_connect_proxy_url, PROXY_PUBLIC_KEY_PATH)
+ end
+ end
end
end
end
diff --git a/lib/gitlab/background_migration/backfill_cluster_agents_has_vulnerabilities.rb b/lib/gitlab/background_migration/backfill_cluster_agents_has_vulnerabilities.rb
index 2ee0594d0a6..249c9d7af57 100644
--- a/lib/gitlab/background_migration/backfill_cluster_agents_has_vulnerabilities.rb
+++ b/lib/gitlab/background_migration/backfill_cluster_agents_has_vulnerabilities.rb
@@ -16,11 +16,10 @@ module Gitlab
.where(has_vulnerabilities: false)
end
+ operation_name :update_all
+
def perform
- each_sub_batch(
- operation_name: :update_all,
- batching_scope: RELATION
- ) do |sub_batch|
+ each_sub_batch(batching_scope: RELATION) do |sub_batch|
sub_batch
.joins(VULNERABILITY_READS_JOIN)
.update_all(has_vulnerabilities: true)
diff --git a/lib/gitlab/background_migration/backfill_group_features.rb b/lib/gitlab/background_migration/backfill_group_features.rb
index 35b5282360f..4ea664e2529 100644
--- a/lib/gitlab/background_migration/backfill_group_features.rb
+++ b/lib/gitlab/background_migration/backfill_group_features.rb
@@ -5,10 +5,10 @@ module Gitlab
# Backfill group_features for an array of groups
class BackfillGroupFeatures < ::Gitlab::BackgroundMigration::BatchedMigrationJob
job_arguments :batch_size
+ operation_name :upsert_group_features
def perform
each_sub_batch(
- operation_name: :upsert_group_features,
batching_arguments: { order_hint: :type },
batching_scope: ->(relation) { relation.where(type: 'Group') }
) do |sub_batch|
diff --git a/lib/gitlab/background_migration/backfill_imported_issue_search_data.rb b/lib/gitlab/background_migration/backfill_imported_issue_search_data.rb
index b2d38ce6aa4..c95fed512c9 100644
--- a/lib/gitlab/background_migration/backfill_imported_issue_search_data.rb
+++ b/lib/gitlab/background_migration/backfill_imported_issue_search_data.rb
@@ -9,10 +9,10 @@ module Gitlab
class BackfillImportedIssueSearchData < BatchedMigrationJob
SUB_BATCH_SIZE = 1_000
+ operation_name :update_search_data
+
def perform
- each_sub_batch(
- operation_name: :update_search_data
- ) do |sub_batch|
+ each_sub_batch do |sub_batch|
update_search_data(sub_batch)
rescue ActiveRecord::StatementInvalid => e
raise unless e.cause.is_a?(PG::ProgramLimitExceeded) && e.message.include?('string is too long for tsvector')
diff --git a/lib/gitlab/background_migration/backfill_internal_on_notes.rb b/lib/gitlab/background_migration/backfill_internal_on_notes.rb
index 300f2cff6ca..fe05b4ec3c1 100644
--- a/lib/gitlab/background_migration/backfill_internal_on_notes.rb
+++ b/lib/gitlab/background_migration/backfill_internal_on_notes.rb
@@ -5,9 +5,10 @@ module Gitlab
# This syncs the data to `internal` from `confidential` as we rename the column.
class BackfillInternalOnNotes < BatchedMigrationJob
scope_to -> (relation) { relation.where(confidential: true) }
+ operation_name :update_all
def perform
- each_sub_batch(operation_name: :update_all) do |sub_batch|
+ each_sub_batch do |sub_batch|
sub_batch.update_all(internal: true)
end
end
diff --git a/lib/gitlab/background_migration/backfill_namespace_details.rb b/lib/gitlab/background_migration/backfill_namespace_details.rb
index b8a51b576b6..640d9379351 100644
--- a/lib/gitlab/background_migration/backfill_namespace_details.rb
+++ b/lib/gitlab/background_migration/backfill_namespace_details.rb
@@ -4,8 +4,10 @@ module Gitlab
module BackgroundMigration
# Backfill namespace_details for a range of namespaces
class BackfillNamespaceDetails < ::Gitlab::BackgroundMigration::BatchedMigrationJob
+ operation_name :backfill_namespace_details
+
def perform
- each_sub_batch(operation_name: :backfill_namespace_details) do |sub_batch|
+ each_sub_batch do |sub_batch|
upsert_namespace_details(sub_batch)
end
end
diff --git a/lib/gitlab/background_migration/backfill_namespace_id_of_vulnerability_reads.rb b/lib/gitlab/background_migration/backfill_namespace_id_of_vulnerability_reads.rb
index cd349bf3ae1..dca7f9fa921 100644
--- a/lib/gitlab/background_migration/backfill_namespace_id_of_vulnerability_reads.rb
+++ b/lib/gitlab/background_migration/backfill_namespace_id_of_vulnerability_reads.rb
@@ -4,6 +4,8 @@ module Gitlab
module BackgroundMigration
# Sets the `namespace_id` of the existing `vulnerability_reads` records
class BackfillNamespaceIdOfVulnerabilityReads < BatchedMigrationJob
+ operation_name :set_namespace_id
+
UPDATE_SQL = <<~SQL
UPDATE
vulnerability_reads
@@ -16,7 +18,7 @@ module Gitlab
SQL
def perform
- each_sub_batch(operation_name: :set_namespace_id) do |sub_batch|
+ each_sub_batch do |sub_batch|
update_query = update_query_for(sub_batch)
connection.execute(update_query)
diff --git a/lib/gitlab/background_migration/backfill_project_feature_package_registry_access_level.rb b/lib/gitlab/background_migration/backfill_project_feature_package_registry_access_level.rb
index ce4c4a28b37..6520cd63711 100644
--- a/lib/gitlab/background_migration/backfill_project_feature_package_registry_access_level.rb
+++ b/lib/gitlab/background_migration/backfill_project_feature_package_registry_access_level.rb
@@ -17,8 +17,10 @@ module Gitlab
self.table_name = 'project_features'
end
+ operation_name :update_all
+
def perform
- each_sub_batch(operation_name: :update_all) do |sub_batch|
+ each_sub_batch do |sub_batch|
ProjectFeature.connection.execute(
<<~SQL
UPDATE project_features pf
diff --git a/lib/gitlab/background_migration/backfill_project_import_level.rb b/lib/gitlab/background_migration/backfill_project_import_level.rb
index 06706b729ea..21c239e0070 100644
--- a/lib/gitlab/background_migration/backfill_project_import_level.rb
+++ b/lib/gitlab/background_migration/backfill_project_import_level.rb
@@ -3,6 +3,8 @@
module Gitlab
module BackgroundMigration
class BackfillProjectImportLevel < BatchedMigrationJob
+ operation_name :update_import_level
+
LEVEL = {
Gitlab::Access::NO_ACCESS => [0],
Gitlab::Access::DEVELOPER => [2],
@@ -11,7 +13,7 @@ module Gitlab
}.freeze
def perform
- each_sub_batch(operation_name: :update_import_level) do |sub_batch|
+ each_sub_batch do |sub_batch|
update_import_level(sub_batch)
end
end
diff --git a/lib/gitlab/background_migration/backfill_project_namespace_details.rb b/lib/gitlab/background_migration/backfill_project_namespace_details.rb
index 62d459acea2..9bee3cf21e8 100644
--- a/lib/gitlab/background_migration/backfill_project_namespace_details.rb
+++ b/lib/gitlab/background_migration/backfill_project_namespace_details.rb
@@ -3,8 +3,10 @@ module Gitlab
module BackgroundMigration
# Backfill project namespace_details for a range of projects
class BackfillProjectNamespaceDetails < ::Gitlab::BackgroundMigration::BatchedMigrationJob
+ operation_name :backfill_project_namespace_details
+
def perform
- each_sub_batch(operation_name: :backfill_project_namespace_details) do |sub_batch|
+ each_sub_batch do |sub_batch|
upsert_project_namespace_details(sub_batch)
end
end
diff --git a/lib/gitlab/background_migration/backfill_project_namespace_on_issues.rb b/lib/gitlab/background_migration/backfill_project_namespace_on_issues.rb
index 2e7d0c41509..34dd3321125 100644
--- a/lib/gitlab/background_migration/backfill_project_namespace_on_issues.rb
+++ b/lib/gitlab/background_migration/backfill_project_namespace_on_issues.rb
@@ -6,9 +6,10 @@ module Gitlab
class BackfillProjectNamespaceOnIssues < BatchedMigrationJob
MAX_UPDATE_RETRIES = 3
+ operation_name :update_all
+
def perform
each_sub_batch(
- operation_name: :update_all,
batching_scope: -> (relation) {
relation.joins("INNER JOIN projects ON projects.id = issues.project_id")
.select("issues.id AS issue_id, projects.project_namespace_id").where(issues: { namespace_id: nil })
diff --git a/lib/gitlab/background_migration/backfill_vulnerability_reads_cluster_agent.rb b/lib/gitlab/background_migration/backfill_vulnerability_reads_cluster_agent.rb
index 0c41d6af209..37b1a37569b 100644
--- a/lib/gitlab/background_migration/backfill_vulnerability_reads_cluster_agent.rb
+++ b/lib/gitlab/background_migration/backfill_vulnerability_reads_cluster_agent.rb
@@ -4,6 +4,8 @@ module Gitlab
module BackgroundMigration
# Backfills the `vulnerability_reads.casted_cluster_agent_id` column
class BackfillVulnerabilityReadsClusterAgent < Gitlab::BackgroundMigration::BatchedMigrationJob
+ operation_name :update_all
+
CLUSTER_AGENTS_JOIN = <<~SQL
INNER JOIN cluster_agents
ON CAST(vulnerability_reads.cluster_agent_id AS bigint) = cluster_agents.id AND
@@ -15,7 +17,7 @@ module Gitlab
scope_to ->(relation) { relation.where(report_type: CLUSTER_IMAGE_SCANNING_REPORT_TYPE) }
def perform
- each_sub_batch(operation_name: :update_all) do |sub_batch|
+ each_sub_batch do |sub_batch|
sub_batch
.joins(CLUSTER_AGENTS_JOIN)
.update_all('casted_cluster_agent_id = CAST(vulnerability_reads.cluster_agent_id AS bigint)')
diff --git a/lib/gitlab/background_migration/backfill_work_item_type_id_for_issues.rb b/lib/gitlab/background_migration/backfill_work_item_type_id_for_issues.rb
index 86d53ad798d..a020cabd1f4 100644
--- a/lib/gitlab/background_migration/backfill_work_item_type_id_for_issues.rb
+++ b/lib/gitlab/background_migration/backfill_work_item_type_id_for_issues.rb
@@ -19,10 +19,10 @@ module Gitlab
}
job_arguments :base_type, :base_type_id
+ operation_name :update_all
def perform
each_sub_batch(
- operation_name: :update_all,
batching_scope: -> (relation) { relation.where(work_item_type_id: nil) }
) do |sub_batch|
first, last = sub_batch.pick(Arel.sql('min(id), max(id)'))
diff --git a/lib/gitlab/background_migration/batched_migration_job.rb b/lib/gitlab/background_migration/batched_migration_job.rb
index 11d15804344..64401bc0674 100644
--- a/lib/gitlab/background_migration/batched_migration_job.rb
+++ b/lib/gitlab/background_migration/batched_migration_job.rb
@@ -36,6 +36,12 @@ module Gitlab
0
end
+ def self.operation_name(operation)
+ define_method('operation_name') do
+ operation
+ end
+ end
+
def self.job_arguments(*args)
args.each.with_index do |arg, index|
define_method(arg) do
@@ -70,7 +76,7 @@ module Gitlab
attr_reader :start_id, :end_id, :batch_table, :batch_column, :sub_batch_size, :pause_ms, :connection
- def each_sub_batch(operation_name: :default, batching_arguments: {}, batching_scope: nil)
+ def each_sub_batch(batching_arguments: {}, batching_scope: nil)
all_batching_arguments = { column: batch_column, of: sub_batch_size }.merge(batching_arguments)
relation = filter_batch(base_relation)
@@ -85,7 +91,7 @@ module Gitlab
end
end
- def distinct_each_batch(operation_name: :default, batching_arguments: {})
+ def distinct_each_batch(batching_arguments: {})
if base_relation != filter_batch(base_relation)
raise 'distinct_each_batch can not be used when additional filters are defined with scope_to'
end
@@ -111,6 +117,10 @@ module Gitlab
batching_scope.call(relation)
end
+
+ def operation_name
+ raise('Operation name is required, please define it with `operation_name`')
+ end
end
end
end
diff --git a/lib/gitlab/background_migration/copy_column_using_background_migration_job.rb b/lib/gitlab/background_migration/copy_column_using_background_migration_job.rb
index 15e54431a44..136293242b2 100644
--- a/lib/gitlab/background_migration/copy_column_using_background_migration_job.rb
+++ b/lib/gitlab/background_migration/copy_column_using_background_migration_job.rb
@@ -15,11 +15,12 @@ module Gitlab
# We use the provided primary_key column to perform the update.
class CopyColumnUsingBackgroundMigrationJob < BatchedMigrationJob
job_arguments :copy_from, :copy_to
+ operation_name :update_all
def perform
assignment_clauses = build_assignment_clauses(copy_from, copy_to)
- each_sub_batch(operation_name: :update_all) do |relation|
+ each_sub_batch do |relation|
relation.update_all(assignment_clauses)
end
end
diff --git a/lib/gitlab/background_migration/delete_orphaned_operational_vulnerabilities.rb b/lib/gitlab/background_migration/delete_orphaned_operational_vulnerabilities.rb
index c3e1019b72f..f93dcf83c49 100644
--- a/lib/gitlab/background_migration/delete_orphaned_operational_vulnerabilities.rb
+++ b/lib/gitlab/background_migration/delete_orphaned_operational_vulnerabilities.rb
@@ -16,13 +16,14 @@ module Gitlab
)
SQL
+ operation_name :delete_orphaned_operational_vulnerabilities
scope_to ->(relation) do
relation
.where(report_type: [REPORT_TYPES[:cluster_image_scanning], REPORT_TYPES[:custom]])
end
def perform
- each_sub_batch(operation_name: :delete_orphaned_operational_vulnerabilities) do |sub_batch|
+ each_sub_batch do |sub_batch|
sub_batch
.where(NOT_EXISTS_SQL)
.delete_all
diff --git a/lib/gitlab/background_migration/destroy_invalid_group_members.rb b/lib/gitlab/background_migration/destroy_invalid_group_members.rb
index 35ac42f76ab..9eb0d4489d6 100644
--- a/lib/gitlab/background_migration/destroy_invalid_group_members.rb
+++ b/lib/gitlab/background_migration/destroy_invalid_group_members.rb
@@ -9,8 +9,10 @@ module Gitlab
.where(namespaces: { id: nil })
end
+ operation_name :delete_all
+
def perform
- each_sub_batch(operation_name: :delete_all) do |sub_batch|
+ each_sub_batch do |sub_batch|
invalid_ids = sub_batch.map(&:id)
Gitlab::AppLogger.info({ message: 'Removing invalid group member records',
deleted_count: invalid_ids.size, ids: invalid_ids })
diff --git a/lib/gitlab/background_migration/destroy_invalid_members.rb b/lib/gitlab/background_migration/destroy_invalid_members.rb
index 7d78795bea9..17a141860ec 100644
--- a/lib/gitlab/background_migration/destroy_invalid_members.rb
+++ b/lib/gitlab/background_migration/destroy_invalid_members.rb
@@ -4,9 +4,10 @@ module Gitlab
module BackgroundMigration
class DestroyInvalidMembers < Gitlab::BackgroundMigration::BatchedMigrationJob # rubocop:disable Style/Documentation
scope_to ->(relation) { relation.where(member_namespace_id: nil) }
+ operation_name :delete_all
def perform
- each_sub_batch(operation_name: :delete_all) do |sub_batch|
+ each_sub_batch do |sub_batch|
deleted_members_data = sub_batch.map do |m|
{ id: m.id, source_id: m.source_id, source_type: m.source_type }
end
diff --git a/lib/gitlab/background_migration/destroy_invalid_project_members.rb b/lib/gitlab/background_migration/destroy_invalid_project_members.rb
index 3c60f765c29..53b4712ef6e 100644
--- a/lib/gitlab/background_migration/destroy_invalid_project_members.rb
+++ b/lib/gitlab/background_migration/destroy_invalid_project_members.rb
@@ -4,9 +4,10 @@ module Gitlab
module BackgroundMigration
class DestroyInvalidProjectMembers < Gitlab::BackgroundMigration::BatchedMigrationJob # rubocop:disable Style/Documentation
scope_to ->(relation) { relation.where(source_type: 'Project') }
+ operation_name :delete_all
def perform
- each_sub_batch(operation_name: :delete_all) do |sub_batch|
+ each_sub_batch do |sub_batch|
invalid_project_members = sub_batch
.joins('LEFT OUTER JOIN projects ON members.source_id = projects.id')
.where(projects: { id: nil })
diff --git a/lib/gitlab/background_migration/disable_legacy_open_source_licence_for_recent_public_projects.rb b/lib/gitlab/background_migration/disable_legacy_open_source_licence_for_recent_public_projects.rb
index 824054b31f2..b32e88581dd 100644
--- a/lib/gitlab/background_migration/disable_legacy_open_source_licence_for_recent_public_projects.rb
+++ b/lib/gitlab/background_migration/disable_legacy_open_source_licence_for_recent_public_projects.rb
@@ -7,6 +7,8 @@ module Gitlab
PUBLIC = 20
THRESHOLD_DATE = '2022-02-17 09:00:00'
+ operation_name :disable_legacy_open_source_licence_for_recent_public_projects
+
# Migration only version of `project_settings` table
class ProjectSetting < ApplicationRecord
self.table_name = 'project_settings'
@@ -14,7 +16,6 @@ module Gitlab
def perform
each_sub_batch(
- operation_name: :disable_legacy_open_source_licence_for_recent_public_projects,
batching_scope: ->(relation) {
relation.where(visibility_level: PUBLIC).where('created_at >= ?', THRESHOLD_DATE)
}
diff --git a/lib/gitlab/background_migration/disable_legacy_open_source_license_for_inactive_public_projects.rb b/lib/gitlab/background_migration/disable_legacy_open_source_license_for_inactive_public_projects.rb
index e759d504f8d..5685b782a71 100644
--- a/lib/gitlab/background_migration/disable_legacy_open_source_license_for_inactive_public_projects.rb
+++ b/lib/gitlab/background_migration/disable_legacy_open_source_license_for_inactive_public_projects.rb
@@ -8,6 +8,8 @@ module Gitlab
PUBLIC = 20
LAST_ACTIVITY_DATE = '2021-07-01'
+ operation_name :disable_legacy_open_source_license_available
+
# Migration only version of `project_settings` table
class ProjectSetting < ApplicationRecord
self.table_name = 'project_settings'
@@ -15,7 +17,6 @@ module Gitlab
def perform
each_sub_batch(
- operation_name: :disable_legacy_open_source_license_available,
batching_scope: ->(relation) {
relation.where(visibility_level: PUBLIC).where('last_activity_at < ?', LAST_ACTIVITY_DATE)
}
diff --git a/lib/gitlab/background_migration/disable_legacy_open_source_license_for_no_issues_no_repo_projects.rb b/lib/gitlab/background_migration/disable_legacy_open_source_license_for_no_issues_no_repo_projects.rb
index 019c3d15b3e..b5e5555bd2d 100644
--- a/lib/gitlab/background_migration/disable_legacy_open_source_license_for_no_issues_no_repo_projects.rb
+++ b/lib/gitlab/background_migration/disable_legacy_open_source_license_for_no_issues_no_repo_projects.rb
@@ -6,6 +6,8 @@ module Gitlab
class DisableLegacyOpenSourceLicenseForNoIssuesNoRepoProjects < ::Gitlab::BackgroundMigration::BatchedMigrationJob
PUBLIC = 20
+ operation_name :disable_legacy_open_source_license_for_no_issues_no_repo_projects
+
# Migration only version of `project_settings` table
class ProjectSetting < ApplicationRecord
self.table_name = 'project_settings'
@@ -13,7 +15,6 @@ module Gitlab
def perform
each_sub_batch(
- operation_name: :disable_legacy_open_source_license_for_no_issues_no_repo_projects,
batching_scope: ->(relation) { relation.where(visibility_level: PUBLIC) }
) do |sub_batch|
no_issues_no_repo_projects =
diff --git a/lib/gitlab/background_migration/disable_legacy_open_source_license_for_one_member_no_repo_projects.rb b/lib/gitlab/background_migration/disable_legacy_open_source_license_for_one_member_no_repo_projects.rb
index 3a9049b1f19..89863458676 100644
--- a/lib/gitlab/background_migration/disable_legacy_open_source_license_for_one_member_no_repo_projects.rb
+++ b/lib/gitlab/background_migration/disable_legacy_open_source_license_for_one_member_no_repo_projects.rb
@@ -6,6 +6,8 @@ module Gitlab
class DisableLegacyOpenSourceLicenseForOneMemberNoRepoProjects < ::Gitlab::BackgroundMigration::BatchedMigrationJob
PUBLIC = 20
+ operation_name :disable_legacy_open_source_license_for_one_member_no_repo_projects
+
# Migration only version of `project_settings` table
class ProjectSetting < ApplicationRecord
self.table_name = 'project_settings'
@@ -13,7 +15,6 @@ module Gitlab
def perform
each_sub_batch(
- operation_name: :disable_legacy_open_source_license_for_one_member_no_repo_projects,
batching_scope: ->(relation) { relation.where(visibility_level: PUBLIC) }
) do |sub_batch|
one_member_no_repo_projects =
diff --git a/lib/gitlab/background_migration/disable_legacy_open_source_license_for_projects_less_than_one_mb.rb b/lib/gitlab/background_migration/disable_legacy_open_source_license_for_projects_less_than_one_mb.rb
index 6e4d5d8ddcb..7d93f2d4fda 100644
--- a/lib/gitlab/background_migration/disable_legacy_open_source_license_for_projects_less_than_one_mb.rb
+++ b/lib/gitlab/background_migration/disable_legacy_open_source_license_for_projects_less_than_one_mb.rb
@@ -5,9 +5,10 @@ module Gitlab
# Set `project_settings.legacy_open_source_license_available` to false for projects less than 1 MB
class DisableLegacyOpenSourceLicenseForProjectsLessThanOneMb < ::Gitlab::BackgroundMigration::BatchedMigrationJob
scope_to ->(relation) { relation.where(legacy_open_source_license_available: true) }
+ operation_name :disable_legacy_open_source_license_for_projects_less_than_one_mb
def perform
- each_sub_batch(operation_name: :disable_legacy_open_source_license_for_projects_less_than_one_mb) do |sub_batch|
+ each_sub_batch do |sub_batch|
updates = { legacy_open_source_license_available: false, updated_at: Time.current }
sub_batch
diff --git a/lib/gitlab/background_migration/expire_o_auth_tokens.rb b/lib/gitlab/background_migration/expire_o_auth_tokens.rb
index 595e4ac9dc8..08bcdb8a789 100644
--- a/lib/gitlab/background_migration/expire_o_auth_tokens.rb
+++ b/lib/gitlab/background_migration/expire_o_auth_tokens.rb
@@ -4,9 +4,10 @@ module Gitlab
module BackgroundMigration
# Add expiry to all OAuth access tokens
class ExpireOAuthTokens < ::Gitlab::BackgroundMigration::BatchedMigrationJob
+ operation_name :update_oauth_tokens
+
def perform
each_sub_batch(
- operation_name: :update_oauth_tokens,
batching_scope: ->(relation) { relation.where(expires_in: nil) }
) do |sub_batch|
update_oauth_tokens(sub_batch)
diff --git a/lib/gitlab/background_migration/populate_operation_visibility_permissions_from_operations.rb b/lib/gitlab/background_migration/populate_operation_visibility_permissions_from_operations.rb
index 3f04e04fc4d..3dd867fa1fe 100644
--- a/lib/gitlab/background_migration/populate_operation_visibility_permissions_from_operations.rb
+++ b/lib/gitlab/background_migration/populate_operation_visibility_permissions_from_operations.rb
@@ -6,8 +6,10 @@ module Gitlab
# monitor_access_level, deployments_access_level, infrastructure_access_level.
# The operations_access_level setting is being split into three seperate toggles.
class PopulateOperationVisibilityPermissionsFromOperations < BatchedMigrationJob
+ operation_name :populate_operations_visibility
+
def perform
- each_sub_batch(operation_name: :populate_operations_visibility) do |batch|
+ each_sub_batch do |batch|
batch.update_all('monitor_access_level=operations_access_level,' \
'infrastructure_access_level=operations_access_level,' \
' feature_flags_access_level=operations_access_level,'\
diff --git a/lib/gitlab/background_migration/remove_backfilled_job_artifacts_expire_at.rb b/lib/gitlab/background_migration/remove_backfilled_job_artifacts_expire_at.rb
index d30263976e8..dc7c16d7947 100644
--- a/lib/gitlab/background_migration/remove_backfilled_job_artifacts_expire_at.rb
+++ b/lib/gitlab/background_migration/remove_backfilled_job_artifacts_expire_at.rb
@@ -6,6 +6,8 @@ module Gitlab
# https://gitlab.com/gitlab-org/gitlab/-/merge_requests/47723.
# These job artifacts will not be deleted and will have their `expire_at` removed.
class RemoveBackfilledJobArtifactsExpireAt < BatchedMigrationJob
+ operation_name :update_all
+
# The migration would have backfilled `expire_at`
# to midnight on the 22nd of the month of the local timezone,
# storing it as UTC time in the database.
@@ -32,9 +34,7 @@ module Gitlab
}
def perform
- each_sub_batch(
- operation_name: :update_all
- ) do |sub_batch|
+ each_sub_batch do |sub_batch|
sub_batch.update_all(expire_at: nil)
end
end
diff --git a/lib/gitlab/background_migration/remove_self_managed_wiki_notes.rb b/lib/gitlab/background_migration/remove_self_managed_wiki_notes.rb
index 5b1d630bb03..a284c04d4f5 100644
--- a/lib/gitlab/background_migration/remove_self_managed_wiki_notes.rb
+++ b/lib/gitlab/background_migration/remove_self_managed_wiki_notes.rb
@@ -4,10 +4,10 @@ module Gitlab
module BackgroundMigration
# Removes obsolete wiki notes
class RemoveSelfManagedWikiNotes < BatchedMigrationJob
+ operation_name :delete_all
+
def perform
- each_sub_batch(
- operation_name: :delete_all
- ) do |sub_batch|
+ each_sub_batch do |sub_batch|
sub_batch.where(noteable_type: 'Wiki').delete_all
end
end
diff --git a/lib/gitlab/background_migration/rename_task_system_note_to_checklist_item.rb b/lib/gitlab/background_migration/rename_task_system_note_to_checklist_item.rb
index 718fb0aaa71..1b13c2ab7ef 100644
--- a/lib/gitlab/background_migration/rename_task_system_note_to_checklist_item.rb
+++ b/lib/gitlab/background_migration/rename_task_system_note_to_checklist_item.rb
@@ -13,8 +13,10 @@ module Gitlab
relation.where(system_note_metadata: { action: :task })
}
+ operation_name :update_all
+
def perform
- each_sub_batch(operation_name: :update_all) do |sub_batch|
+ each_sub_batch do |sub_batch|
ApplicationRecord.connection.execute <<~SQL
UPDATE notes
SET note = REGEXP_REPLACE(notes.note,'#{REPLACE_REGEX}', '#{TEXT_REPLACEMENT}')
diff --git a/lib/gitlab/background_migration/reset_duplicate_ci_runners_token_encrypted_values.rb b/lib/gitlab/background_migration/reset_duplicate_ci_runners_token_encrypted_values.rb
index 952f3b0e3c3..832385fd662 100644
--- a/lib/gitlab/background_migration/reset_duplicate_ci_runners_token_encrypted_values.rb
+++ b/lib/gitlab/background_migration/reset_duplicate_ci_runners_token_encrypted_values.rb
@@ -4,8 +4,10 @@ module Gitlab
module BackgroundMigration
# A job to nullify duplicate token_encrypted values in ci_runners table in batches
class ResetDuplicateCiRunnersTokenEncryptedValues < BatchedMigrationJob
+ operation_name :nullify_duplicate_ci_runner_token_encrypted_values
+
def perform
- each_sub_batch(operation_name: :nullify_duplicate_ci_runner_token_encrypted_values) do |sub_batch|
+ each_sub_batch do |sub_batch|
# Reset duplicate runner encrypted tokens that would prevent creating an unique index.
nullify_duplicate_ci_runner_token_encrypted_values(sub_batch)
end
diff --git a/lib/gitlab/background_migration/reset_duplicate_ci_runners_token_values.rb b/lib/gitlab/background_migration/reset_duplicate_ci_runners_token_values.rb
index cfd6a4e4091..5f552accd8d 100644
--- a/lib/gitlab/background_migration/reset_duplicate_ci_runners_token_values.rb
+++ b/lib/gitlab/background_migration/reset_duplicate_ci_runners_token_values.rb
@@ -4,8 +4,10 @@ module Gitlab
module BackgroundMigration
# A job to nullify duplicate token values in ci_runners table in batches
class ResetDuplicateCiRunnersTokenValues < BatchedMigrationJob
+ operation_name :nullify_duplicate_ci_runner_token_values
+
def perform
- each_sub_batch(operation_name: :nullify_duplicate_ci_runner_token_values) do |sub_batch|
+ each_sub_batch do |sub_batch|
# Reset duplicate runner tokens that would prevent creating an unique index.
nullify_duplicate_ci_runner_token_values(sub_batch)
end
diff --git a/lib/gitlab/background_migration/set_correct_vulnerability_state.rb b/lib/gitlab/background_migration/set_correct_vulnerability_state.rb
index a0cfeed618a..dfd71bb8b5f 100644
--- a/lib/gitlab/background_migration/set_correct_vulnerability_state.rb
+++ b/lib/gitlab/background_migration/set_correct_vulnerability_state.rb
@@ -7,9 +7,10 @@ module Gitlab
DISMISSED_STATE = 2
scope_to ->(relation) { relation.where.not(dismissed_at: nil) }
+ operation_name :update_vulnerabilities_state
def perform
- each_sub_batch(operation_name: :update_vulnerabilities_state) do |sub_batch|
+ each_sub_batch do |sub_batch|
sub_batch.update_all(state: DISMISSED_STATE)
end
end
diff --git a/lib/gitlab/background_migration/set_legacy_open_source_license_available_for_non_public_projects.rb b/lib/gitlab/background_migration/set_legacy_open_source_license_available_for_non_public_projects.rb
index e85b1bc402a..4ae7ad897cf 100644
--- a/lib/gitlab/background_migration/set_legacy_open_source_license_available_for_non_public_projects.rb
+++ b/lib/gitlab/background_migration/set_legacy_open_source_license_available_for_non_public_projects.rb
@@ -6,6 +6,8 @@ module Gitlab
class SetLegacyOpenSourceLicenseAvailableForNonPublicProjects < ::Gitlab::BackgroundMigration::BatchedMigrationJob
PUBLIC = 20
+ operation_name :set_legacy_open_source_license_available
+
# Migration only version of `project_settings` table
class ProjectSetting < ApplicationRecord
self.table_name = 'project_settings'
@@ -13,7 +15,6 @@ module Gitlab
def perform
each_sub_batch(
- operation_name: :set_legacy_open_source_license_available,
batching_scope: ->(relation) { relation.where.not(visibility_level: PUBLIC) }
) do |sub_batch|
ProjectSetting.where(project_id: sub_batch).update_all(legacy_open_source_license_available: false)
diff --git a/lib/gitlab/background_migration/update_delayed_project_removal_to_null_for_user_namespaces.rb b/lib/gitlab/background_migration/update_delayed_project_removal_to_null_for_user_namespaces.rb
index 04a2ceebef8..b2cf8298e4f 100644
--- a/lib/gitlab/background_migration/update_delayed_project_removal_to_null_for_user_namespaces.rb
+++ b/lib/gitlab/background_migration/update_delayed_project_removal_to_null_for_user_namespaces.rb
@@ -10,10 +10,10 @@ module Gitlab
self.table_name = 'namespace_settings'
end
+ operation_name :set_delayed_project_removal_to_null_for_user_namespace
+
def perform
- each_sub_batch(
- operation_name: :set_delayed_project_removal_to_null_for_user_namespace
- ) do |sub_batch|
+ each_sub_batch do |sub_batch|
set_delayed_project_removal_to_null_for_user_namespace(sub_batch)
end
end
diff --git a/lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml b/lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml
index d994ed70ea9..7a208584c4c 100644
--- a/lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml
+++ b/lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml
@@ -1,5 +1,5 @@
variables:
- DAST_AUTO_DEPLOY_IMAGE_VERSION: 'v2.39.0'
+ DAST_AUTO_DEPLOY_IMAGE_VERSION: 'v2.42.1'
.dast-auto-deploy:
image: "${CI_TEMPLATE_REGISTRY_HOST}/gitlab-org/cluster-integration/auto-deploy-image:${DAST_AUTO_DEPLOY_IMAGE_VERSION}"
diff --git a/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml b/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml
index 7ad71625436..292b0a0036d 100644
--- a/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml
+++ b/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml
@@ -1,5 +1,5 @@
variables:
- AUTO_DEPLOY_IMAGE_VERSION: 'v2.39.0'
+ AUTO_DEPLOY_IMAGE_VERSION: 'v2.42.1'
.auto-deploy:
image: "${CI_TEMPLATE_REGISTRY_HOST}/gitlab-org/cluster-integration/auto-deploy-image:${AUTO_DEPLOY_IMAGE_VERSION}"
diff --git a/lib/gitlab/ci/templates/Jobs/Deploy.latest.gitlab-ci.yml b/lib/gitlab/ci/templates/Jobs/Deploy.latest.gitlab-ci.yml
index 10c843f60a6..ba03ad6304f 100644
--- a/lib/gitlab/ci/templates/Jobs/Deploy.latest.gitlab-ci.yml
+++ b/lib/gitlab/ci/templates/Jobs/Deploy.latest.gitlab-ci.yml
@@ -1,5 +1,5 @@
variables:
- AUTO_DEPLOY_IMAGE_VERSION: 'v2.39.0'
+ AUTO_DEPLOY_IMAGE_VERSION: 'v2.42.1'
.auto-deploy:
image: "${CI_TEMPLATE_REGISTRY_HOST}/gitlab-org/cluster-integration/auto-deploy-image:${AUTO_DEPLOY_IMAGE_VERSION}"
diff --git a/lib/gitlab/instrumentation/redis_interceptor.rb b/lib/gitlab/instrumentation/redis_interceptor.rb
index 7e2acb91b94..02c96d632b0 100644
--- a/lib/gitlab/instrumentation/redis_interceptor.rb
+++ b/lib/gitlab/instrumentation/redis_interceptor.rb
@@ -5,14 +5,6 @@ module Gitlab
module RedisInterceptor
APDEX_EXCLUDE = %w[brpop blpop brpoplpush bzpopmin bzpopmax xread xreadgroup].freeze
- class MysteryRedisDurationError < StandardError
- attr_reader :backtrace
-
- def initialize(backtrace)
- @backtrace = backtrace
- end
- end
-
def call(command)
instrument_call([command]) do
super
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 9a63f1a34f6..4fd45a65c0c 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -23000,6 +23000,9 @@ msgstr ""
msgid "JiraConnect|Jira Connect Application ID"
msgstr ""
+msgid "JiraConnect|Jira Connect Proxy URL"
+msgstr ""
+
msgid "JiraConnect|New branch was successfully created."
msgstr ""
diff --git a/qa/lib/gitlab/page/group/settings/usage_quotas.rb b/qa/lib/gitlab/page/group/settings/usage_quotas.rb
index a1ab345bf1e..8540bce3da8 100644
--- a/qa/lib/gitlab/page/group/settings/usage_quotas.rb
+++ b/qa/lib/gitlab/page/group/settings/usage_quotas.rb
@@ -7,6 +7,11 @@ module Gitlab
class UsageQuotas < Chemlab::Page
# Seats section
link :seats_tab
+ div :seats_in_use
+ p :seats_used
+ p :seats_owed
+ table :subscription_users
+ button :remove_user
# Pipelines section
link :pipelines_tab
diff --git a/qa/lib/gitlab/page/group/settings/usage_quota.stub.rb b/qa/lib/gitlab/page/group/settings/usage_quotas.stub.rb
index 2a5d9a6bb5e..6c38625bb3b 100644
--- a/qa/lib/gitlab/page/group/settings/usage_quota.stub.rb
+++ b/qa/lib/gitlab/page/group/settings/usage_quotas.stub.rb
@@ -4,7 +4,7 @@ module Gitlab
module Page
module Group
module Settings
- module UsageQuota
+ module UsageQuotas
# @note Defined as +link :seats_tab+
# Clicks +seats_tab+
def seats_tab
@@ -12,8 +12,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota.seats_tab_element).to exist
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.seats_tab_element).to exist
# end
# @return [Watir::Link] The raw +Link+ element
def seats_tab_element
@@ -21,14 +21,134 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota).to be_seats_tab
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_seats_tab
# end
# @return [Boolean] true if the +seats_tab+ element is present on the page
def seats_tab?
# This is a stub, used for indexing. The method is dynamically generated.
end
+ # @note Defined as +div :seats_in_use+
+ # @return [String] The text content or value of +seats_in_use+
+ def seats_in_use
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.seats_in_use_element).to exist
+ # end
+ # @return [Watir::Div] The raw +Div+ element
+ def seats_in_use_element
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_seats_in_use
+ # end
+ # @return [Boolean] true if the +seats_in_use+ element is present on the page
+ def seats_in_use?
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @note Defined as +p :seats_used+
+ # @return [String] The text content or value of +seats_used+
+ def seats_used
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.seats_used_element).to exist
+ # end
+ # @return [Watir::P] The raw +P+ element
+ def seats_used_element
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_seats_used
+ # end
+ # @return [Boolean] true if the +seats_used+ element is present on the page
+ def seats_used?
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @note Defined as +p :seats_owed+
+ # @return [String] The text content or value of +seats_owed+
+ def seats_owed
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.seats_owed_element).to exist
+ # end
+ # @return [Watir::P] The raw +P+ element
+ def seats_owed_element
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_seats_owed
+ # end
+ # @return [Boolean] true if the +seats_owed+ element is present on the page
+ def seats_owed?
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @note Defined as +table :subscription_users+
+ # @return [String] The text content or value of +subscription_users+
+ def subscription_users
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.subscription_users_element).to exist
+ # end
+ # @return [Watir::Table] The raw +Table+ element
+ def subscription_users_element
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_subscription_users
+ # end
+ # @return [Boolean] true if the +subscription_users+ element is present on the page
+ def subscription_users?
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @note Defined as +button :remove_user+
+ # Clicks +remove_user+
+ def remove_user
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.remove_user_element).to exist
+ # end
+ # @return [Watir::Button] The raw +Button+ element
+ def remove_user_element
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_remove_user
+ # end
+ # @return [Boolean] true if the +remove_user+ element is present on the page
+ def remove_user?
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
# @note Defined as +link :pipelines_tab+
# Clicks +pipelines_tab+
def pipelines_tab
@@ -36,8 +156,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota.pipelines_tab_element).to exist
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.pipelines_tab_element).to exist
# end
# @return [Watir::Link] The raw +Link+ element
def pipelines_tab_element
@@ -45,8 +165,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota).to be_pipelines_tab
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_pipelines_tab
# end
# @return [Boolean] true if the +pipelines_tab+ element is present on the page
def pipelines_tab?
@@ -60,8 +180,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota.buy_ci_minutes_element).to exist
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.buy_ci_minutes_element).to exist
# end
# @return [Watir::Link] The raw +Link+ element
def buy_ci_minutes_element
@@ -69,8 +189,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota).to be_buy_ci_minutes
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_buy_ci_minutes
# end
# @return [Boolean] true if the +buy_ci_minutes+ element is present on the page
def buy_ci_minutes?
@@ -84,8 +204,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota.plan_ci_minutes_element).to exist
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.plan_ci_minutes_element).to exist
# end
# @return [Watir::Div] The raw +Div+ element
def plan_ci_minutes_element
@@ -93,8 +213,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota).to be_plan_ci_minutes
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_plan_ci_minutes
# end
# @return [Boolean] true if the +plan_ci_minutes+ element is present on the page
def plan_ci_minutes?
@@ -108,8 +228,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota.additional_ci_minutes_element).to exist
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.additional_ci_minutes_element).to exist
# end
# @return [Watir::Div] The raw +Div+ element
def additional_ci_minutes_element
@@ -117,8 +237,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota).to be_additional_ci_minutes
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_additional_ci_minutes
# end
# @return [Boolean] true if the +additional_ci_minutes+ element is present on the page
def additional_ci_minutes?
@@ -132,8 +252,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota.ci_purchase_successful_alert_element).to exist
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.ci_purchase_successful_alert_element).to exist
# end
# @return [Watir::Div] The raw +Div+ element
def ci_purchase_successful_alert_element
@@ -141,8 +261,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota).to be_ci_purchase_successful_alert
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_ci_purchase_successful_alert
# end
# @return [Boolean] true if the +ci_purchase_successful_alert+ element is present on the page
def ci_purchase_successful_alert?
@@ -156,8 +276,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota.storage_tab_element).to exist
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.storage_tab_element).to exist
# end
# @return [Watir::Link] The raw +Link+ element
def storage_tab_element
@@ -165,35 +285,35 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota).to be_storage_tab
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_storage_tab
# end
# @return [Boolean] true if the +storage_tab+ element is present on the page
def storage_tab?
# This is a stub, used for indexing. The method is dynamically generated.
end
- # @note Defined as +link :buy_storage+
- # Clicks +buy_storage+
- def buy_storage
+ # @note Defined as +link :purchase_more_storage+
+ # Clicks +purchase_more_storage+
+ def purchase_more_storage
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota.buy_storage_element).to exist
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.purchase_more_storage_element).to exist
# end
# @return [Watir::Link] The raw +Link+ element
- def buy_storage_element
+ def purchase_more_storage_element
# This is a stub, used for indexing. The method is dynamically generated.
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota).to be_buy_storage
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_purchase_more_storage
# end
- # @return [Boolean] true if the +buy_storage+ element is present on the page
- def buy_storage?
+ # @return [Boolean] true if the +purchase_more_storage+ element is present on the page
+ def purchase_more_storage?
# This is a stub, used for indexing. The method is dynamically generated.
end
@@ -204,8 +324,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota.used_storage_message_element).to exist
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.used_storage_message_element).to exist
# end
# @return [Watir::Div] The raw +Div+ element
def used_storage_message_element
@@ -213,8 +333,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota).to be_used_storage_message
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_used_storage_message
# end
# @return [Boolean] true if the +used_storage_message+ element is present on the page
def used_storage_message?
@@ -228,8 +348,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota.group_usage_message_element).to exist
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.group_usage_message_element).to exist
# end
# @return [Watir::Div] The raw +Div+ element
def group_usage_message_element
@@ -237,8 +357,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota).to be_group_usage_message
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_group_usage_message
# end
# @return [Boolean] true if the +group_usage_message+ element is present on the page
def group_usage_message?
@@ -252,8 +372,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota.dependency_proxy_usage_element).to exist
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.dependency_proxy_usage_element).to exist
# end
# @return [Watir::Div] The raw +Div+ element
def dependency_proxy_usage_element
@@ -261,8 +381,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota).to be_dependency_proxy_usage
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_dependency_proxy_usage
# end
# @return [Boolean] true if the +dependency_proxy_usage+ element is present on the page
def dependency_proxy_usage?
@@ -276,8 +396,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota.dependency_proxy_size_element).to exist
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.dependency_proxy_size_element).to exist
# end
# @return [Watir::Span] The raw +Span+ element
def dependency_proxy_size_element
@@ -285,8 +405,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota).to be_dependency_proxy_size
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_dependency_proxy_size
# end
# @return [Boolean] true if the +dependency_proxy_size+ element is present on the page
def dependency_proxy_size?
@@ -300,8 +420,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota.container_registry_usage_element).to exist
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.container_registry_usage_element).to exist
# end
# @return [Watir::Div] The raw +Div+ element
def container_registry_usage_element
@@ -309,8 +429,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota).to be_container_registry_usage
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_container_registry_usage
# end
# @return [Boolean] true if the +container_registry_usage+ element is present on the page
def container_registry_usage?
@@ -324,8 +444,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota.project_storage_used_element).to exist
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.project_storage_used_element).to exist
# end
# @return [Watir::Div] The raw +Div+ element
def project_storage_used_element
@@ -333,8 +453,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota).to be_project_storage_used
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_project_storage_used
# end
# @return [Boolean] true if the +project_storage_used+ element is present on the page
def project_storage_used?
@@ -348,8 +468,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota.project_element).to exist
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.project_element).to exist
# end
# @return [Watir::Div] The raw +Div+ element
def project_element
@@ -357,8 +477,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota).to be_project
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_project
# end
# @return [Boolean] true if the +project+ element is present on the page
def project?
@@ -372,8 +492,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota.storage_type_legend_element).to exist
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.storage_type_legend_element).to exist
# end
# @return [Watir::Div] The raw +Div+ element
def storage_type_legend_element
@@ -381,8 +501,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota).to be_storage_type_legend
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_storage_type_legend
# end
# @return [Boolean] true if the +storage_type_legend+ element is present on the page
def storage_type_legend?
@@ -396,8 +516,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota.container_registry_size_element).to exist
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.container_registry_size_element).to exist
# end
# @return [Watir::Span] The raw +Span+ element
def container_registry_size_element
@@ -405,8 +525,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota).to be_container_registry_size
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_container_registry_size
# end
# @return [Boolean] true if the +container_registry_size+ element is present on the page
def container_registry_size?
@@ -420,8 +540,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota.purchased_usage_total_free_element).to exist
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.purchased_usage_total_free_element).to exist
# end
# @return [Watir::Div] The raw +Div+ element
def purchased_usage_total_free_element
@@ -429,8 +549,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota).to be_purchased_usage_total_free
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_purchased_usage_total_free
# end
# @return [Boolean] true if the +purchased_usage_total_free+ element is present on the page
def purchased_usage_total_free?
@@ -444,8 +564,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota.purchased_usage_total_element).to exist
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.purchased_usage_total_element).to exist
# end
# @return [Watir::Span] The raw +Span+ element
def purchased_usage_total_element
@@ -453,8 +573,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota).to be_purchased_usage_total
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_purchased_usage_total
# end
# @return [Boolean] true if the +purchased_usage_total+ element is present on the page
def purchased_usage_total?
@@ -468,8 +588,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota.storage_purchase_successful_alert_element).to exist
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.storage_purchase_successful_alert_element).to exist
# end
# @return [Watir::Div] The raw +Div+ element
def storage_purchase_successful_alert_element
@@ -477,8 +597,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota).to be_storage_purchase_successful_alert
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_storage_purchase_successful_alert
# end
# @return [Boolean] true if the +storage_purchase_successful_alert+ element is present on the page
def storage_purchase_successful_alert?
@@ -492,8 +612,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota.storage_available_alert_element).to exist
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas.storage_available_alert_element).to exist
# end
# @return [Watir::H2] The raw +H2+ element
def storage_available_alert_element
@@ -501,8 +621,8 @@ module Gitlab
end
# @example
- # Gitlab::Page::Group::Settings::UsageQuota.perform do |usage_quota|
- # expect(usage_quota).to be_storage_available_alert
+ # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
+ # expect(usage_quotas).to be_storage_available_alert
# end
# @return [Boolean] true if the +storage_available_alert+ element is present on the page
def storage_available_alert?
diff --git a/spec/controllers/admin/topics_controller_spec.rb b/spec/controllers/admin/topics_controller_spec.rb
index 111fdcc3be6..e640f8bb7ec 100644
--- a/spec/controllers/admin/topics_controller_spec.rb
+++ b/spec/controllers/admin/topics_controller_spec.rb
@@ -176,7 +176,7 @@ RSpec.describe Admin::TopicsController do
describe 'POST #merge' do
let_it_be(:source_topic) { create(:topic, name: 'source_topic') }
- let_it_be(:project) { create(:project, topic_list: source_topic.name ) }
+ let_it_be(:project) { create(:project, topic_list: source_topic.name) }
it 'merges source topic into target topic' do
post :merge, params: { source_topic_id: source_topic.id, target_topic_id: topic.id }
diff --git a/spec/controllers/groups/children_controller_spec.rb b/spec/controllers/groups/children_controller_spec.rb
index 04cf7785f1e..f05551432fa 100644
--- a/spec/controllers/groups/children_controller_spec.rb
+++ b/spec/controllers/groups/children_controller_spec.rb
@@ -277,7 +277,7 @@ RSpec.describe Groups::ChildrenController do
context 'with only projects' do
let!(:other_project) { create(:project, :public, namespace: group) }
- let!(:first_page_projects) { create_list(:project, per_page, :public, namespace: group ) }
+ let!(:first_page_projects) { create_list(:project, per_page, :public, namespace: group) }
it 'has projects on the first page' do
get :index, params: { group_id: group.to_param, sort: 'id_desc' }, format: :json
diff --git a/spec/controllers/groups/registry/repositories_controller_spec.rb b/spec/controllers/groups/registry/repositories_controller_spec.rb
index 9ac19b06718..62c15201a95 100644
--- a/spec/controllers/groups/registry/repositories_controller_spec.rb
+++ b/spec/controllers/groups/registry/repositories_controller_spec.rb
@@ -117,7 +117,7 @@ RSpec.describe Groups::Registry::RepositoriesController do
it_behaves_like 'a package tracking event', described_class.name, 'list_repositories'
context 'with project in subgroup' do
- let_it_be(:test_group) { create(:group, parent: group ) }
+ let_it_be(:test_group) { create(:group, parent: group) }
it_behaves_like 'renders a list of repositories'
diff --git a/spec/controllers/groups/releases_controller_spec.rb b/spec/controllers/groups/releases_controller_spec.rb
index 7dd0bc6206a..40e8cb4efc5 100644
--- a/spec/controllers/groups/releases_controller_spec.rb
+++ b/spec/controllers/groups/releases_controller_spec.rb
@@ -42,7 +42,7 @@ RSpec.describe Groups::ReleasesController do
end
it 'does not return any releases' do
- expect(json_response.map { |r| r['tag'] } ).to be_empty
+ expect(json_response.map { |r| r['tag'] }).to be_empty
end
it 'returns OK' do
@@ -56,7 +56,7 @@ RSpec.describe Groups::ReleasesController do
index
- expect(json_response.map { |r| r['tag'] } ).to match_array(%w(p2 p1 v2 v1))
+ expect(json_response.map { |r| r['tag'] }).to match_array(%w(p2 p1 v2 v1))
end
end
diff --git a/spec/controllers/groups/runners_controller_spec.rb b/spec/controllers/groups/runners_controller_spec.rb
index 6dbf0803892..2add3cd3b18 100644
--- a/spec/controllers/groups/runners_controller_spec.rb
+++ b/spec/controllers/groups/runners_controller_spec.rb
@@ -168,7 +168,7 @@ RSpec.describe Groups::RunnersController do
new_desc = runner.description.swapcase
expect do
- post :update, params: params.merge(runner: { description: new_desc } )
+ post :update, params: params.merge(runner: { description: new_desc })
end.to change { runner.ensure_runner_queue_value }
expect(response).to have_gitlab_http_status(:found)
@@ -179,7 +179,7 @@ RSpec.describe Groups::RunnersController do
new_desc = instance_runner.description.swapcase
expect do
- post :update, params: params_runner_instance.merge(runner: { description: new_desc } )
+ post :update, params: params_runner_instance.merge(runner: { description: new_desc })
end.to not_change { instance_runner.ensure_runner_queue_value }
.and not_change { instance_runner.description }
@@ -190,7 +190,7 @@ RSpec.describe Groups::RunnersController do
new_desc = project_runner.description.swapcase
expect do
- post :update, params: params_runner_project.merge(runner: { description: new_desc } )
+ post :update, params: params_runner_project.merge(runner: { description: new_desc })
end.to change { project_runner.ensure_runner_queue_value }
expect(response).to have_gitlab_http_status(:found)
@@ -207,7 +207,7 @@ RSpec.describe Groups::RunnersController do
old_desc = runner.description
expect do
- post :update, params: params.merge(runner: { description: old_desc.swapcase } )
+ post :update, params: params.merge(runner: { description: old_desc.swapcase })
end.not_to change { runner.ensure_runner_queue_value }
expect(response).to have_gitlab_http_status(:not_found)
@@ -218,7 +218,7 @@ RSpec.describe Groups::RunnersController do
old_desc = instance_runner.description
expect do
- post :update, params: params_runner_instance.merge(runner: { description: old_desc.swapcase } )
+ post :update, params: params_runner_instance.merge(runner: { description: old_desc.swapcase })
end.not_to change { instance_runner.ensure_runner_queue_value }
expect(response).to have_gitlab_http_status(:not_found)
@@ -229,7 +229,7 @@ RSpec.describe Groups::RunnersController do
old_desc = project_runner.description
expect do
- post :update, params: params_runner_project.merge(runner: { description: old_desc.swapcase } )
+ post :update, params: params_runner_project.merge(runner: { description: old_desc.swapcase })
end.not_to change { project_runner.ensure_runner_queue_value }
expect(response).to have_gitlab_http_status(:not_found)
diff --git a/spec/controllers/groups_controller_spec.rb b/spec/controllers/groups_controller_spec.rb
index 5bbe236077c..c127a44a64d 100644
--- a/spec/controllers/groups_controller_spec.rb
+++ b/spec/controllers/groups_controller_spec.rb
@@ -672,7 +672,7 @@ RSpec.describe GroupsController, factory_default: :keep do
end
context 'when there is a conflicting group path' do
- let!(:conflict_group) { create(:group, path: SecureRandom.hex(12) ) }
+ let!(:conflict_group) { create(:group, path: SecureRandom.hex(12)) }
let!(:old_name) { group.name }
it 'does not render references to the conflicting group' do
diff --git a/spec/controllers/omniauth_callbacks_controller_spec.rb b/spec/controllers/omniauth_callbacks_controller_spec.rb
index df5da29495e..0560ccb25dd 100644
--- a/spec/controllers/omniauth_callbacks_controller_spec.rb
+++ b/spec/controllers/omniauth_callbacks_controller_spec.rb
@@ -10,7 +10,7 @@ RSpec.describe OmniauthCallbacksController, type: :controller do
let(:additional_info) { {} }
before do
- @original_env_config_omniauth_auth = mock_auth_hash(provider.to_s, extern_uid, user.email, additional_info: additional_info )
+ @original_env_config_omniauth_auth = mock_auth_hash(provider.to_s, extern_uid, user.email, additional_info: additional_info)
stub_omniauth_provider(provider, context: request)
end
diff --git a/spec/controllers/projects/environments_controller_spec.rb b/spec/controllers/projects/environments_controller_spec.rb
index 16a43bae674..5927f20df97 100644
--- a/spec/controllers/projects/environments_controller_spec.rb
+++ b/spec/controllers/projects/environments_controller_spec.rb
@@ -76,7 +76,7 @@ RSpec.describe Projects::EnvironmentsController do
it 'handles search option properly' do
get :index, params: environment_params(format: :json, search: 'staging/r')
- expect(environments.map { |env| env['name'] } ).to contain_exactly('staging/review-1', 'staging/review-2')
+ expect(environments.map { |env| env['name'] }).to contain_exactly('staging/review-1', 'staging/review-2')
expect(json_response['available_count']).to eq 2
expect(json_response['stopped_count']).to eq 1
end
@@ -84,7 +84,7 @@ RSpec.describe Projects::EnvironmentsController do
it 'ignores search option if is shorter than a minimum' do
get :index, params: environment_params(format: :json, search: 'st')
- expect(environments.map { |env| env['name'] } ).to contain_exactly('production',
+ expect(environments.map { |env| env['name'] }).to contain_exactly('production',
'staging/review-1',
'staging/review-2')
expect(json_response['available_count']).to eq 3
@@ -233,7 +233,7 @@ RSpec.describe Projects::EnvironmentsController do
search: 'staging-1.0/z'
}, format: :json)
- expect(environments.map { |env| env['name'] } ).to eq(['staging-1.0/zzz'])
+ expect(environments.map { |env| env['name'] }).to eq(['staging-1.0/zzz'])
expect(json_response['available_count']).to eq 1
expect(json_response['stopped_count']).to eq 0
end
@@ -705,7 +705,7 @@ RSpec.describe Projects::EnvironmentsController do
expect(json_response).to have_key('all_dashboards')
expect(json_response['all_dashboards']).to be_an_instance_of(Array)
- expect(json_response['all_dashboards']).to all( include('path', 'default', 'display_name') )
+ expect(json_response['all_dashboards']).to all(include('path', 'default', 'display_name'))
end
end
diff --git a/spec/controllers/projects/issues_controller_spec.rb b/spec/controllers/projects/issues_controller_spec.rb
index 0c3795540e0..55f76be3537 100644
--- a/spec/controllers/projects/issues_controller_spec.rb
+++ b/spec/controllers/projects/issues_controller_spec.rb
@@ -1291,7 +1291,7 @@ RSpec.describe Projects::IssuesController do
let!(:last_spam_log) { spam_logs.last }
def post_verified_issue
- post_new_issue({}, { spam_log_id: last_spam_log.id, 'g-recaptcha-response': 'abc123' } )
+ post_new_issue({}, { spam_log_id: last_spam_log.id, 'g-recaptcha-response': 'abc123' })
end
before do
@@ -1311,7 +1311,7 @@ RSpec.describe Projects::IssuesController do
it 'does not mark spam log as recaptcha_verified when it does not belong to current_user' do
spam_log = create(:spam_log)
- expect { post_new_issue({}, { spam_log_id: spam_log.id, 'g-recaptcha-response': true } ) }
+ expect { post_new_issue({}, { spam_log_id: spam_log.id, 'g-recaptcha-response': true }) }
.not_to change { last_spam_log.recaptcha_verified }
end
end
diff --git a/spec/controllers/projects/registry/repositories_controller_spec.rb b/spec/controllers/projects/registry/repositories_controller_spec.rb
index a5faaaf5969..e057c56fc53 100644
--- a/spec/controllers/projects/registry/repositories_controller_spec.rb
+++ b/spec/controllers/projects/registry/repositories_controller_spec.rb
@@ -137,7 +137,7 @@ RSpec.describe Projects::Registry::RepositoriesController do
end
end
- def go_to_index(format: :html, params: {} )
+ def go_to_index(format: :html, params: {})
get :index, params: params.merge({
namespace_id: project.namespace,
project_id: project
diff --git a/spec/controllers/projects/releases_controller_spec.rb b/spec/controllers/projects/releases_controller_spec.rb
index b307bb357fa..2afd080344d 100644
--- a/spec/controllers/projects/releases_controller_spec.rb
+++ b/spec/controllers/projects/releases_controller_spec.rb
@@ -112,7 +112,7 @@ RSpec.describe Projects::ReleasesController do
it "returns the project's releases as JSON, ordered by released_at" do
get_index
- expect(json_response.map { |release| release["id"] } ).to eq([release_2.id, release_1.id])
+ expect(json_response.map { |release| release["id"] }).to eq([release_2.id, release_1.id])
end
it_behaves_like 'common access controls'
diff --git a/spec/controllers/projects/runners_controller_spec.rb b/spec/controllers/projects/runners_controller_spec.rb
index 57d1695b842..1066c4ec9f6 100644
--- a/spec/controllers/projects/runners_controller_spec.rb
+++ b/spec/controllers/projects/runners_controller_spec.rb
@@ -25,7 +25,7 @@ RSpec.describe Projects::RunnersController do
new_desc = runner.description.swapcase
expect do
- post :update, params: params.merge(runner: { description: new_desc } )
+ post :update, params: params.merge(runner: { description: new_desc })
end.to change { runner.ensure_runner_queue_value }
runner.reload
diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb
index 94c5f397670..3474d4c3907 100644
--- a/spec/features/admin/admin_settings_spec.rb
+++ b/spec/features/admin/admin_settings_spec.rb
@@ -304,10 +304,12 @@ RSpec.describe 'Admin updates settings' do
it 'changes the setting' do
page.within('#js-jira_connect-settings') do
fill_in 'Jira Connect Application ID', with: '1234'
+ fill_in 'Jira Connect Proxy URL', with: 'https://example.com'
click_button 'Save changes'
end
expect(current_settings.jira_connect_application_key).to eq('1234')
+ expect(current_settings.jira_connect_proxy_url).to eq('https://example.com')
expect(page).to have_content "Application settings saved successfully"
end
end
diff --git a/spec/lib/atlassian/jira_connect/jwt/asymmetric_spec.rb b/spec/lib/atlassian/jira_connect/jwt/asymmetric_spec.rb
index b3157dd15fb..86d672067a3 100644
--- a/spec/lib/atlassian/jira_connect/jwt/asymmetric_spec.rb
+++ b/spec/lib/atlassian/jira_connect/jwt/asymmetric_spec.rb
@@ -16,7 +16,8 @@ RSpec.describe Atlassian::JiraConnect::Jwt::Asymmetric do
let(:jwt_headers) { { kid: public_key_id } }
let(:jwt) { JWT.encode(jwt_claims, private_key, 'RS256', jwt_headers) }
let(:public_key) { private_key.public_key }
- let(:install_keys_url) { "https://connect-install-keys.atlassian.com/#{public_key_id}" }
+ let(:stub_asymmetric_jwt_cdn) { 'https://connect-install-keys.atlassian.com' }
+ let(:install_keys_url) { "#{stub_asymmetric_jwt_cdn}/#{public_key_id}" }
let(:qsh) do
Atlassian::Jwt.create_query_string_hash('https://gitlab.test/events/installed', 'POST', 'https://gitlab.test')
end
@@ -85,6 +86,38 @@ RSpec.describe Atlassian::JiraConnect::Jwt::Asymmetric do
it { is_expected.not_to be_valid }
end
+
+ context 'with jira_connect_proxy_url setting' do
+ let(:stub_asymmetric_jwt_cdn) { 'https://example.com/-/jira_connect/public_keys' }
+
+ before do
+ stub_application_setting(jira_connect_proxy_url: 'https://example.com')
+ end
+
+ it 'requests the settings CDN' do
+ expect(JWT).to receive(:decode).twice.and_call_original
+
+ expect(asymmetric_jwt).to be_valid
+
+ expect(WebMock).to have_requested(:get, "https://example.com/-/jira_connect/public_keys/#{public_key_id}")
+ end
+
+ context 'when jira_connect_oauth_self_managed disabled' do
+ let(:stub_asymmetric_jwt_cdn) { 'https://connect-install-keys.atlassian.com' }
+
+ before do
+ stub_feature_flags(jira_connect_oauth_self_managed: false)
+ end
+
+ it 'requests the default CDN' do
+ expect(JWT).to receive(:decode).twice.and_call_original
+
+ expect(asymmetric_jwt).to be_valid
+
+ expect(WebMock).to have_requested(:get, install_keys_url)
+ end
+ end
+ end
end
describe '#iss_claim' do
diff --git a/spec/lib/gitlab/background_migration/batched_migration_job_spec.rb b/spec/lib/gitlab/background_migration/batched_migration_job_spec.rb
index f03f90ddbbb..95be14cefb1 100644
--- a/spec/lib/gitlab/background_migration/batched_migration_job_spec.rb
+++ b/spec/lib/gitlab/background_migration/batched_migration_job_spec.rb
@@ -57,6 +57,71 @@ RSpec.describe Gitlab::BackgroundMigration::BatchedMigrationJob do
end
end
+ describe '.operation_name' do
+ subject(:perform_job) { job_instance.perform }
+
+ let(:job_instance) do
+ job_class.new(start_id: 1, end_id: 10,
+ batch_table: '_test_table',
+ batch_column: 'id',
+ sub_batch_size: 2,
+ pause_ms: 1000,
+ job_arguments: %w(a b),
+ connection: connection)
+ end
+
+ let(:job_class) do
+ Class.new(described_class) do
+ operation_name :update_all
+ end
+ end
+
+ it 'defines method' do
+ expect(job_instance.operation_name).to eq(:update_all)
+ end
+
+ context 'when `operation_name` is not defined' do
+ let(:job_class) do
+ Class.new(described_class) do
+ def perform
+ each_sub_batch do |sub_batch|
+ sub_batch.update_all('to_column = from_column')
+ end
+ end
+ end
+ end
+
+ let(:test_table) { table(:_test_table) }
+ let(:test_insert_table) { table(:_test_insert_table) }
+
+ before do
+ allow(job_instance).to receive(:sleep)
+
+ connection.create_table :_test_table do |t|
+ t.timestamps_with_timezone null: false
+ t.integer :from_column, null: false
+ end
+
+ connection.create_table :_test_insert_table, id: false do |t|
+ t.integer :to_column
+ t.index :to_column, unique: true
+ end
+
+ test_table.create!(id: 1, from_column: 5)
+ test_table.create!(id: 2, from_column: 10)
+ end
+
+ after do
+ connection.drop_table(:_test_table)
+ connection.drop_table(:_test_insert_table)
+ end
+
+ it 'raises an exception' do
+ expect { perform_job }.to raise_error(RuntimeError, /Operation name is required/)
+ end
+ end
+ end
+
describe '.scope_to' do
subject(:job_instance) do
job_class.new(start_id: 1, end_id: 10,
@@ -133,9 +198,10 @@ RSpec.describe Gitlab::BackgroundMigration::BatchedMigrationJob do
context 'when the subclass uses sub-batching' do
let(:job_class) do
Class.new(described_class) do
+ operation_name :update
+
def perform(*job_arguments)
each_sub_batch(
- operation_name: :update,
batching_arguments: { order_hint: :updated_at },
batching_scope: -> (relation) { relation.where.not(bar: nil) }
) do |sub_batch|
@@ -177,10 +243,10 @@ RSpec.describe Gitlab::BackgroundMigration::BatchedMigrationJob do
let(:job_class) do
Class.new(described_class) do
scope_to ->(r) { r.where('mod(id, 2) = 0') }
+ operation_name :update
def perform(*job_arguments)
each_sub_batch(
- operation_name: :update,
batching_arguments: { order_hint: :updated_at },
batching_scope: -> (relation) { relation.where.not(bar: nil) }
) do |sub_batch|
@@ -237,8 +303,10 @@ RSpec.describe Gitlab::BackgroundMigration::BatchedMigrationJob do
let(:job_class) do
Class.new(described_class) do
+ operation_name :insert
+
def perform(*job_arguments)
- distinct_each_batch(operation_name: :insert) do |sub_batch|
+ distinct_each_batch do |sub_batch|
sub_batch.pluck(:from_column).each do |value|
connection.execute("INSERT INTO _test_insert_table VALUES (#{value})")
end
@@ -291,9 +359,10 @@ RSpec.describe Gitlab::BackgroundMigration::BatchedMigrationJob do
let(:job_class) do
Class.new(described_class) do
scope_to ->(r) { r.where.not(from_column: 10) }
+ operation_name :insert
def perform(*job_arguments)
- distinct_each_batch(operation_name: :insert) do |sub_batch|
+ distinct_each_batch do |sub_batch|
end
end
end
diff --git a/spec/lib/gitlab/ci/parsers/security/common_spec.rb b/spec/lib/gitlab/ci/parsers/security/common_spec.rb
index 253abe38648..03cab021c17 100644
--- a/spec/lib/gitlab/ci/parsers/security/common_spec.rb
+++ b/spec/lib/gitlab/ci/parsers/security/common_spec.rb
@@ -400,9 +400,9 @@ RSpec.describe Gitlab::Ci::Parsers::Security::Common do
end
describe 'parsing tracking' do
+ let(:finding) { report.findings.first }
+
context 'with invalid tracking information' do
- let(:finding) { report.findings.first }
- let(:number_of_findings) { report.findings.length }
let(:tracking_data) do
{
'type' => 'source',
@@ -416,7 +416,7 @@ RSpec.describe Gitlab::Ci::Parsers::Security::Common do
}
end
- it 'ignores invalid algorithm types and logs warning' do
+ it 'ignores invalid algorithm types' do
expect(finding.signatures.size).to eq(2)
expect(finding.signatures.map(&:algorithm_type).to_set).to eq(Set['hash', 'location'])
end
@@ -437,7 +437,6 @@ RSpec.describe Gitlab::Ci::Parsers::Security::Common do
end
it 'creates signatures for each signature algorithm' do
- finding = report.findings.first
expect(finding.signatures.size).to eq(3)
expect(finding.signatures.map(&:algorithm_type)).to eq(%w[hash location scope_offset])
@@ -449,7 +448,6 @@ RSpec.describe Gitlab::Ci::Parsers::Security::Common do
end
it 'sets the uuid according to the higest priority signature' do
- finding = report.findings.first
highest_signature = finding.signatures.max_by(&:priority)
identifiers = if signatures_enabled
diff --git a/spec/services/web_hook_service_spec.rb b/spec/services/web_hook_service_spec.rb
index 551c3dbcc82..cc8f087cbb6 100644
--- a/spec/services/web_hook_service_spec.rb
+++ b/spec/services/web_hook_service_spec.rb
@@ -175,22 +175,6 @@ RSpec.describe WebHookService, :request_store, :clean_gitlab_redis_shared_state
).once
end
- context 'when webhooks_gitlab_instance_header flag is disabled' do
- before do
- stub_feature_flags(webhooks_gitlab_instance_header: false)
- end
-
- it 'excludes the X-Gitlab-Instance header' do
- stub_full_request(project_hook.url, method: :post)
-
- service_instance.execute
-
- expect(WebMock).to have_requested(:post, stubbed_hostname(project_hook.url)).with(
- headers: headers.except('X-Gitlab-Instance')
- ).once
- end
- end
-
context 'when the data is a Gitlab::DataBuilder::Pipeline' do
let(:pipeline) { create(:ci_pipeline, project: project) }
let(:data) { ::Gitlab::DataBuilder::Pipeline.new(pipeline) }
diff --git a/spec/support/shared_examples/workers/batched_background_migration_worker_shared_examples.rb b/spec/support/shared_examples/workers/batched_background_migration_worker_shared_examples.rb
index 3ba5f080a01..1e70bb31767 100644
--- a/spec/support/shared_examples/workers/batched_background_migration_worker_shared_examples.rb
+++ b/spec/support/shared_examples/workers/batched_background_migration_worker_shared_examples.rb
@@ -236,10 +236,10 @@ RSpec.shared_examples 'it runs batched background migration jobs' do |tracking_d
let(:migration_class) do
Class.new(Gitlab::BackgroundMigration::BatchedMigrationJob) do
job_arguments :matching_status
+ operation_name :update_all
def perform
each_sub_batch(
- operation_name: :update_all,
batching_scope: -> (relation) { relation.where(status: matching_status) }
) do |sub_batch|
sub_batch.update_all(some_column: 0)
diff --git a/spec/views/admin/application_settings/_jira_connect.html.haml_spec.rb b/spec/views/admin/application_settings/_jira_connect.html.haml_spec.rb
new file mode 100644
index 00000000000..7cfc2db5a41
--- /dev/null
+++ b/spec/views/admin/application_settings/_jira_connect.html.haml_spec.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'admin/application_settings/_jira_connect.html.haml' do
+ let_it_be(:admin) { create(:admin) }
+ let(:application_setting) { build(:application_setting) }
+
+ before do
+ assign(:application_setting, application_setting)
+ allow(view).to receive(:expanded).and_return(true)
+ end
+
+ it 'renders the application ID field' do
+ render
+ expect(rendered).to have_field('Jira Connect Application ID', type: 'text')
+ end
+
+ it 'renders the asymmetric jwt cdn url field' do
+ render
+ expect(rendered).to have_field('Jira Connect Proxy URL', type: 'text')
+ end
+end
diff --git a/spec/views/admin/application_settings/general.html.haml_spec.rb b/spec/views/admin/application_settings/general.html.haml_spec.rb
index a9c470e49df..a8c7bec36e3 100644
--- a/spec/views/admin/application_settings/general.html.haml_spec.rb
+++ b/spec/views/admin/application_settings/general.html.haml_spec.rb
@@ -69,8 +69,8 @@ RSpec.describe 'admin/application_settings/general.html.haml' do
end
end
- describe 'jira connect application key' do
- it 'shows the jira connect application key section' do
+ describe 'jira connect settings' do
+ it 'shows the jira connect settings section' do
render
expect(rendered).to have_css('#js-jira_connect-settings')
@@ -81,7 +81,7 @@ RSpec.describe 'admin/application_settings/general.html.haml' do
stub_feature_flags(jira_connect_oauth_self_managed_setting: false)
end
- it 'does not show the jira connect application key section' do
+ it 'does not show the jira connect settings section' do
render
expect(rendered).not_to have_css('#js-jira_connect-settings')