summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-01-06 21:08:47 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-06 21:08:47 +0000
commitd650b4f4c4a20f9d1801a0dc69bdc3e106a18e11 (patch)
treeafb5832443981e94d49962d84631d3d2480aa66f
parent9213b5a0fd66f3b466047bf85f90ad056c239f18 (diff)
downloadgitlab-ce-d650b4f4c4a20f9d1801a0dc69bdc3e106a18e11.tar.gz
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--.rubocop_todo/background_migration/feature_category.yml58
-rw-r--r--app/controllers/projects/pages_controller.rb8
-rw-r--r--app/helpers/application_settings_helper.rb1
-rw-r--r--app/models/application_setting.rb11
-rw-r--r--app/models/ci/runner_machine.rb1
-rw-r--r--app/models/member.rb4
-rw-r--r--app/services/members/approve_access_request_service.rb2
-rw-r--r--app/views/admin/application_settings/_repository_check.html.haml4
-rw-r--r--app/views/errors/omniauth_error.html.haml26
-rw-r--r--app/views/layouts/oauth_error.html.haml72
-rw-r--r--app/views/projects/commit/_multiple_signatures_signature_badge.html.haml7
-rw-r--r--app/views/projects/commit/_other_user_signature_badge.html.haml7
-rw-r--r--app/views/projects/commit/_same_user_different_email_signature_badge.html.haml7
-rw-r--r--app/views/projects/commit/_signature_badge.html.haml20
-rw-r--r--app/views/projects/commit/_unverified_signature_badge.html.haml7
-rw-r--r--app/views/projects/commit/_verified_signature_badge.html.haml7
-rw-r--r--app/views/projects/pages/new.html.haml2
-rw-r--r--config/feature_flags/development/send_traversal_ids_to_indexer.yml8
-rw-r--r--data/deprecations/15-8-azure-storage-driver-root-prefix.yml2
-rw-r--r--db/migrate/20230106142239_add_config_column_to_ci_runner_machines.rb9
-rw-r--r--db/schema_migrations/202301061422391
-rw-r--r--db/structure.sql1
-rw-r--r--doc/api/settings.md9
-rw-r--r--doc/architecture/blueprints/runner_tokens/index.md1
-rw-r--r--doc/update/deprecations.md2
-rw-r--r--lib/api/entities/application_setting.rb5
-rw-r--r--lib/api/settings.rb12
-rw-r--r--lib/gitlab/background_migration/backfill_cluster_agents_has_vulnerabilities.rb1
-rw-r--r--lib/gitlab/background_migration/backfill_environment_tiers.rb1
-rw-r--r--lib/gitlab/background_migration/backfill_epic_cache_counts.rb2
-rw-r--r--lib/gitlab/background_migration/backfill_group_features.rb1
-rw-r--r--lib/gitlab/background_migration/backfill_imported_issue_search_data.rb1
-rw-r--r--lib/gitlab/background_migration/backfill_internal_on_notes.rb1
-rw-r--r--lib/gitlab/background_migration/backfill_namespace_details.rb1
-rw-r--r--lib/gitlab/background_migration/backfill_namespace_id_of_vulnerability_reads.rb1
-rw-r--r--lib/gitlab/background_migration/backfill_project_feature_package_registry_access_level.rb1
-rw-r--r--lib/gitlab/background_migration/backfill_project_import_level.rb1
-rw-r--r--lib/gitlab/background_migration/backfill_project_member_namespace_id.rb2
-rw-r--r--lib/gitlab/background_migration/backfill_project_namespace_details.rb1
-rw-r--r--lib/gitlab/background_migration/backfill_project_namespace_on_issues.rb1
-rw-r--r--lib/gitlab/background_migration/backfill_project_statistics_container_repository_size.rb2
-rw-r--r--lib/gitlab/background_migration/backfill_project_statistics_storage_size_without_uploads_size.rb2
-rw-r--r--lib/gitlab/background_migration/backfill_releases_author_id.rb1
-rw-r--r--lib/gitlab/background_migration/backfill_user_details_fields.rb1
-rw-r--r--lib/gitlab/background_migration/backfill_vulnerability_reads_cluster_agent.rb1
-rw-r--r--lib/gitlab/background_migration/backfill_work_item_type_id_for_issues.rb2
-rw-r--r--lib/gitlab/background_migration/cleanup_orphaned_routes.rb2
-rw-r--r--lib/gitlab/background_migration/copy_column_using_background_migration_job.rb1
-rw-r--r--lib/gitlab/background_migration/delete_approval_rules_with_vulnerability.rb2
-rw-r--r--lib/gitlab/background_migration/delete_invalid_epic_issues.rb2
-rw-r--r--lib/gitlab/background_migration/delete_orphaned_operational_vulnerabilities.rb2
-rw-r--r--lib/gitlab/background_migration/delete_orphans_approval_merge_request_rules.rb1
-rw-r--r--lib/gitlab/background_migration/delete_orphans_approval_project_rules.rb1
-rw-r--r--lib/gitlab/background_migration/destroy_invalid_group_members.rb1
-rw-r--r--lib/gitlab/background_migration/destroy_invalid_members.rb1
-rw-r--r--lib/gitlab/background_migration/destroy_invalid_project_members.rb1
-rw-r--r--lib/gitlab/background_migration/disable_legacy_open_source_licence_for_recent_public_projects.rb1
-rw-r--r--lib/gitlab/background_migration/disable_legacy_open_source_license_for_inactive_public_projects.rb1
-rw-r--r--lib/gitlab/background_migration/disable_legacy_open_source_license_for_no_issues_no_repo_projects.rb1
-rw-r--r--lib/gitlab/background_migration/disable_legacy_open_source_license_for_one_member_no_repo_projects.rb1
-rw-r--r--lib/gitlab/background_migration/disable_legacy_open_source_license_for_projects_less_than_five_mb.rb1
-rw-r--r--lib/gitlab/background_migration/disable_legacy_open_source_license_for_projects_less_than_one_mb.rb1
-rw-r--r--lib/gitlab/background_migration/expire_o_auth_tokens.rb1
-rw-r--r--lib/gitlab/background_migration/fix_approval_project_rules_without_protected_branches.rb2
-rw-r--r--lib/gitlab/background_migration/fix_security_scan_statuses.rb2
-rw-r--r--lib/gitlab/background_migration/migrate_shared_vulnerability_scanners.rb2
-rw-r--r--lib/gitlab/background_migration/migrate_vulnerabilities_feedback_to_vulnerabilities_state_transition.rb2
-rw-r--r--lib/gitlab/background_migration/populate_approval_merge_request_rules_with_security_orchestration.rb2
-rw-r--r--lib/gitlab/background_migration/populate_approval_project_rules_with_security_orchestration.rb2
-rw-r--r--lib/gitlab/background_migration/populate_operation_visibility_permissions_from_operations.rb1
-rw-r--r--lib/gitlab/background_migration/populate_projects_star_count.rb1
-rw-r--r--lib/gitlab/background_migration/prune_stale_project_export_jobs.rb1
-rw-r--r--lib/gitlab/background_migration/recount_epic_cache_counts.rb2
-rw-r--r--lib/gitlab/background_migration/remove_backfilled_job_artifacts_expire_at.rb1
-rw-r--r--lib/gitlab/background_migration/remove_self_managed_wiki_notes.rb1
-rw-r--r--lib/gitlab/background_migration/rename_task_system_note_to_checklist_item.rb1
-rw-r--r--lib/gitlab/background_migration/reset_duplicate_ci_runners_token_encrypted_values.rb1
-rw-r--r--lib/gitlab/background_migration/reset_duplicate_ci_runners_token_values.rb1
-rw-r--r--lib/gitlab/background_migration/reset_status_on_container_repositories.rb1
-rw-r--r--lib/gitlab/background_migration/sanitize_confidential_todos.rb1
-rw-r--r--lib/gitlab/background_migration/second_recount_epic_cache_counts.rb2
-rw-r--r--lib/gitlab/background_migration/set_correct_vulnerability_state.rb1
-rw-r--r--lib/gitlab/background_migration/set_legacy_open_source_license_available_for_non_public_projects.rb1
-rw-r--r--lib/gitlab/background_migration/update_ci_pipeline_artifacts_unknown_locked_status.rb2
-rw-r--r--lib/gitlab/background_migration/update_delayed_project_removal_to_null_for_user_namespaces.rb1
-rw-r--r--lib/gitlab/background_migration/update_jira_tracker_data_deployment_type_based_on_url.rb2
-rw-r--r--lib/gitlab/ci/variables/collection.rb58
-rw-r--r--lib/sidebars/projects/menus/deployments_menu.rb2
-rw-r--r--locale/gitlab.pot45
-rw-r--r--rubocop/cop/background_migration/feature_category.rb10
-rw-r--r--spec/features/projects/navbar_spec.rb2
-rw-r--r--spec/features/projects/pages/user_edits_settings_spec.rb2
-rw-r--r--spec/features/projects/settings/user_searches_in_settings_spec.rb1
-rw-r--r--spec/features/signed_commits_spec.rb12
-rw-r--r--spec/lib/gitlab/ci/variables/collection_spec.rb118
-rw-r--r--spec/lib/sidebars/projects/menus/settings_menu_spec.rb2
-rw-r--r--spec/models/application_setting_spec.rb30
-rw-r--r--spec/models/ci/runner_machine_spec.rb16
-rw-r--r--spec/models/member_spec.rb15
-rw-r--r--spec/requests/api/settings_spec.rb57
-rw-r--r--spec/support/shared_examples/models/members_notifications_shared_example.rb2
-rw-r--r--spec/views/errors/omniauth_error.html.haml_spec.rb6
-rw-r--r--spec/views/projects/commit/show.html.haml_spec.rb5
103 files changed, 383 insertions, 372 deletions
diff --git a/.rubocop_todo/background_migration/feature_category.yml b/.rubocop_todo/background_migration/feature_category.yml
index cae07260406..69467a0b492 100644
--- a/.rubocop_todo/background_migration/feature_category.yml
+++ b/.rubocop_todo/background_migration/feature_category.yml
@@ -1,61 +1,3 @@
---
BackgroundMigration/FeatureCategory:
Details: grace period
- Exclude:
- - 'lib/gitlab/background_migration/backfill_cluster_agents_has_vulnerabilities.rb'
- - 'lib/gitlab/background_migration/backfill_environment_tiers.rb'
- - 'lib/gitlab/background_migration/backfill_epic_cache_counts.rb'
- - 'lib/gitlab/background_migration/backfill_group_features.rb'
- - 'lib/gitlab/background_migration/backfill_imported_issue_search_data.rb'
- - 'lib/gitlab/background_migration/backfill_internal_on_notes.rb'
- - 'lib/gitlab/background_migration/backfill_namespace_details.rb'
- - 'lib/gitlab/background_migration/backfill_namespace_id_of_vulnerability_reads.rb'
- - 'lib/gitlab/background_migration/backfill_project_feature_package_registry_access_level.rb'
- - 'lib/gitlab/background_migration/backfill_project_import_level.rb'
- - 'lib/gitlab/background_migration/backfill_project_member_namespace_id.rb'
- - 'lib/gitlab/background_migration/backfill_project_namespace_details.rb'
- - 'lib/gitlab/background_migration/backfill_project_namespace_on_issues.rb'
- - 'lib/gitlab/background_migration/backfill_project_statistics_container_repository_size.rb'
- - 'lib/gitlab/background_migration/backfill_project_statistics_storage_size_without_uploads_size.rb'
- - 'lib/gitlab/background_migration/backfill_user_details_fields.rb'
- - 'lib/gitlab/background_migration/backfill_vulnerability_reads_cluster_agent.rb'
- - 'lib/gitlab/background_migration/backfill_work_item_type_id_for_issues.rb'
- - 'lib/gitlab/background_migration/cleanup_orphaned_routes.rb'
- - 'lib/gitlab/background_migration/copy_column_using_background_migration_job.rb'
- - 'lib/gitlab/background_migration/delete_approval_rules_with_vulnerability.rb'
- - 'lib/gitlab/background_migration/delete_invalid_epic_issues.rb'
- - 'lib/gitlab/background_migration/delete_orphaned_operational_vulnerabilities.rb'
- - 'lib/gitlab/background_migration/delete_orphans_approval_merge_request_rules.rb'
- - 'lib/gitlab/background_migration/delete_orphans_approval_project_rules.rb'
- - 'lib/gitlab/background_migration/destroy_invalid_group_members.rb'
- - 'lib/gitlab/background_migration/destroy_invalid_members.rb'
- - 'lib/gitlab/background_migration/destroy_invalid_project_members.rb'
- - 'lib/gitlab/background_migration/disable_legacy_open_source_licence_for_recent_public_projects.rb'
- - 'lib/gitlab/background_migration/disable_legacy_open_source_license_for_inactive_public_projects.rb'
- - 'lib/gitlab/background_migration/disable_legacy_open_source_license_for_no_issues_no_repo_projects.rb'
- - 'lib/gitlab/background_migration/disable_legacy_open_source_license_for_one_member_no_repo_projects.rb'
- - 'lib/gitlab/background_migration/disable_legacy_open_source_license_for_projects_less_than_five_mb.rb'
- - 'lib/gitlab/background_migration/disable_legacy_open_source_license_for_projects_less_than_one_mb.rb'
- - 'lib/gitlab/background_migration/expire_o_auth_tokens.rb'
- - 'lib/gitlab/background_migration/fix_approval_project_rules_without_protected_branches.rb'
- - 'lib/gitlab/background_migration/fix_security_scan_statuses.rb'
- - 'lib/gitlab/background_migration/migrate_shared_vulnerability_scanners.rb'
- - 'lib/gitlab/background_migration/migrate_vulnerabilities_feedback_to_vulnerabilities_state_transition.rb'
- - 'lib/gitlab/background_migration/populate_approval_merge_request_rules_with_security_orchestration.rb'
- - 'lib/gitlab/background_migration/populate_approval_project_rules_with_security_orchestration.rb'
- - 'lib/gitlab/background_migration/populate_operation_visibility_permissions_from_operations.rb'
- - 'lib/gitlab/background_migration/populate_projects_star_count.rb'
- - 'lib/gitlab/background_migration/prune_stale_project_export_jobs.rb'
- - 'lib/gitlab/background_migration/recount_epic_cache_counts.rb'
- - 'lib/gitlab/background_migration/remove_backfilled_job_artifacts_expire_at.rb'
- - 'lib/gitlab/background_migration/remove_self_managed_wiki_notes.rb'
- - 'lib/gitlab/background_migration/rename_task_system_note_to_checklist_item.rb'
- - 'lib/gitlab/background_migration/reset_duplicate_ci_runners_token_encrypted_values.rb'
- - 'lib/gitlab/background_migration/reset_duplicate_ci_runners_token_values.rb'
- - 'lib/gitlab/background_migration/reset_status_on_container_repositories.rb'
- - 'lib/gitlab/background_migration/sanitize_confidential_todos.rb'
- - 'lib/gitlab/background_migration/set_correct_vulnerability_state.rb'
- - 'lib/gitlab/background_migration/set_legacy_open_source_license_available_for_non_public_projects.rb'
- - 'lib/gitlab/background_migration/update_ci_pipeline_artifacts_unknown_locked_status.rb'
- - 'lib/gitlab/background_migration/update_delayed_project_removal_to_null_for_user_namespaces.rb'
- - 'lib/gitlab/background_migration/update_jira_tracker_data_deployment_type_based_on_url.rb'
diff --git a/app/controllers/projects/pages_controller.rb b/app/controllers/projects/pages_controller.rb
index 2fd1e4b0ee0..db0762a6cff 100644
--- a/app/controllers/projects/pages_controller.rb
+++ b/app/controllers/projects/pages_controller.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
class Projects::PagesController < Projects::ApplicationController
- layout 'project_settings' if Feature.disabled?(:show_pages_in_deployments_menu, @project, type: :experiment)
+ layout :resolve_layout
before_action :require_pages_enabled!
before_action :authorize_read_pages!, only: [:show]
@@ -11,7 +11,7 @@ class Projects::PagesController < Projects::ApplicationController
feature_category :pages
before_action do
- push_frontend_feature_flag(:show_pages_in_deployments_menu, project, type: :experiment)
+ push_frontend_feature_flag(:show_pages_in_deployments_menu, current_user, type: :experiment)
end
def new
@@ -68,6 +68,10 @@ class Projects::PagesController < Projects::ApplicationController
private
+ def resolve_layout
+ 'project_settings' unless Feature.enabled?(:show_pages_in_deployments_menu, current_user, type: :experiment)
+ end
+
def project_params
params.require(:project).permit(project_params_attributes)
end
diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb
index 16ccf8ad78a..339938245a0 100644
--- a/app/helpers/application_settings_helper.rb
+++ b/app/helpers/application_settings_helper.rb
@@ -273,6 +273,7 @@ module ApplicationSettingsHelper
:housekeeping_full_repack_period,
:housekeeping_gc_period,
:housekeeping_incremental_repack_period,
+ :housekeeping_optimize_repository_period,
:html_emails_enabled,
:import_sources,
:in_product_marketing_emails_enabled,
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb
index 4bc6d531beb..59ad0650eb3 100644
--- a/app/models/application_setting.rb
+++ b/app/models/application_setting.rb
@@ -35,6 +35,7 @@ class ApplicationSetting < ApplicationRecord
belongs_to :instance_group, class_name: "Group", foreign_key: 'instance_administrators_group_id'
alias_attribute :instance_group_id, :instance_administrators_group_id
alias_attribute :instance_administrators_group, :instance_group
+ alias_attribute :housekeeping_optimize_repository_period, :housekeeping_incremental_repack_period
sanitizes! :default_branch_name
@@ -256,18 +257,10 @@ class ApplicationSetting < ApplicationRecord
presence: { message: 'Domain denylist cannot be empty if denylist is enabled.' },
if: :domain_denylist_enabled?
- validates :housekeeping_incremental_repack_period,
+ validates :housekeeping_optimize_repository_period,
presence: true,
numericality: { only_integer: true, greater_than: 0 }
- validates :housekeeping_full_repack_period,
- presence: true,
- numericality: { only_integer: true, greater_than_or_equal_to: :housekeeping_incremental_repack_period }
-
- validates :housekeeping_gc_period,
- presence: true,
- numericality: { only_integer: true, greater_than_or_equal_to: :housekeeping_full_repack_period }
-
validates :terminal_max_session_time,
presence: true,
numericality: { only_integer: true, greater_than_or_equal_to: 0 }
diff --git a/app/models/ci/runner_machine.rb b/app/models/ci/runner_machine.rb
index af11db4cf25..89b426a97fc 100644
--- a/app/models/ci/runner_machine.rb
+++ b/app/models/ci/runner_machine.rb
@@ -13,5 +13,6 @@ module Ci
validates :platform, length: { maximum: 255 }
validates :architecture, length: { maximum: 255 }
validates :ip_address, length: { maximum: 1024 }
+ validates :config, json_schema: { filename: 'ci_runner_config' }
end
end
diff --git a/app/models/member.rb b/app/models/member.rb
index 107530daf51..2790f6d084a 100644
--- a/app/models/member.rb
+++ b/app/models/member.rb
@@ -386,10 +386,10 @@ class Member < ApplicationRecord
user.present?
end
- def accept_request
+ def accept_request(current_user)
return false unless request?
- updated = self.update(requested_at: nil)
+ updated = self.update(requested_at: nil, created_by: current_user)
after_accept_request if updated
updated
diff --git a/app/services/members/approve_access_request_service.rb b/app/services/members/approve_access_request_service.rb
index 51f9492ec91..5e73d7a957b 100644
--- a/app/services/members/approve_access_request_service.rb
+++ b/app/services/members/approve_access_request_service.rb
@@ -6,7 +6,7 @@ module Members
validate_access!(access_requester) unless skip_authorization
access_requester.access_level = params[:access_level] if params[:access_level]
- access_requester.accept_request
+ access_requester.accept_request(current_user)
after_execute(member: access_requester, skip_log_audit_event: skip_log_audit_event)
diff --git a/app/views/admin/application_settings/_repository_check.html.haml b/app/views/admin/application_settings/_repository_check.html.haml
index 477ac5ca0d6..b67cc29f296 100644
--- a/app/views/admin/application_settings/_repository_check.html.haml
+++ b/app/views/admin/application_settings/_repository_check.html.haml
@@ -24,8 +24,8 @@
_("Enable automatic repository housekeeping"),
help_text: '%{help_text} %{help_link}'.html_safe % { help_text: help_text, help_link: help_link }
.form-group
- = f.label :housekeeping_incremental_repack_period, _('Optimize repository period'), class: 'label-bold'
- = f.number_field :housekeeping_incremental_repack_period, class: 'form-control gl-form-input'
+ = f.label :housekeeping_optimize_repository_period, _('Optimize repository period'), class: 'label-bold'
+ = f.number_field :housekeeping_optimize_repository_period, class: 'form-control gl-form-input'
.form-text.text-muted
= _('Number of Git pushes after which Gitaly is asked to optimize a repository.')
.sub-section
diff --git a/app/views/errors/omniauth_error.html.haml b/app/views/errors/omniauth_error.html.haml
index 3090c823677..c48e12561a7 100644
--- a/app/views/errors/omniauth_error.html.haml
+++ b/app/views/errors/omniauth_error.html.haml
@@ -2,18 +2,16 @@
.container
= render partial: "shared/errors/graphic_422", formats: :svg
- %h3
+ %h2
= _('Sign-in using %{provider} auth failed') % { provider: @provider }
-
- %p.light.subtitle
- = _('Sign-in failed because %{error}.') % { error: @error }
-
- %p
- = _('Try logging in using your username or email. If you have forgotten your password, try recovering it')
-
- = link_to _('Sign in'), new_session_path(:user), class: 'gl-button btn primary'
- = link_to _('Recover password'), new_password_path(:user), class: 'gl-button btn secondary'
-
- %hr
- %p.light
- = _('If none of the options work, try contacting a GitLab administrator.')
+ .gl-mb-5
+ = @error
+ .gl-mb-5
+ = render Pajamas::ButtonComponent.new(variant: :confirm,
+ href: new_session_path(:user),
+ button_options: { class: 'gl-mr-2' }) do
+ = _('Sign in')
+ = render Pajamas::ButtonComponent.new(href: new_password_path(:user)) do
+ = _('Recover password')
+ %div
+ = _('If you are unable to sign in or recover your password, contact a GitLab administrator.')
diff --git a/app/views/layouts/oauth_error.html.haml b/app/views/layouts/oauth_error.html.haml
index 03b387f8181..8d241dfd207 100644
--- a/app/views/layouts/oauth_error.html.haml
+++ b/app/views/layouts/oauth_error.html.haml
@@ -3,35 +3,10 @@
%head
%meta{ :content => "width=device-width, initial-scale=1, maximum-scale=1", :name => "viewport" }
%title= yield(:title)
+ = stylesheet_link_tag 'application_utilities'
+ %style
+ = Rails.application.assets_manifest.find_sources('errors.css').first.to_s.html_safe
:css
- body {
- color: #666;
- text-align: center;
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- margin: auto;
- font-size: 16px;
- }
-
- .container {
- margin: auto 20px;
- }
-
- h3 {
- color: #456;
- font-size: 22px;
- font-weight: 600;
- margin-bottom: 6px;
- }
-
- p {
- max-width: 470px;
- margin: 16px auto;
- }
-
- .subtitle {
- margin: 0 auto 20px;
- }
-
svg {
width: 280px;
height: 280px;
@@ -82,46 +57,5 @@
25% {opacity: 1;}
}
- .light {
- color: #8D8D8D;
- }
-
- hr {
- max-width: 600px;
- margin: 18px auto;
- border: 0;
- border-top: 1px solid #EEE;
- }
-
- .btn {
- padding: 8px 14px;
- border-radius: 3px;
- border: 1px solid;
- display: inline-block;
- text-decoration: none;
- margin: 4px 8px;
- font-size: 14px;
- }
-
- .primary {
- color: #fff;
- background-color: #1aaa55;
- border-color: #168f48;
- }
-
- .primary:hover {
- background-color: #168f48;
- }
-
- .secondary {
- color: #1aaa55;
- background-color: #fff;
- border-color: #1aaa55;
- }
-
- .secondary:hover {
- background-color: #f3fff8;
- }
-
%body
= yield
diff --git a/app/views/projects/commit/_multiple_signatures_signature_badge.html.haml b/app/views/projects/commit/_multiple_signatures_signature_badge.html.haml
index 74515438af2..2568a69cc2c 100644
--- a/app/views/projects/commit/_multiple_signatures_signature_badge.html.haml
+++ b/app/views/projects/commit/_multiple_signatures_signature_badge.html.haml
@@ -1,6 +1,5 @@
-- title = capture do
- = html_escape(_('This commit was signed with %{strong_open}multiple%{strong_close} signatures.')) % { strong_open: '<strong>'.html_safe, strong_close: '</strong>'.html_safe }
-
-- locals = { signature: signature, title: title, label: _('Unverified'), css_class: 'invalid', icon: 'status_notfound_borderless' }
+- title = _('Multiple signatures')
+- description = _('This commit was signed with multiple signatures.')
+- locals = { signature: signature, title: title, description: description, label: _('Unverified'), css_class: 'invalid' }
= render partial: 'projects/commit/signature_badge', locals: locals
diff --git a/app/views/projects/commit/_other_user_signature_badge.html.haml b/app/views/projects/commit/_other_user_signature_badge.html.haml
index bb843bee7c9..ffc4b25dc21 100644
--- a/app/views/projects/commit/_other_user_signature_badge.html.haml
+++ b/app/views/projects/commit/_other_user_signature_badge.html.haml
@@ -1,6 +1,5 @@
-- title = capture do
- = _("This commit was signed with a different user's verified signature.")
-
-- locals = { signature: signature, title: title, label: _('Unverified'), css_class: 'invalid', icon: 'status_notfound_borderless', show_user: true }
+- title = _("Different user's signature")
+- description = _("This commit was signed with a different user's verified signature.")
+- locals = { signature: signature, title: title, description: description, label: _('Unverified'), css_class: 'invalid' }
= render partial: 'projects/commit/signature_badge', locals: locals
diff --git a/app/views/projects/commit/_same_user_different_email_signature_badge.html.haml b/app/views/projects/commit/_same_user_different_email_signature_badge.html.haml
index 629d3cfaf74..61fdf6fc87a 100644
--- a/app/views/projects/commit/_same_user_different_email_signature_badge.html.haml
+++ b/app/views/projects/commit/_same_user_different_email_signature_badge.html.haml
@@ -1,6 +1,5 @@
-- title = capture do
- = html_escape(_('This commit was signed with a verified signature, but the committer email is not associated with the GPG Key.'))
-
-- locals = { signature: signature, title: title, label: _('Unverified'), css_class: ['invalid'], icon: 'status_notfound_borderless', show_user: true }
+- title = _('GPG key mismatch')
+- description = _('This commit was signed with a verified signature, but the committer email is not associated with the GPG Key.')
+- locals = { signature: signature, title: title, description: description, label: _('Unverified'), css_class: ['invalid'] }
= render partial: 'projects/commit/signature_badge', locals: locals
diff --git a/app/views/projects/commit/_signature_badge.html.haml b/app/views/projects/commit/_signature_badge.html.haml
index 8a48845a55d..2550b5b1045 100644
--- a/app/views/projects/commit/_signature_badge.html.haml
+++ b/app/views/projects/commit/_signature_badge.html.haml
@@ -1,25 +1,21 @@
- signature = local_assigns.fetch(:signature)
- title = local_assigns.fetch(:title)
+- description = local_assigns.fetch(:description, nil)
- label = local_assigns.fetch(:label)
- css_class = local_assigns.fetch(:css_class)
-- icon = local_assigns.fetch(:icon)
-- show_user = local_assigns.fetch(:show_user, false)
- css_classes = commit_signature_badge_classes(css_class)
- title = capture do
.gpg-popover-status
- .gpg-popover-icon{ class: css_class }
- = sprite_icon(icon)
%div
- = title
+ %strong
+ = title
-- content = capture do
- - if show_user
- .clearfix
- - uri_signature_badge_user = "projects/commit/#{'x509/' if signature.x509?}signature_badge_user"
- = render partial: "#{uri_signature_badge_user}", locals: { signature: signature }
+ %p.gl-my-3
+ = description
+- content = capture do
- if signature.x509?
= render partial: "projects/commit/x509/certificate_details", locals: { signature: signature }
@@ -28,12 +24,12 @@
= _('SSH key fingerprint:')
%span.gl-font-monospace= signature.key&.fingerprint_sha256 || _('Unknown')
- = link_to(_('Learn about signing commits with SSH keys.'), help_page_path('user/project/repository/ssh_signed_commits/index.md'), class: 'gl-link gl-display-block')
+ = link_to(_('Learn about signing commits with SSH keys.'), help_page_path('user/project/repository/ssh_signed_commits/index.md'), class: 'gl-link gl-display-block gl-mt-3')
- else
= _('GPG Key ID:')
%span.gl-font-monospace= signature.gpg_key_primary_keyid
- = link_to(_('Learn more about signing commits'), help_page_path('user/project/repository/gpg_signed_commits/index.md'), class: 'gl-link gl-display-block')
+ = link_to(_('Learn about signing commits'), help_page_path('user/project/repository/gpg_signed_commits/index.md'), class: 'gl-link gl-display-block gl-mt-3')
%a{ role: 'button', tabindex: 0, class: css_classes, data: { toggle: 'popover', html: 'true', placement: 'top', title: title, content: content } }
= label
diff --git a/app/views/projects/commit/_unverified_signature_badge.html.haml b/app/views/projects/commit/_unverified_signature_badge.html.haml
index 0ce8e06382b..0eae8d5564d 100644
--- a/app/views/projects/commit/_unverified_signature_badge.html.haml
+++ b/app/views/projects/commit/_unverified_signature_badge.html.haml
@@ -1,6 +1,5 @@
-- title = capture do
- = html_escape(_('This commit was signed with an %{strong_open}unverified%{strong_close} signature.')) % { strong_open: '<strong>'.html_safe, strong_close: '</strong>'.html_safe }
-
-- locals = { signature: signature, title: title, label: _('Unverified'), css_class: 'invalid', icon: 'status_notfound_borderless' }
+- title = _('Unverified signature')
+- description = _('This commit was signed with an unverified signature.')
+- locals = { signature: signature, title: title, description: description, label: _('Unverified'), css_class: 'invalid' }
= render partial: 'projects/commit/signature_badge', locals: locals
diff --git a/app/views/projects/commit/_verified_signature_badge.html.haml b/app/views/projects/commit/_verified_signature_badge.html.haml
index 357ad467539..417d816c711 100644
--- a/app/views/projects/commit/_verified_signature_badge.html.haml
+++ b/app/views/projects/commit/_verified_signature_badge.html.haml
@@ -1,6 +1,5 @@
-- title = capture do
- = html_escape(_('This commit was signed with a %{strong_open}verified%{strong_close} signature and the committer email is verified to belong to the same user.')) % { strong_open: '<strong>'.html_safe, strong_close: '</strong>'.html_safe }
-
-- locals = { signature: signature, title: title, label: _('Verified'), css_class: 'valid', icon: 'status_success_borderless', show_user: true }
+- title = _('Verified commit')
+- description = _('This commit was signed with a verified signature and the committer email was verified to belong to the same user.')
+- locals = { signature: signature, title: title, description: description, label: _('Verified'), css_class: 'valid' }
= render partial: 'projects/commit/signature_badge', locals: locals
diff --git a/app/views/projects/pages/new.html.haml b/app/views/projects/pages/new.html.haml
index 760ecd4fb8a..b9d2af9cf19 100644
--- a/app/views/projects/pages/new.html.haml
+++ b/app/views/projects/pages/new.html.haml
@@ -1,4 +1,4 @@
-- if Feature.enabled?(:show_pages_in_deployments_menu, @project, type: :experiment)
+- if Feature.enabled?(:show_pages_in_deployments_menu, current_user, type: :experiment)
- @breadcrumb_link = project_pages_path(@project)
- breadcrumb_title s_('GitLabPages|Pages')
- page_title s_('GitLabPages|Pages')
diff --git a/config/feature_flags/development/send_traversal_ids_to_indexer.yml b/config/feature_flags/development/send_traversal_ids_to_indexer.yml
deleted file mode 100644
index 65af6797391..00000000000
--- a/config/feature_flags/development/send_traversal_ids_to_indexer.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-name: send_traversal_ids_to_indexer
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/107352
-rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/386465
-milestone: '15.8'
-type: development
-group: group::global search
-default_enabled: true
diff --git a/data/deprecations/15-8-azure-storage-driver-root-prefix.yml b/data/deprecations/15-8-azure-storage-driver-root-prefix.yml
index 5bf12085ee7..888196ab499 100644
--- a/data/deprecations/15-8-azure-storage-driver-root-prefix.yml
+++ b/data/deprecations/15-8-azure-storage-driver-root-prefix.yml
@@ -10,6 +10,6 @@
body: | # (required) Do not modify this line, instead modify the lines below.
The Azure Storage Driver writes to `//` as the default root directory. This default root directory appears in some places within the Azure UI as `/<no-name>/`. We have maintained this legacy behavior to support older deployments using this storage driver. However, when moving to Azure from another storage driver, this behavior hides all your data until you configure the storage driver to build root paths without an extra leading slash by setting `trimlegacyrootprefix: true`.
- The new default configuration for the storage driver will set `trimlegacyrootprefix: true`, and `/` will be the default root directory. You can add `trimlegacyrootprefix: true` to your current configuration to avoid any disruptions.
+ The new default configuration for the storage driver will set `trimlegacyrootprefix: true`, and `/` will be the default root directory. You can add `trimlegacyrootprefix: false` to your current configuration to avoid any disruptions.
This breaking change will happen in GitLab 16.0.
diff --git a/db/migrate/20230106142239_add_config_column_to_ci_runner_machines.rb b/db/migrate/20230106142239_add_config_column_to_ci_runner_machines.rb
new file mode 100644
index 00000000000..29fee4d7b56
--- /dev/null
+++ b/db/migrate/20230106142239_add_config_column_to_ci_runner_machines.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class AddConfigColumnToCiRunnerMachines < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def change
+ add_column :ci_runner_machines, :config, :jsonb, default: {}, null: false
+ end
+end
diff --git a/db/schema_migrations/20230106142239 b/db/schema_migrations/20230106142239
new file mode 100644
index 00000000000..9db0af20dfa
--- /dev/null
+++ b/db/schema_migrations/20230106142239
@@ -0,0 +1 @@
+17a39b088e164f5642ad5ac34ef03a3c358c0694f6c2313036dd883f07ecc245 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index ac2cf0d4dc6..dc35073aa6c 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -13421,6 +13421,7 @@ CREATE TABLE ci_runner_machines (
platform text,
architecture text,
ip_address text,
+ config jsonb DEFAULT '{}'::jsonb NOT NULL,
CONSTRAINT check_1537c1f66f CHECK ((char_length(platform) <= 255)),
CONSTRAINT check_6f45a91da7 CHECK ((char_length(version) <= 2048)),
CONSTRAINT check_84ed5d8703 CHECK ((char_length(machine_xid) <= 64)),
diff --git a/doc/api/settings.md b/doc/api/settings.md
index 77f425fa13f..671db520c23 100644
--- a/doc/api/settings.md
+++ b/doc/api/settings.md
@@ -378,10 +378,11 @@ listed in the descriptions of the relevant settings.
| `hide_third_party_offers` | boolean | no | Do not display offers from third parties in GitLab. |
| `home_page_url` | string | no | Redirect to this URL when not logged in. |
| `housekeeping_bitmaps_enabled` | boolean | no | Git pack file bitmap creation is always enabled and cannot be changed via API and UI. This API field is deprecated and always returns `true`. |
-| `housekeeping_enabled` | boolean | no | (**If enabled, requires:** `housekeeping_bitmaps_enabled`, `housekeeping_full_repack_period`, `housekeeping_gc_period`, and `housekeeping_incremental_repack_period`) Enable or disable Git housekeeping. |
-| `housekeeping_full_repack_period` | integer | required by: `housekeeping_enabled` | Number of Git pushes after which an incremental `git repack` is run. |
-| `housekeeping_gc_period` | integer | required by: `housekeeping_enabled` | Number of Git pushes after which `git gc` is run. |
-| `housekeeping_incremental_repack_period` | integer | required by: `housekeeping_enabled` | Number of Git pushes after which an incremental `git repack` is run. |
+| `housekeeping_enabled` | boolean | no | (**If enabled, requires either:** `housekeeping_bitmaps_enabled`, `housekeeping_full_repack_period`, `housekeeping_gc_period`, and `housekeeping_incremental_repack_period` **or** `housekeeping_optimize_repository_period`) Enable or disable Git housekeeping. |
+| `housekeeping_full_repack_period` | integer | no | **Deprecated** (use `housekeeping_optimize_repository_period` instead): Number of Git pushes after which an incremental `git repack` is run. |
+| `housekeeping_gc_period` | integer | no | **Deprecated** (use `housekeeping_optimize_repository_period` instead): Number of Git pushes after which `git gc` is run. |
+| `housekeeping_incremental_repack_period` | integer | no | **Deprecated** (use `housekeeping_optimize_repository_period` instead): Number of Git pushes after which an incremental `git repack` is run. |
+| `housekeeping_optimize_repository_period`| integer | no | Number of Git pushes after which an incremental `git repack` is run. |
| `html_emails_enabled` | boolean | no | Enable HTML emails. |
| `import_sources` | array of strings | no | Sources to allow project import from, possible values: `github`, `bitbucket`, `bitbucket_server`, `gitlab`, `fogbugz`, `git`, `gitlab_project`, `gitea`, `manifest`, and `phabricator`. |
| `in_product_marketing_emails_enabled` | boolean | no | Enable [in-product marketing emails](../user/profile/notifications.md#global-notification-settings). Enabled by default. |
diff --git a/doc/architecture/blueprints/runner_tokens/index.md b/doc/architecture/blueprints/runner_tokens/index.md
index b663183a98e..addf3af78ce 100644
--- a/doc/architecture/blueprints/runner_tokens/index.md
+++ b/doc/architecture/blueprints/runner_tokens/index.md
@@ -174,6 +174,7 @@ CREATE TABLE ci_runner_machines (
architecture character varying,
ip_address character varying,
executor_type smallint,
+ config jsonb DEFAULT '{}'::jsonb NOT NULL
);
```
diff --git a/doc/update/deprecations.md b/doc/update/deprecations.md
index 1600db02922..f15719a7a7d 100644
--- a/doc/update/deprecations.md
+++ b/doc/update/deprecations.md
@@ -62,7 +62,7 @@ Review the details carefully before upgrading.
The Azure Storage Driver writes to `//` as the default root directory. This default root directory appears in some places within the Azure UI as `/<no-name>/`. We have maintained this legacy behavior to support older deployments using this storage driver. However, when moving to Azure from another storage driver, this behavior hides all your data until you configure the storage driver to build root paths without an extra leading slash by setting `trimlegacyrootprefix: true`.
-The new default configuration for the storage driver will set `trimlegacyrootprefix: true`, and `/` will be the default root directory. You can add `trimlegacyrootprefix: true` to your current configuration to avoid any disruptions.
+The new default configuration for the storage driver will set `trimlegacyrootprefix: true`, and `/` will be the default root directory. You can add `trimlegacyrootprefix: false` to your current configuration to avoid any disruptions.
This breaking change will happen in GitLab 16.0.
diff --git a/lib/api/entities/application_setting.rb b/lib/api/entities/application_setting.rb
index db51d4380d0..8aace9126d6 100644
--- a/lib/api/entities/application_setting.rb
+++ b/lib/api/entities/application_setting.rb
@@ -43,6 +43,11 @@ module API
# This field is deprecated and always returns true
expose(:housekeeping_bitmaps_enabled) { |_settings, _options| true }
+
+ # These fields are deprecated and always returns housekeeping_optimize_repository_period value
+ expose(:housekeeping_full_repack_period) { |settings, _options| settings.housekeeping_optimize_repository_period }
+ expose(:housekeeping_gc_period) { |settings, _options| settings.housekeeping_optimize_repository_period }
+ expose(:housekeeping_incremental_repack_period) { |settings, _options| settings.housekeeping_optimize_repository_period }
end
end
end
diff --git a/lib/api/settings.rb b/lib/api/settings.rb
index 96b900c420a..06b576a982b 100644
--- a/lib/api/settings.rb
+++ b/lib/api/settings.rb
@@ -85,9 +85,15 @@ module API
optional :home_page_url, type: String, desc: 'We will redirect non-logged in users to this page'
optional :housekeeping_enabled, type: Boolean, desc: 'Enable automatic repository housekeeping (git repack, git gc)'
given housekeeping_enabled: ->(val) { val } do
- requires :housekeeping_full_repack_period, type: Integer, desc: "Number of Git pushes after which a full 'git repack' is run."
- requires :housekeeping_gc_period, type: Integer, desc: "Number of Git pushes after which 'git gc' is run."
- requires :housekeeping_incremental_repack_period, type: Integer, desc: "Number of Git pushes after which an incremental 'git repack' is run."
+ optional :housekeeping_full_repack_period, type: Integer, desc: "Number of Git pushes after which a full 'git repack' is run."
+ optional :housekeeping_gc_period, type: Integer, desc: "Number of Git pushes after which 'git gc' is run."
+ optional :housekeeping_incremental_repack_period, type: Integer, desc: "Number of Git pushes after which an incremental 'git repack' is run."
+
+ optional :housekeeping_optimize_repository_period, type: Integer, desc: "Number of Git pushes after which Gitaly is asked to optimize a repository."
+
+ # Requires either all three deprecated attributes (housekeeping_full_repack_period, housekeeping_gc_period, housekeeping_incremental_repack_period) or housekeeping_optimize_repository_period
+ all_or_none_of :housekeeping_full_repack_period, :housekeeping_gc_period, :housekeeping_incremental_repack_period
+ exactly_one_of :housekeeping_incremental_repack_period, :housekeeping_optimize_repository_period
end
optional :html_emails_enabled, type: Boolean, desc: 'By default GitLab sends emails in HTML and plain text formats so mail clients can choose what format to use. Disable this option if you only want to send emails in plain text format.'
optional :import_sources, type: Array[String], coerce_with: Validations::Types::CommaSeparatedToArray.coerce,
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 249c9d7af57..1dca82486ac 100644
--- a/lib/gitlab/background_migration/backfill_cluster_agents_has_vulnerabilities.rb
+++ b/lib/gitlab/background_migration/backfill_cluster_agents_has_vulnerabilities.rb
@@ -17,6 +17,7 @@ module Gitlab
end
operation_name :update_all
+ feature_category :database
def perform
each_sub_batch(batching_scope: RELATION) do |sub_batch|
diff --git a/lib/gitlab/background_migration/backfill_environment_tiers.rb b/lib/gitlab/background_migration/backfill_environment_tiers.rb
index 6f381577274..ebfabf1b28e 100644
--- a/lib/gitlab/background_migration/backfill_environment_tiers.rb
+++ b/lib/gitlab/background_migration/backfill_environment_tiers.rb
@@ -7,6 +7,7 @@ module Gitlab
# See https://gitlab.com/gitlab-org/gitlab/-/issues/300741 for more information.
class BackfillEnvironmentTiers < BatchedMigrationJob
operation_name :backfill_environment_tiers
+ feature_category :database
# Equivalent to `Environment#guess_tier` pattern matching.
PRODUCTION_TIER = 0
diff --git a/lib/gitlab/background_migration/backfill_epic_cache_counts.rb b/lib/gitlab/background_migration/backfill_epic_cache_counts.rb
index bd61d1a0f07..ee64a8ca2d5 100644
--- a/lib/gitlab/background_migration/backfill_epic_cache_counts.rb
+++ b/lib/gitlab/background_migration/backfill_epic_cache_counts.rb
@@ -4,6 +4,8 @@ module Gitlab
module BackgroundMigration
# rubocop: disable Style/Documentation
class BackfillEpicCacheCounts < Gitlab::BackgroundMigration::BatchedMigrationJob
+ feature_category :database
+
def perform; end
end
# rubocop: enable Style/Documentation
diff --git a/lib/gitlab/background_migration/backfill_group_features.rb b/lib/gitlab/background_migration/backfill_group_features.rb
index 4ea664e2529..c45dcad5b2d 100644
--- a/lib/gitlab/background_migration/backfill_group_features.rb
+++ b/lib/gitlab/background_migration/backfill_group_features.rb
@@ -6,6 +6,7 @@ module Gitlab
class BackfillGroupFeatures < ::Gitlab::BackgroundMigration::BatchedMigrationJob
job_arguments :batch_size
operation_name :upsert_group_features
+ feature_category :database
def perform
each_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 c95fed512c9..8c151bc36ac 100644
--- a/lib/gitlab/background_migration/backfill_imported_issue_search_data.rb
+++ b/lib/gitlab/background_migration/backfill_imported_issue_search_data.rb
@@ -10,6 +10,7 @@ module Gitlab
SUB_BATCH_SIZE = 1_000
operation_name :update_search_data
+ feature_category :database
def perform
each_sub_batch do |sub_batch|
diff --git a/lib/gitlab/background_migration/backfill_internal_on_notes.rb b/lib/gitlab/background_migration/backfill_internal_on_notes.rb
index fe05b4ec3c1..2202cbb2f85 100644
--- a/lib/gitlab/background_migration/backfill_internal_on_notes.rb
+++ b/lib/gitlab/background_migration/backfill_internal_on_notes.rb
@@ -6,6 +6,7 @@ module Gitlab
class BackfillInternalOnNotes < BatchedMigrationJob
scope_to -> (relation) { relation.where(confidential: true) }
operation_name :update_all
+ feature_category :database
def perform
each_sub_batch do |sub_batch|
diff --git a/lib/gitlab/background_migration/backfill_namespace_details.rb b/lib/gitlab/background_migration/backfill_namespace_details.rb
index 640d9379351..57254c09f78 100644
--- a/lib/gitlab/background_migration/backfill_namespace_details.rb
+++ b/lib/gitlab/background_migration/backfill_namespace_details.rb
@@ -5,6 +5,7 @@ module Gitlab
# Backfill namespace_details for a range of namespaces
class BackfillNamespaceDetails < ::Gitlab::BackgroundMigration::BatchedMigrationJob
operation_name :backfill_namespace_details
+ feature_category :database
def perform
each_sub_batch do |sub_batch|
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 dca7f9fa921..8600510b6ef 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
@@ -5,6 +5,7 @@ module Gitlab
# Sets the `namespace_id` of the existing `vulnerability_reads` records
class BackfillNamespaceIdOfVulnerabilityReads < BatchedMigrationJob
operation_name :set_namespace_id
+ feature_category :database
UPDATE_SQL = <<~SQL
UPDATE
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 6520cd63711..ff20a7ed177 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
@@ -18,6 +18,7 @@ module Gitlab
end
operation_name :update_all
+ feature_category :database
def perform
each_sub_batch do |sub_batch|
diff --git a/lib/gitlab/background_migration/backfill_project_import_level.rb b/lib/gitlab/background_migration/backfill_project_import_level.rb
index 21c239e0070..1a4b1e6731f 100644
--- a/lib/gitlab/background_migration/backfill_project_import_level.rb
+++ b/lib/gitlab/background_migration/backfill_project_import_level.rb
@@ -4,6 +4,7 @@ module Gitlab
module BackgroundMigration
class BackfillProjectImportLevel < BatchedMigrationJob
operation_name :update_import_level
+ feature_category :database
LEVEL = {
Gitlab::Access::NO_ACCESS => [0],
diff --git a/lib/gitlab/background_migration/backfill_project_member_namespace_id.rb b/lib/gitlab/background_migration/backfill_project_member_namespace_id.rb
index c2e37269b5e..1bf029f5001 100644
--- a/lib/gitlab/background_migration/backfill_project_member_namespace_id.rb
+++ b/lib/gitlab/background_migration/backfill_project_member_namespace_id.rb
@@ -4,6 +4,8 @@ module Gitlab
module BackgroundMigration
# Backfills the `members.member_namespace_id` column for `type=ProjectMember`
class BackfillProjectMemberNamespaceId < Gitlab::BackgroundMigration::BatchedMigrationJob
+ feature_category :database
+
def perform
parent_batch_relation = relation_scoped_to_range(batch_table, batch_column, start_id, end_id)
diff --git a/lib/gitlab/background_migration/backfill_project_namespace_details.rb b/lib/gitlab/background_migration/backfill_project_namespace_details.rb
index 9bee3cf21e8..4f4db50321d 100644
--- a/lib/gitlab/background_migration/backfill_project_namespace_details.rb
+++ b/lib/gitlab/background_migration/backfill_project_namespace_details.rb
@@ -4,6 +4,7 @@ module Gitlab
# Backfill project namespace_details for a range of projects
class BackfillProjectNamespaceDetails < ::Gitlab::BackgroundMigration::BatchedMigrationJob
operation_name :backfill_project_namespace_details
+ feature_category :database
def perform
each_sub_batch do |sub_batch|
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 34dd3321125..0c4953486f4 100644
--- a/lib/gitlab/background_migration/backfill_project_namespace_on_issues.rb
+++ b/lib/gitlab/background_migration/backfill_project_namespace_on_issues.rb
@@ -7,6 +7,7 @@ module Gitlab
MAX_UPDATE_RETRIES = 3
operation_name :update_all
+ feature_category :database
def perform
each_sub_batch(
diff --git a/lib/gitlab/background_migration/backfill_project_statistics_container_repository_size.rb b/lib/gitlab/background_migration/backfill_project_statistics_container_repository_size.rb
index ec813022b8f..01cae3e2d50 100644
--- a/lib/gitlab/background_migration/backfill_project_statistics_container_repository_size.rb
+++ b/lib/gitlab/background_migration/backfill_project_statistics_container_repository_size.rb
@@ -4,6 +4,8 @@ module Gitlab
module BackgroundMigration
# Back-fill container_registry_size for project_statistics
class BackfillProjectStatisticsContainerRepositorySize < Gitlab::BackgroundMigration::BatchedMigrationJob
+ feature_category :database
+
def perform
# no-op
end
diff --git a/lib/gitlab/background_migration/backfill_project_statistics_storage_size_without_uploads_size.rb b/lib/gitlab/background_migration/backfill_project_statistics_storage_size_without_uploads_size.rb
index 1a3dd88ea31..da865ed935a 100644
--- a/lib/gitlab/background_migration/backfill_project_statistics_storage_size_without_uploads_size.rb
+++ b/lib/gitlab/background_migration/backfill_project_statistics_storage_size_without_uploads_size.rb
@@ -4,6 +4,8 @@ module Gitlab
module BackgroundMigration
# Back-fill storage_size for project_statistics
class BackfillProjectStatisticsStorageSizeWithoutUploadsSize < Gitlab::BackgroundMigration::BatchedMigrationJob
+ feature_category :database
+
def perform
# no-op
end
diff --git a/lib/gitlab/background_migration/backfill_releases_author_id.rb b/lib/gitlab/background_migration/backfill_releases_author_id.rb
index 62af0b42e5d..8982fe1acca 100644
--- a/lib/gitlab/background_migration/backfill_releases_author_id.rb
+++ b/lib/gitlab/background_migration/backfill_releases_author_id.rb
@@ -9,6 +9,7 @@ module Gitlab
class BackfillReleasesAuthorId < BatchedMigrationJob
operation_name :backfill_releases_author_id
job_arguments :ghost_user_id
+ feature_category :database
scope_to ->(relation) { relation.where(author_id: nil) }
diff --git a/lib/gitlab/background_migration/backfill_user_details_fields.rb b/lib/gitlab/background_migration/backfill_user_details_fields.rb
index 8d8619256b0..26489d06a85 100644
--- a/lib/gitlab/background_migration/backfill_user_details_fields.rb
+++ b/lib/gitlab/background_migration/backfill_user_details_fields.rb
@@ -11,6 +11,7 @@ module Gitlab
# * organization
class BackfillUserDetailsFields < BatchedMigrationJob
operation_name :backfill_user_details_fields
+ feature_category :database
def perform
query = <<~SQL
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 37b1a37569b..20c3c68ec40 100644
--- a/lib/gitlab/background_migration/backfill_vulnerability_reads_cluster_agent.rb
+++ b/lib/gitlab/background_migration/backfill_vulnerability_reads_cluster_agent.rb
@@ -5,6 +5,7 @@ module Gitlab
# Backfills the `vulnerability_reads.casted_cluster_agent_id` column
class BackfillVulnerabilityReadsClusterAgent < Gitlab::BackgroundMigration::BatchedMigrationJob
operation_name :update_all
+ feature_category :database
CLUSTER_AGENTS_JOIN = <<~SQL
INNER JOIN cluster_agents
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 a020cabd1f4..fc0d0ce3a57 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
@@ -5,6 +5,8 @@ module Gitlab
# Backfills the `issues.work_item_type_id` column, replacing any
# instances of `NULL` with the appropriate `work_item_types.id` based on `issues.issue_type`
class BackfillWorkItemTypeIdForIssues < BatchedMigrationJob
+ feature_category :database
+
# Basic AR model for issues table
class MigrationIssue < ApplicationRecord
self.table_name = 'issues'
diff --git a/lib/gitlab/background_migration/cleanup_orphaned_routes.rb b/lib/gitlab/background_migration/cleanup_orphaned_routes.rb
index 0cd19dc5df9..5c0ddf0ba8b 100644
--- a/lib/gitlab/background_migration/cleanup_orphaned_routes.rb
+++ b/lib/gitlab/background_migration/cleanup_orphaned_routes.rb
@@ -8,6 +8,8 @@ module Gitlab
class CleanupOrphanedRoutes < Gitlab::BackgroundMigration::BatchedMigrationJob
include Gitlab::Database::DynamicModelHelpers
+ feature_category :database
+
def perform
# there should really be no records to fix, there is none gitlab.com, but taking the safer route, just in case.
fix_missing_namespace_id_routes
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 136293242b2..033b2c87152 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
@@ -16,6 +16,7 @@ module Gitlab
class CopyColumnUsingBackgroundMigrationJob < BatchedMigrationJob
job_arguments :copy_from, :copy_to
operation_name :update_all
+ feature_category :database
def perform
assignment_clauses = build_assignment_clauses(copy_from, copy_to)
diff --git a/lib/gitlab/background_migration/delete_approval_rules_with_vulnerability.rb b/lib/gitlab/background_migration/delete_approval_rules_with_vulnerability.rb
index 739197898d9..c7c063e8ccf 100644
--- a/lib/gitlab/background_migration/delete_approval_rules_with_vulnerability.rb
+++ b/lib/gitlab/background_migration/delete_approval_rules_with_vulnerability.rb
@@ -5,6 +5,8 @@ module Gitlab
# This class doesn't delete approval rules
# as this feature exists only in EE
class DeleteApprovalRulesWithVulnerability < BatchedMigrationJob
+ feature_category :database
+
def perform
end
end
diff --git a/lib/gitlab/background_migration/delete_invalid_epic_issues.rb b/lib/gitlab/background_migration/delete_invalid_epic_issues.rb
index 3af59ab4931..6c0eb6b1950 100644
--- a/lib/gitlab/background_migration/delete_invalid_epic_issues.rb
+++ b/lib/gitlab/background_migration/delete_invalid_epic_issues.rb
@@ -4,6 +4,8 @@ module Gitlab
module BackgroundMigration
# rubocop: disable Style/Documentation
class DeleteInvalidEpicIssues < BatchedMigrationJob
+ feature_category :database
+
def perform
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 f93dcf83c49..6953ae65651 100644
--- a/lib/gitlab/background_migration/delete_orphaned_operational_vulnerabilities.rb
+++ b/lib/gitlab/background_migration/delete_orphaned_operational_vulnerabilities.rb
@@ -17,6 +17,8 @@ module Gitlab
SQL
operation_name :delete_orphaned_operational_vulnerabilities
+ feature_category :database
+
scope_to ->(relation) do
relation
.where(report_type: [REPORT_TYPES[:cluster_image_scanning], REPORT_TYPES[:custom]])
diff --git a/lib/gitlab/background_migration/delete_orphans_approval_merge_request_rules.rb b/lib/gitlab/background_migration/delete_orphans_approval_merge_request_rules.rb
index 4b7b7d42c77..e77d56d68cb 100644
--- a/lib/gitlab/background_migration/delete_orphans_approval_merge_request_rules.rb
+++ b/lib/gitlab/background_migration/delete_orphans_approval_merge_request_rules.rb
@@ -7,6 +7,7 @@ module Gitlab
scope_to ->(relation) { relation.where(report_type: 4) }
operation_name :delete_all
+ feature_category :database
def perform
each_sub_batch do |sub_batch|
diff --git a/lib/gitlab/background_migration/delete_orphans_approval_project_rules.rb b/lib/gitlab/background_migration/delete_orphans_approval_project_rules.rb
index 33aa1a8d29d..28809df8694 100644
--- a/lib/gitlab/background_migration/delete_orphans_approval_project_rules.rb
+++ b/lib/gitlab/background_migration/delete_orphans_approval_project_rules.rb
@@ -5,6 +5,7 @@ module Gitlab
# Deletes orphans records whenever report_type equals to scan_finding (i.e., 4)
class DeleteOrphansApprovalProjectRules < BatchedMigrationJob
operation_name :delete_all
+ feature_category :database
def perform
each_sub_batch do |sub_batch|
diff --git a/lib/gitlab/background_migration/destroy_invalid_group_members.rb b/lib/gitlab/background_migration/destroy_invalid_group_members.rb
index 9eb0d4489d6..79aae719d03 100644
--- a/lib/gitlab/background_migration/destroy_invalid_group_members.rb
+++ b/lib/gitlab/background_migration/destroy_invalid_group_members.rb
@@ -10,6 +10,7 @@ module Gitlab
end
operation_name :delete_all
+ feature_category :database
def perform
each_sub_batch do |sub_batch|
diff --git a/lib/gitlab/background_migration/destroy_invalid_members.rb b/lib/gitlab/background_migration/destroy_invalid_members.rb
index b274c71f24f..9a70dc39960 100644
--- a/lib/gitlab/background_migration/destroy_invalid_members.rb
+++ b/lib/gitlab/background_migration/destroy_invalid_members.rb
@@ -5,6 +5,7 @@ module Gitlab
class DestroyInvalidMembers < Gitlab::BackgroundMigration::BatchedMigrationJob # rubocop:disable Style/Documentation
scope_to ->(relation) { relation.where(member_namespace_id: nil) }
operation_name :delete_all
+ feature_category :database
def perform
each_sub_batch do |sub_batch|
diff --git a/lib/gitlab/background_migration/destroy_invalid_project_members.rb b/lib/gitlab/background_migration/destroy_invalid_project_members.rb
index 53b4712ef6e..5f6bb840f77 100644
--- a/lib/gitlab/background_migration/destroy_invalid_project_members.rb
+++ b/lib/gitlab/background_migration/destroy_invalid_project_members.rb
@@ -5,6 +5,7 @@ module Gitlab
class DestroyInvalidProjectMembers < Gitlab::BackgroundMigration::BatchedMigrationJob # rubocop:disable Style/Documentation
scope_to ->(relation) { relation.where(source_type: 'Project') }
operation_name :delete_all
+ feature_category :database
def perform
each_sub_batch do |sub_batch|
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 b32e88581dd..c4ce88b9404 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
@@ -8,6 +8,7 @@ module Gitlab
THRESHOLD_DATE = '2022-02-17 09:00:00'
operation_name :disable_legacy_open_source_licence_for_recent_public_projects
+ feature_category :database
# Migration only version of `project_settings` table
class ProjectSetting < ApplicationRecord
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 5685b782a71..6114aa33a43 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
@@ -9,6 +9,7 @@ module Gitlab
LAST_ACTIVITY_DATE = '2021-07-01'
operation_name :disable_legacy_open_source_license_available
+ feature_category :database
# Migration only version of `project_settings` table
class ProjectSetting < ApplicationRecord
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 b5e5555bd2d..2eb7c5230ba 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
@@ -7,6 +7,7 @@ module Gitlab
PUBLIC = 20
operation_name :disable_legacy_open_source_license_for_no_issues_no_repo_projects
+ feature_category :database
# Migration only version of `project_settings` table
class ProjectSetting < ApplicationRecord
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 89863458676..8953836c705 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
@@ -7,6 +7,7 @@ module Gitlab
PUBLIC = 20
operation_name :disable_legacy_open_source_license_for_one_member_no_repo_projects
+ feature_category :database
# Migration only version of `project_settings` table
class ProjectSetting < ApplicationRecord
diff --git a/lib/gitlab/background_migration/disable_legacy_open_source_license_for_projects_less_than_five_mb.rb b/lib/gitlab/background_migration/disable_legacy_open_source_license_for_projects_less_than_five_mb.rb
index dcef4f086e2..b2805289b30 100644
--- a/lib/gitlab/background_migration/disable_legacy_open_source_license_for_projects_less_than_five_mb.rb
+++ b/lib/gitlab/background_migration/disable_legacy_open_source_license_for_projects_less_than_five_mb.rb
@@ -10,6 +10,7 @@ module Gitlab
end
operation_name :disable_legacy_open_source_license_for_projects_less_than_five_mb
+ feature_category :database
def perform
each_sub_batch do |sub_batch|
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 7d93f2d4fda..15c80a6cac2 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
@@ -6,6 +6,7 @@ module Gitlab
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
+ feature_category :database
def perform
each_sub_batch do |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 08bcdb8a789..740f69c1c53 100644
--- a/lib/gitlab/background_migration/expire_o_auth_tokens.rb
+++ b/lib/gitlab/background_migration/expire_o_auth_tokens.rb
@@ -5,6 +5,7 @@ module Gitlab
# Add expiry to all OAuth access tokens
class ExpireOAuthTokens < ::Gitlab::BackgroundMigration::BatchedMigrationJob
operation_name :update_oauth_tokens
+ feature_category :database
def perform
each_sub_batch(
diff --git a/lib/gitlab/background_migration/fix_approval_project_rules_without_protected_branches.rb b/lib/gitlab/background_migration/fix_approval_project_rules_without_protected_branches.rb
index 4b283bae79d..bfbed0408e1 100644
--- a/lib/gitlab/background_migration/fix_approval_project_rules_without_protected_branches.rb
+++ b/lib/gitlab/background_migration/fix_approval_project_rules_without_protected_branches.rb
@@ -5,6 +5,8 @@ module Gitlab
# This class doesn't update approval project rules
# as this feature exists only in EE
class FixApprovalProjectRulesWithoutProtectedBranches < BatchedMigrationJob
+ feature_category :database
+
def perform; end
end
end
diff --git a/lib/gitlab/background_migration/fix_security_scan_statuses.rb b/lib/gitlab/background_migration/fix_security_scan_statuses.rb
index b60e739f870..1cfc9a278b7 100644
--- a/lib/gitlab/background_migration/fix_security_scan_statuses.rb
+++ b/lib/gitlab/background_migration/fix_security_scan_statuses.rb
@@ -4,6 +4,8 @@ module Gitlab
module BackgroundMigration
# Fixes the `status` attribute of `security_scans` records
class FixSecurityScanStatuses < BatchedMigrationJob
+ feature_category :database
+
def perform
# no-op. The logic is defined in EE module.
end
diff --git a/lib/gitlab/background_migration/migrate_shared_vulnerability_scanners.rb b/lib/gitlab/background_migration/migrate_shared_vulnerability_scanners.rb
index bea0120f093..d1acb8ca2d2 100644
--- a/lib/gitlab/background_migration/migrate_shared_vulnerability_scanners.rb
+++ b/lib/gitlab/background_migration/migrate_shared_vulnerability_scanners.rb
@@ -4,6 +4,8 @@ module Gitlab
module BackgroundMigration
# rubocop: disable Style/Documentation
class MigrateSharedVulnerabilityScanners < BatchedMigrationJob
+ feature_category :database
+
def perform
end
end
diff --git a/lib/gitlab/background_migration/migrate_vulnerabilities_feedback_to_vulnerabilities_state_transition.rb b/lib/gitlab/background_migration/migrate_vulnerabilities_feedback_to_vulnerabilities_state_transition.rb
index 81b29b5a6cd..84f7462e6b8 100644
--- a/lib/gitlab/background_migration/migrate_vulnerabilities_feedback_to_vulnerabilities_state_transition.rb
+++ b/lib/gitlab/background_migration/migrate_vulnerabilities_feedback_to_vulnerabilities_state_transition.rb
@@ -4,6 +4,8 @@
module Gitlab
module BackgroundMigration
class MigrateVulnerabilitiesFeedbackToVulnerabilitiesStateTransition < BatchedMigrationJob
+ feature_category :database
+
def perform; end
end
end
diff --git a/lib/gitlab/background_migration/populate_approval_merge_request_rules_with_security_orchestration.rb b/lib/gitlab/background_migration/populate_approval_merge_request_rules_with_security_orchestration.rb
index 2257dc016be..00d7b1b9664 100644
--- a/lib/gitlab/background_migration/populate_approval_merge_request_rules_with_security_orchestration.rb
+++ b/lib/gitlab/background_migration/populate_approval_merge_request_rules_with_security_orchestration.rb
@@ -5,6 +5,8 @@ module Gitlab
# This class doesn't delete merge request level rules
# as this feature exists only in EE
class PopulateApprovalMergeRequestRulesWithSecurityOrchestration < BatchedMigrationJob
+ feature_category :database
+
def perform; end
end
end
diff --git a/lib/gitlab/background_migration/populate_approval_project_rules_with_security_orchestration.rb b/lib/gitlab/background_migration/populate_approval_project_rules_with_security_orchestration.rb
index 1d0c0010551..e5f283db926 100644
--- a/lib/gitlab/background_migration/populate_approval_project_rules_with_security_orchestration.rb
+++ b/lib/gitlab/background_migration/populate_approval_project_rules_with_security_orchestration.rb
@@ -5,6 +5,8 @@ module Gitlab
# This class doesn't delete merge request level rules
# as this feature exists only in EE
class PopulateApprovalProjectRulesWithSecurityOrchestration < BatchedMigrationJob
+ feature_category :database
+
def perform; end
end
end
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 3dd867fa1fe..46758bc8fed 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
@@ -7,6 +7,7 @@ module Gitlab
# The operations_access_level setting is being split into three seperate toggles.
class PopulateOperationVisibilityPermissionsFromOperations < BatchedMigrationJob
operation_name :populate_operations_visibility
+ feature_category :database
def perform
each_sub_batch do |batch|
diff --git a/lib/gitlab/background_migration/populate_projects_star_count.rb b/lib/gitlab/background_migration/populate_projects_star_count.rb
index 085d576637e..8417dc91b1b 100644
--- a/lib/gitlab/background_migration/populate_projects_star_count.rb
+++ b/lib/gitlab/background_migration/populate_projects_star_count.rb
@@ -7,6 +7,7 @@ module Gitlab
MAX_UPDATE_RETRIES = 3
operation_name :update_all
+ feature_category :database
def perform
each_sub_batch do |sub_batch|
diff --git a/lib/gitlab/background_migration/prune_stale_project_export_jobs.rb b/lib/gitlab/background_migration/prune_stale_project_export_jobs.rb
index a91cda2c427..3b4b55276fa 100644
--- a/lib/gitlab/background_migration/prune_stale_project_export_jobs.rb
+++ b/lib/gitlab/background_migration/prune_stale_project_export_jobs.rb
@@ -8,6 +8,7 @@ module Gitlab
scope_to ->(relation) { relation.where("updated_at < ?", EXPIRES_IN.ago) }
operation_name :delete_all
+ feature_category :database
def perform
each_sub_batch(&:delete_all)
diff --git a/lib/gitlab/background_migration/recount_epic_cache_counts.rb b/lib/gitlab/background_migration/recount_epic_cache_counts.rb
index 42f84a33a5a..cec17ef7cff 100644
--- a/lib/gitlab/background_migration/recount_epic_cache_counts.rb
+++ b/lib/gitlab/background_migration/recount_epic_cache_counts.rb
@@ -4,6 +4,8 @@ module Gitlab
module BackgroundMigration
# rubocop: disable Style/Documentation
class RecountEpicCacheCounts < Gitlab::BackgroundMigration::BatchedMigrationJob
+ feature_category :database
+
def perform; end
end
# rubocop: enable Style/Documentation
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 dc7c16d7947..7b88e10f39c 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
@@ -7,6 +7,7 @@ module Gitlab
# These job artifacts will not be deleted and will have their `expire_at` removed.
class RemoveBackfilledJobArtifactsExpireAt < BatchedMigrationJob
operation_name :update_all
+ feature_category :database
# The migration would have backfilled `expire_at`
# to midnight on the 22nd of the month of the local timezone,
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 a284c04d4f5..cf3897208b8 100644
--- a/lib/gitlab/background_migration/remove_self_managed_wiki_notes.rb
+++ b/lib/gitlab/background_migration/remove_self_managed_wiki_notes.rb
@@ -5,6 +5,7 @@ module Gitlab
# Removes obsolete wiki notes
class RemoveSelfManagedWikiNotes < BatchedMigrationJob
operation_name :delete_all
+ feature_category :database
def perform
each_sub_batch do |sub_batch|
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 1b13c2ab7ef..0615d8a6783 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
@@ -14,6 +14,7 @@ module Gitlab
}
operation_name :update_all
+ feature_category :database
def perform
each_sub_batch do |sub_batch|
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 832385fd662..64eae1e934e 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
@@ -5,6 +5,7 @@ module Gitlab
# 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
+ feature_category :database
def perform
each_sub_batch do |sub_batch|
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 5f552accd8d..fd15caa5644 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
@@ -5,6 +5,7 @@ module Gitlab
# A job to nullify duplicate token values in ci_runners table in batches
class ResetDuplicateCiRunnersTokenValues < BatchedMigrationJob
operation_name :nullify_duplicate_ci_runner_token_values
+ feature_category :database
def perform
each_sub_batch do |sub_batch|
diff --git a/lib/gitlab/background_migration/reset_status_on_container_repositories.rb b/lib/gitlab/background_migration/reset_status_on_container_repositories.rb
index 09cd3b1895f..0dbe2781327 100644
--- a/lib/gitlab/background_migration/reset_status_on_container_repositories.rb
+++ b/lib/gitlab/background_migration/reset_status_on_container_repositories.rb
@@ -13,6 +13,7 @@ module Gitlab
scope_to ->(relation) { relation.where(status: DELETE_SCHEDULED_STATUS) }
operation_name :reset_status_on_container_repositories
+ feature_category :database
def perform
each_sub_batch do |sub_batch|
diff --git a/lib/gitlab/background_migration/sanitize_confidential_todos.rb b/lib/gitlab/background_migration/sanitize_confidential_todos.rb
index d3ef6ac3019..2df0b8a4d93 100644
--- a/lib/gitlab/background_migration/sanitize_confidential_todos.rb
+++ b/lib/gitlab/background_migration/sanitize_confidential_todos.rb
@@ -13,6 +13,7 @@ module Gitlab
scope_to ->(relation) { relation.where(confidential: true) }
operation_name :delete_invalid_todos
+ feature_category :database
def perform
each_sub_batch do |sub_batch|
diff --git a/lib/gitlab/background_migration/second_recount_epic_cache_counts.rb b/lib/gitlab/background_migration/second_recount_epic_cache_counts.rb
index 37933affe71..4d7c4a682a9 100644
--- a/lib/gitlab/background_migration/second_recount_epic_cache_counts.rb
+++ b/lib/gitlab/background_migration/second_recount_epic_cache_counts.rb
@@ -4,6 +4,8 @@ module Gitlab
module BackgroundMigration
# rubocop: disable Style/Documentation
class SecondRecountEpicCacheCounts < Gitlab::BackgroundMigration::BatchedMigrationJob
+ feature_category :database
+
def perform; end
end
# rubocop: enable Style/Documentation
diff --git a/lib/gitlab/background_migration/set_correct_vulnerability_state.rb b/lib/gitlab/background_migration/set_correct_vulnerability_state.rb
index dfd71bb8b5f..49ef75d7ba8 100644
--- a/lib/gitlab/background_migration/set_correct_vulnerability_state.rb
+++ b/lib/gitlab/background_migration/set_correct_vulnerability_state.rb
@@ -8,6 +8,7 @@ module Gitlab
scope_to ->(relation) { relation.where.not(dismissed_at: nil) }
operation_name :update_vulnerabilities_state
+ feature_category :database
def perform
each_sub_batch do |sub_batch|
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 4ae7ad897cf..86fcfa18dc3 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
@@ -7,6 +7,7 @@ module Gitlab
PUBLIC = 20
operation_name :set_legacy_open_source_license_available
+ feature_category :database
# Migration only version of `project_settings` table
class ProjectSetting < ApplicationRecord
diff --git a/lib/gitlab/background_migration/update_ci_pipeline_artifacts_unknown_locked_status.rb b/lib/gitlab/background_migration/update_ci_pipeline_artifacts_unknown_locked_status.rb
index 84183753158..77b4a9ab7e4 100644
--- a/lib/gitlab/background_migration/update_ci_pipeline_artifacts_unknown_locked_status.rb
+++ b/lib/gitlab/background_migration/update_ci_pipeline_artifacts_unknown_locked_status.rb
@@ -9,6 +9,8 @@ module Gitlab
# value of the associated `ci_pipelines.locked` value. This class
# does an UPDATE join to make the values match.
class UpdateCiPipelineArtifactsUnknownLockedStatus < BatchedMigrationJob
+ feature_category :database
+
def perform
connection.exec_query(<<~SQL)
UPDATE ci_pipeline_artifacts
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 b2cf8298e4f..a7faa5703da 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
@@ -11,6 +11,7 @@ module Gitlab
end
operation_name :set_delayed_project_removal_to_null_for_user_namespace
+ feature_category :database
def perform
each_sub_batch do |sub_batch|
diff --git a/lib/gitlab/background_migration/update_jira_tracker_data_deployment_type_based_on_url.rb b/lib/gitlab/background_migration/update_jira_tracker_data_deployment_type_based_on_url.rb
index 8aab7d13b45..6d59a5c8651 100644
--- a/lib/gitlab/background_migration/update_jira_tracker_data_deployment_type_based_on_url.rb
+++ b/lib/gitlab/background_migration/update_jira_tracker_data_deployment_type_based_on_url.rb
@@ -4,6 +4,8 @@
module Gitlab
module BackgroundMigration
class UpdateJiraTrackerDataDeploymentTypeBasedOnUrl < Gitlab::BackgroundMigration::BatchedMigrationJob
+ feature_category :database
+
# rubocop: disable Gitlab/NamespacedClass
class JiraTrackerData < ActiveRecord::Base
self.table_name = "jira_tracker_data"
diff --git a/lib/gitlab/ci/variables/collection.rb b/lib/gitlab/ci/variables/collection.rb
index 63519877971..9960a6fbdf5 100644
--- a/lib/gitlab/ci/variables/collection.rb
+++ b/lib/gitlab/ci/variables/collection.rb
@@ -72,6 +72,35 @@ module Gitlab
Collection.new(@variables.reject(&block))
end
+ def sort_and_expand_all(keep_undefined: false, expand_file_refs: true, expand_raw_refs: true)
+ sorted = Sort.new(self)
+ return self.class.new(self, sorted.errors) unless sorted.valid?
+
+ new_collection = self.class.new
+
+ sorted.tsort.each do |item|
+ unless item.depends_on
+ new_collection.append(item)
+ next
+ end
+
+ # expand variables as they are added
+ variable = item.to_runner_variable
+ variable[:value] = new_collection.expand_value(variable[:value], keep_undefined: keep_undefined,
+ expand_file_refs: expand_file_refs,
+ expand_raw_refs: expand_raw_refs)
+ new_collection.append(variable)
+ end
+
+ new_collection
+ end
+
+ def to_s
+ "#{@variables_by_key.keys}, @errors='#{@errors}'"
+ end
+
+ protected
+
def expand_value(value, keep_undefined: false, expand_file_refs: true, expand_raw_refs: true)
value.gsub(Item::VARIABLES_REGEXP) do
match = Regexp.last_match # it is either a valid variable definition or a ($$ / %%)
@@ -115,34 +144,7 @@ module Gitlab
end
end
- def sort_and_expand_all(keep_undefined: false, expand_file_refs: true, expand_raw_refs: true)
- sorted = Sort.new(self)
- return self.class.new(self, sorted.errors) unless sorted.valid?
-
- new_collection = self.class.new
-
- sorted.tsort.each do |item|
- unless item.depends_on
- new_collection.append(item)
- next
- end
-
- # expand variables as they are added
- variable = item.to_runner_variable
- variable[:value] = new_collection.expand_value(variable[:value], keep_undefined: keep_undefined,
- expand_file_refs: expand_file_refs,
- expand_raw_refs: expand_raw_refs)
- new_collection.append(variable)
- end
-
- new_collection
- end
-
- def to_s
- "#{@variables_by_key.keys}, @errors='#{@errors}'"
- end
-
- protected
+ private
attr_reader :variables
end
diff --git a/lib/sidebars/projects/menus/deployments_menu.rb b/lib/sidebars/projects/menus/deployments_menu.rb
index dc40aca2d27..bd4ff83a286 100644
--- a/lib/sidebars/projects/menus/deployments_menu.rb
+++ b/lib/sidebars/projects/menus/deployments_menu.rb
@@ -10,7 +10,7 @@ module Sidebars
add_item(feature_flags_menu_item)
add_item(releases_menu_item)
- if Feature.enabled?(:show_pages_in_deployments_menu, context.project, type: :experiment)
+ if Feature.enabled?(:show_pages_in_deployments_menu, context.current_user, type: :experiment)
add_item(pages_menu_item)
end
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 9fc32c15371..c2f476b94ad 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -14419,6 +14419,9 @@ msgstr ""
msgid "Difference between start date and now"
msgstr ""
+msgid "Different user's signature"
+msgstr ""
+
msgid "DiffsCompareBaseBranch|(HEAD)"
msgstr ""
@@ -17815,6 +17818,9 @@ msgstr ""
msgid "GPG Keys"
msgstr ""
+msgid "GPG key mismatch"
+msgstr ""
+
msgid "GPG keys allow you to verify signed commits."
msgstr ""
@@ -20895,9 +20901,6 @@ msgstr ""
msgid "If no options are selected, only administrators can register runners."
msgstr ""
-msgid "If none of the options work, try contacting a GitLab administrator."
-msgstr ""
-
msgid "If the number of active users exceeds the user limit, you will be charged for the number of %{users_over_license_link} at your next license reconciliation."
msgstr ""
@@ -20919,6 +20922,9 @@ msgstr ""
msgid "If you add %{codeStart}needs%{codeEnd} to jobs in your pipeline you'll be able to view the %{codeStart}needs%{codeEnd} relationships between jobs in this tab as a %{linkStart}Directed Acyclic Graph (DAG)%{linkEnd}."
msgstr ""
+msgid "If you are unable to sign in or recover your password, contact a GitLab administrator."
+msgstr ""
+
msgid "If you did not initiate these sign-in attempts, please reach out to your administrator or enable two-factor authentication (2FA) on your account."
msgstr ""
@@ -24449,6 +24455,9 @@ msgstr ""
msgid "Learn More."
msgstr ""
+msgid "Learn about signing commits"
+msgstr ""
+
msgid "Learn about signing commits with SSH keys."
msgstr ""
@@ -24518,9 +24527,6 @@ msgstr ""
msgid "Learn more about shards and replicas in the %{configuration_link_start}Advanced Search configuration%{configuration_link_end} documentation. Changes don't take place until you %{recreated_link_start}recreate%{recreated_link_end} the index."
msgstr ""
-msgid "Learn more about signing commits"
-msgstr ""
-
msgid "Learn more in the"
msgstr ""
@@ -27157,6 +27163,9 @@ msgstr ""
msgid "Multiple Prometheus integrations are not supported"
msgstr ""
+msgid "Multiple signatures"
+msgstr ""
+
msgid "Multiplier to apply to polling intervals. Decimal values are supported. Defaults to 1."
msgstr ""
@@ -39077,9 +39086,6 @@ msgstr ""
msgid "Sign-in count:"
msgstr ""
-msgid "Sign-in failed because %{error}."
-msgstr ""
-
msgid "Sign-in page"
msgstr ""
@@ -42642,21 +42648,27 @@ msgstr ""
msgid "This commit is part of merge request %{link_to_merge_request}. Comments created here will be created in the context of that merge request."
msgstr ""
-msgid "This commit was signed with %{strong_open}multiple%{strong_close} signatures."
-msgstr ""
-
msgid "This commit was signed with a %{strong_open}verified%{strong_close} signature and the committer email is verified to belong to the same user."
msgstr ""
msgid "This commit was signed with a different user's verified signature."
msgstr ""
+msgid "This commit was signed with a verified signature and the committer email was verified to belong to the same user."
+msgstr ""
+
msgid "This commit was signed with a verified signature, but the committer email is not associated with the GPG Key."
msgstr ""
msgid "This commit was signed with an %{strong_open}unverified%{strong_close} signature."
msgstr ""
+msgid "This commit was signed with an unverified signature."
+msgstr ""
+
+msgid "This commit was signed with multiple signatures."
+msgstr ""
+
msgid "This content could not be displayed because %{reason}. You can %{options} instead."
msgstr ""
@@ -44234,9 +44246,6 @@ msgstr ""
msgid "Try it out now"
msgstr ""
-msgid "Try logging in using your username or email. If you have forgotten your password, try recovering it"
-msgstr ""
-
msgid "Try out GitLab Pipelines"
msgstr ""
@@ -44681,6 +44690,9 @@ msgstr ""
msgid "Unverified"
msgstr ""
+msgid "Unverified signature"
+msgstr ""
+
msgid "Up to date"
msgstr ""
@@ -45889,6 +45901,9 @@ msgstr ""
msgid "Verified"
msgstr ""
+msgid "Verified commit"
+msgstr ""
+
msgid "Verify SAML Configuration"
msgstr ""
diff --git a/rubocop/cop/background_migration/feature_category.rb b/rubocop/cop/background_migration/feature_category.rb
index 2c96e5f29de..ec70b5baadf 100644
--- a/rubocop/cop/background_migration/feature_category.rb
+++ b/rubocop/cop/background_migration/feature_category.rb
@@ -12,12 +12,12 @@ module RuboCop
FEATURE_CATEGORIES_FILE_PATH = "config/feature_categories.yml"
- MSG = "'feature_category' should be defined to better assign the ownership for batched migration jobs. "\
- "For more details refer: "\
- "https://docs.gitlab.com/ee/development/feature_categorization/#batched-background-migrations"
+ MSG = "'feature_category' should be defined to better assign the ownership for batched migration jobs. " \
+ "For more details refer: " \
+ "https://docs.gitlab.com/ee/development/feature_categorization/#batched-background-migrations"
- INVALID_FEATURE_CATEGORY_MSG = "'feature_category' is invalid. "\
- "List of valid ones can be found in #{FEATURE_CATEGORIES_FILE_PATH}"
+ INVALID_FEATURE_CATEGORY_MSG = "'feature_category' is invalid. " \
+ "List of valid ones can be found in #{FEATURE_CATEGORIES_FILE_PATH}"
RESTRICT_ON_SEND = [:feature_category].freeze
diff --git a/spec/features/projects/navbar_spec.rb b/spec/features/projects/navbar_spec.rb
index 22aae2b67c2..d182ae1bb84 100644
--- a/spec/features/projects/navbar_spec.rb
+++ b/spec/features/projects/navbar_spec.rb
@@ -15,7 +15,7 @@ RSpec.describe 'Project navbar', feature_category: :projects do
before do
sign_in(user)
- Feature.disable(:show_pages_in_deployments_menu, :project)
+ stub_feature_flags(show_pages_in_deployments_menu: false)
stub_config(registry: { enabled: false })
stub_feature_flags(harbor_registry_integration: false)
diff --git a/spec/features/projects/pages/user_edits_settings_spec.rb b/spec/features/projects/pages/user_edits_settings_spec.rb
index 4e51d8a615c..8c713b6f73a 100644
--- a/spec/features/projects/pages/user_edits_settings_spec.rb
+++ b/spec/features/projects/pages/user_edits_settings_spec.rb
@@ -10,7 +10,7 @@ RSpec.describe 'Pages edits pages settings', :js, feature_category: :pages do
before do
allow(Gitlab.config.pages).to receive(:enabled).and_return(true)
- Feature.disable(:show_pages_in_deployments_menu, :project)
+ stub_feature_flags(show_pages_in_deployments_menu: false)
project.add_maintainer(user)
diff --git a/spec/features/projects/settings/user_searches_in_settings_spec.rb b/spec/features/projects/settings/user_searches_in_settings_spec.rb
index 8a11507d064..923a6a10671 100644
--- a/spec/features/projects/settings/user_searches_in_settings_spec.rb
+++ b/spec/features/projects/settings/user_searches_in_settings_spec.rb
@@ -68,6 +68,7 @@ RSpec.describe 'User searches project settings', :js, feature_category: :project
context 'in Pages page' do
before do
+ stub_feature_flags(show_pages_in_deployments_menu: false)
allow(Gitlab.config.pages).to receive(:enabled).and_return(true)
visit project_pages_path(project)
diff --git a/spec/features/signed_commits_spec.rb b/spec/features/signed_commits_spec.rb
index 34127787e47..bc82afc70a3 100644
--- a/spec/features/signed_commits_spec.rb
+++ b/spec/features/signed_commits_spec.rb
@@ -94,8 +94,6 @@ RSpec.describe 'GPG signed commits', feature_category: :source_code_management d
within '.popover' do
expect(page).to have_content 'This commit was signed with a verified signature, but the committer email is not associated with the GPG Key.'
- expect(page).to have_content 'Bette Cartwright'
- expect(page).to have_content '@bette.cartwright'
expect(page).to have_content "GPG Key ID: #{GpgHelpers::User2.primary_keyid}"
end
end
@@ -110,8 +108,6 @@ RSpec.describe 'GPG signed commits', feature_category: :source_code_management d
within '.popover' do
expect(page).to have_content "This commit was signed with a different user's verified signature."
- expect(page).to have_content 'Bette Cartwright'
- expect(page).to have_content '@bette.cartwright'
expect(page).to have_content "GPG Key ID: #{GpgHelpers::User2.primary_keyid}"
end
end
@@ -138,9 +134,7 @@ RSpec.describe 'GPG signed commits', feature_category: :source_code_management d
page.find('.gpg-status-box', text: 'Verified').click
within '.popover' do
- expect(page).to have_content 'This commit was signed with a verified signature and the committer email is verified to belong to the same user.'
- expect(page).to have_content 'Nannie Bernhard'
- expect(page).to have_content '@nannie.bernhard'
+ expect(page).to have_content 'This commit was signed with a verified signature and the committer email was verified to belong to the same user.'
expect(page).to have_content "GPG Key ID: #{GpgHelpers::User1.primary_keyid}"
end
end
@@ -162,9 +156,7 @@ RSpec.describe 'GPG signed commits', feature_category: :source_code_management d
page.find('.gpg-status-box', text: 'Verified').click
within '.popover' do
- expect(page).to have_content 'This commit was signed with a verified signature and the committer email is verified to belong to the same user.'
- expect(page).to have_content 'Nannie Bernhard'
- expect(page).to have_content 'nannie.bernhard@example.com'
+ expect(page).to have_content 'This commit was signed with a verified signature and the committer email was verified to belong to the same user.'
expect(page).to have_content "GPG Key ID: #{GpgHelpers::User1.primary_keyid}"
end
end
diff --git a/spec/lib/gitlab/ci/variables/collection_spec.rb b/spec/lib/gitlab/ci/variables/collection_spec.rb
index ac5c6fc2d31..4ee122cc607 100644
--- a/spec/lib/gitlab/ci/variables/collection_spec.rb
+++ b/spec/lib/gitlab/ci/variables/collection_spec.rb
@@ -295,69 +295,6 @@ RSpec.describe Gitlab::Ci::Variables::Collection, feature_category: :pipeline_au
end
end
- describe '#expand_value' do
- let(:collection) do
- Gitlab::Ci::Variables::Collection.new
- .append(key: 'CI_JOB_NAME', value: 'test-1')
- .append(key: 'CI_BUILD_ID', value: '1')
- .append(key: 'TEST1', value: 'test-3')
- .append(key: 'FILEVAR1', value: 'file value 1', file: true)
- end
-
- context 'table tests' do
- using RSpec::Parameterized::TableSyntax
-
- where do
- {
- "empty value": {
- value: '',
- result: ''
- },
- "simple expansions": {
- value: 'key$TEST1-$CI_BUILD_ID',
- result: 'keytest-3-1'
- },
- "complex expansion": {
- value: 'key${TEST1}-${CI_JOB_NAME}',
- result: 'keytest-3-test-1'
- },
- "missing variable not keeping original": {
- value: 'key${MISSING_VAR}-${CI_JOB_NAME}',
- result: 'key-test-1'
- },
- "missing variable keeping original": {
- value: 'key${MISSING_VAR}-${CI_JOB_NAME}',
- result: 'key${MISSING_VAR}-test-1',
- keep_undefined: true
- },
- "escaped characters are kept intact": {
- value: 'key-$TEST1-%%HOME%%-$${HOME}',
- result: 'key-test-3-%%HOME%%-$${HOME}'
- },
- "file variable with expand_file_refs: true": {
- value: 'key-$FILEVAR1-$TEST1',
- result: 'key-file value 1-test-3'
- },
- "file variable with expand_file_refs: false": {
- value: 'key-$FILEVAR1-$TEST1',
- result: 'key-$FILEVAR1-test-3',
- expand_file_refs: false
- }
- }
- end
-
- with_them do
- let(:options) { { keep_undefined: keep_undefined, expand_file_refs: expand_file_refs }.compact }
-
- subject(:expanded_result) { collection.expand_value(value, **options) }
-
- it 'matches expected expansion' do
- is_expected.to eq(result)
- end
- end
- end
- end
-
describe '#sort_and_expand_all' do
context 'table tests' do
using RSpec::Parameterized::TableSyntax
@@ -369,6 +306,14 @@ RSpec.describe Gitlab::Ci::Variables::Collection, feature_category: :pipeline_au
keep_undefined: false,
result: []
},
+ "empty string": {
+ variables: [
+ { key: 'variable', value: '' }
+ ],
+ result: [
+ { key: 'variable', value: '' }
+ ]
+ },
"simple expansions": {
variables: [
{ key: 'variable', value: 'value' },
@@ -560,13 +505,42 @@ RSpec.describe Gitlab::Ci::Variables::Collection, feature_category: :pipeline_au
{ key: 'variable2', value: '$variable3' },
{ key: 'variable3', value: 'key$variable$variable2' }
]
+ },
+ "file variables with expand_file_refs: true": {
+ variables: [
+ { key: 'file_var', value: 'secret content', file: true },
+ { key: 'variable1', value: 'var one' },
+ { key: 'variable2', value: 'var two $variable1 $file_var' }
+ ],
+ result: [
+ { key: 'file_var', value: 'secret content' },
+ { key: 'variable1', value: 'var one' },
+ { key: 'variable2', value: 'var two var one secret content' }
+ ]
+ },
+ "file variables with expand_file_refs: false": {
+ variables: [
+ { key: 'file_var', value: 'secret content', file: true },
+ { key: 'variable1', value: 'var one' },
+ { key: 'variable2', value: 'var two $variable1 $file_var' }
+ ],
+ expand_file_refs: false,
+ result: [
+ { key: 'file_var', value: 'secret content' },
+ { key: 'variable1', value: 'var one' },
+ { key: 'variable2', value: 'var two var one $file_var' }
+ ]
}
}
end
with_them do
let(:collection) { Gitlab::Ci::Variables::Collection.new(variables) }
- let(:options) { { keep_undefined: keep_undefined, expand_raw_refs: expand_raw_refs }.compact }
+ let(:options) do
+ { keep_undefined: keep_undefined,
+ expand_raw_refs: expand_raw_refs,
+ expand_file_refs: expand_file_refs }.compact
+ end
subject(:expanded_result) { collection.sort_and_expand_all(**options) }
@@ -586,4 +560,20 @@ RSpec.describe Gitlab::Ci::Variables::Collection, feature_category: :pipeline_au
end
end
end
+
+ describe '#to_s' do
+ let(:variables) do
+ [
+ { key: 'VAR', value: 'value', public: true },
+ { key: 'VAR2', value: 'value2', public: false }
+ ]
+ end
+
+ let(:errors) { 'circular variable reference detected' }
+ let(:collection) { Gitlab::Ci::Variables::Collection.new(variables, errors) }
+
+ subject(:result) { collection.to_s }
+
+ it { is_expected.to eq("[\"VAR\", \"VAR2\"], @errors='circular variable reference detected'") }
+ end
end
diff --git a/spec/lib/sidebars/projects/menus/settings_menu_spec.rb b/spec/lib/sidebars/projects/menus/settings_menu_spec.rb
index e31eeccca7a..c7aca0fb97e 100644
--- a/spec/lib/sidebars/projects/menus/settings_menu_spec.rb
+++ b/spec/lib/sidebars/projects/menus/settings_menu_spec.rb
@@ -11,7 +11,7 @@ RSpec.describe Sidebars::Projects::Menus::SettingsMenu do
subject { described_class.new(context) }
before do
- Feature.disable(:show_pages_in_deployments_menu, :project)
+ stub_feature_flags(show_pages_in_deployments_menu: false)
end
describe '#render?' do
diff --git a/spec/models/application_setting_spec.rb b/spec/models/application_setting_spec.rb
index a35a903a13b..5b99c68ec80 100644
--- a/spec/models/application_setting_spec.rb
+++ b/spec/models/application_setting_spec.rb
@@ -725,35 +725,7 @@ RSpec.describe ApplicationSetting, feature_category: :not_owned, type: :model do
end
context 'housekeeping settings' do
- it { is_expected.not_to allow_value(0).for(:housekeeping_incremental_repack_period) }
-
- it 'wants the full repack period to be at least the incremental repack period' do
- subject.housekeeping_incremental_repack_period = 2
- subject.housekeeping_full_repack_period = 1
-
- expect(subject).not_to be_valid
- end
-
- it 'wants the gc period to be at least the full repack period' do
- subject.housekeeping_full_repack_period = 100
- subject.housekeeping_gc_period = 90
-
- expect(subject).not_to be_valid
- end
-
- it 'allows the same period for incremental repack and full repack, effectively skipping incremental repack' do
- subject.housekeeping_incremental_repack_period = 2
- subject.housekeeping_full_repack_period = 2
-
- expect(subject).to be_valid
- end
-
- it 'allows the same period for full repack and gc, effectively skipping full repack' do
- subject.housekeeping_full_repack_period = 100
- subject.housekeeping_gc_period = 100
-
- expect(subject).to be_valid
- end
+ it { is_expected.not_to allow_value(0).for(:housekeeping_optimize_repository_period) }
end
context 'gitaly timeouts' do
diff --git a/spec/models/ci/runner_machine_spec.rb b/spec/models/ci/runner_machine_spec.rb
index e4e9f4d78fa..3a7a595e18e 100644
--- a/spec/models/ci/runner_machine_spec.rb
+++ b/spec/models/ci/runner_machine_spec.rb
@@ -16,5 +16,21 @@ RSpec.describe Ci::RunnerMachine, feature_category: :runner_fleet, type: :model
it { is_expected.to validate_length_of(:platform).is_at_most(255) }
it { is_expected.to validate_length_of(:architecture).is_at_most(255) }
it { is_expected.to validate_length_of(:ip_address).is_at_most(1024) }
+
+ context 'when runner has config' do
+ it 'is valid' do
+ runner_machine = build(:ci_runner_machine, config: { gpus: "all" })
+
+ expect(runner_machine).to be_valid
+ end
+ end
+
+ context 'when runner has an invalid config' do
+ it 'is invalid' do
+ runner_machine = build(:ci_runner_machine, config: { test: 1 })
+
+ expect(runner_machine).not_to be_valid
+ end
+ end
end
end
diff --git a/spec/models/member_spec.rb b/spec/models/member_spec.rb
index 0ebccf1cb65..115521f09bf 100644
--- a/spec/models/member_spec.rb
+++ b/spec/models/member_spec.rb
@@ -303,7 +303,7 @@ RSpec.describe Member do
@requested_member = project.requesters.find_by(user_id: requested_user.id)
accepted_request_user = create(:user).tap { |u| project.request_access(u) }
- @accepted_request_member = project.requesters.find_by(user_id: accepted_request_user.id).tap { |m| m.accept_request }
+ @accepted_request_member = project.requesters.find_by(user_id: accepted_request_user.id).tap { |m| m.accept_request(@owner_user) }
@member_with_minimal_access = create(:group_member, :minimal_access, source: group)
end
@@ -777,18 +777,25 @@ RSpec.describe Member do
describe '#accept_request' do
let(:member) { create(:project_member, requested_at: Time.current.utc) }
- it { expect(member.accept_request).to be_truthy }
+ it { expect(member.accept_request(@owner_user)).to be_truthy }
+ it { expect(member.accept_request(nil)).to be_truthy }
it 'clears requested_at' do
- member.accept_request
+ member.accept_request(@owner_user)
expect(member.requested_at).to be_nil
end
+ it 'saves the approving user' do
+ member.accept_request(@owner_user)
+
+ expect(member.created_by).to eq(@owner_user)
+ end
+
it 'calls #after_accept_request' do
expect(member).to receive(:after_accept_request)
- member.accept_request
+ member.accept_request(@owner_user)
end
end
diff --git a/spec/requests/api/settings_spec.rb b/spec/requests/api/settings_spec.rb
index e89988893c2..4d85849cff3 100644
--- a/spec/requests/api/settings_spec.rb
+++ b/spec/requests/api/settings_spec.rb
@@ -806,5 +806,62 @@ RSpec.describe API::Settings, 'Settings', :do_not_mock_admin_mode_setting, featu
.to include(a_string_matching('is not a number'))
end
end
+
+ context 'with housekeeping enabled' do
+ it 'at least one of housekeeping_incremental_repack_period or housekeeping_optimize_repository_period is required' do
+ put api("/application/settings", admin), params: {
+ housekeeping_enabled: true
+ }
+
+ expect(response).to have_gitlab_http_status(:bad_request)
+ expect(json_response['error']).to eq(
+ "housekeeping_incremental_repack_period, housekeeping_optimize_repository_period are missing, exactly one parameter must be provided"
+ )
+ end
+
+ context 'when housekeeping_incremental_repack_period is specified' do
+ it 'requires all three housekeeping settings' do
+ put api("/application/settings", admin), params: {
+ housekeeping_enabled: true,
+ housekeeping_incremental_repack_period: 10
+ }
+
+ expect(response).to have_gitlab_http_status(:bad_request)
+ expect(json_response['error']).to eq(
+ "housekeeping_full_repack_period, housekeeping_gc_period, housekeeping_incremental_repack_period provide all or none of parameters"
+ )
+ end
+
+ it 'returns housekeeping_optimize_repository_period value for all housekeeping settings attributes' do
+ put api("/application/settings", admin), params: {
+ housekeeping_enabled: true,
+ housekeeping_gc_period: 150,
+ housekeeping_full_repack_period: 125,
+ housekeeping_incremental_repack_period: 100
+ }
+
+ expect(response).to have_gitlab_http_status(:ok)
+ expect(json_response['housekeeping_optimize_repository_period']).to eq(100)
+ expect(json_response['housekeeping_full_repack_period']).to eq(100)
+ expect(json_response['housekeeping_gc_period']).to eq(100)
+ expect(json_response['housekeeping_incremental_repack_period']).to eq(100)
+ end
+ end
+
+ context 'when housekeeping_optimize_repository_period is specified' do
+ it 'returns housekeeping_optimize_repository_period value for all housekeeping settings attributes' do
+ put api("/application/settings", admin), params: {
+ housekeeping_enabled: true,
+ housekeeping_optimize_repository_period: 100
+ }
+
+ expect(response).to have_gitlab_http_status(:ok)
+ expect(json_response['housekeeping_optimize_repository_period']).to eq(100)
+ expect(json_response['housekeeping_full_repack_period']).to eq(100)
+ expect(json_response['housekeeping_gc_period']).to eq(100)
+ expect(json_response['housekeeping_incremental_repack_period']).to eq(100)
+ end
+ end
+ end
end
end
diff --git a/spec/support/shared_examples/models/members_notifications_shared_example.rb b/spec/support/shared_examples/models/members_notifications_shared_example.rb
index e74aab95e46..e28220334ac 100644
--- a/spec/support/shared_examples/models/members_notifications_shared_example.rb
+++ b/spec/support/shared_examples/models/members_notifications_shared_example.rb
@@ -51,7 +51,7 @@ RSpec.shared_examples 'members notifications' do |entity_type|
it "calls NotificationService.new_#{entity_type}_member" do
expect(notification_service).to receive(:"new_#{entity_type}_member").with(member)
- member.accept_request
+ member.accept_request(create(:user))
end
end
diff --git a/spec/views/errors/omniauth_error.html.haml_spec.rb b/spec/views/errors/omniauth_error.html.haml_spec.rb
index e99cb536bd8..487dd9f066f 100644
--- a/spec/views/errors/omniauth_error.html.haml_spec.rb
+++ b/spec/views/errors/omniauth_error.html.haml_spec.rb
@@ -15,8 +15,10 @@ RSpec.describe 'errors/omniauth_error' do
render
expect(rendered).to have_content(provider)
- expect(rendered).to have_content(_('Sign-in failed because %{error}.') % { error: error })
+ expect(rendered).to have_content(error)
expect(rendered).to have_link('Sign in')
- expect(rendered).to have_content(_('If none of the options work, try contacting a GitLab administrator.'))
+ expect(rendered).to have_content(
+ _('If you are unable to sign in or recover your password, contact a GitLab administrator.')
+ )
end
end
diff --git a/spec/views/projects/commit/show.html.haml_spec.rb b/spec/views/projects/commit/show.html.haml_spec.rb
index 1d9e5e782e5..8a709932f69 100644
--- a/spec/views/projects/commit/show.html.haml_spec.rb
+++ b/spec/views/projects/commit/show.html.haml_spec.rb
@@ -92,7 +92,7 @@ RSpec.describe 'projects/commit/show.html.haml', feature_category: :source_code
let(:commit) { project.commit(GpgHelpers::SIGNED_COMMIT_SHA) }
it 'renders unverified badge' do
- expect(title).to include('This commit was signed with an <strong>unverified</strong> signature.')
+ expect(title).to include('This commit was signed with an unverified signature.')
expect(content).to include(commit.signature.gpg_key_primary_keyid)
end
end
@@ -101,7 +101,7 @@ RSpec.describe 'projects/commit/show.html.haml', feature_category: :source_code
let(:commit) { project.commit('7b5160f9bb23a3d58a0accdbe89da13b96b1ece9') }
it 'renders unverified badge' do
- expect(title).to include('This commit was signed with an <strong>unverified</strong> signature.')
+ expect(title).to include('This commit was signed with an unverified signature.')
expect(content).to match(/SSH key fingerprint:[\s\S]+Unknown/)
end
end
@@ -112,7 +112,6 @@ RSpec.describe 'projects/commit/show.html.haml', feature_category: :source_code
it 'renders unverified badge' do
expect(title).to include('This commit was signed with an <strong>unverified</strong> signature.')
expect(content).to include(commit.signature.x509_certificate.subject_key_identifier.tr(":", " "))
- expect(content).to include(commit.signature.x509_certificate.email)
end
end
end