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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab/ci/package-and-test/main.gitlab-ci.yml4
-rw-r--r--.rubocop_todo/layout/argument_alignment.yml40
-rw-r--r--.rubocop_todo/layout/line_length.yml1
-rw-r--r--.rubocop_todo/lint/redundant_cop_disable_directive.yml1
-rw-r--r--.rubocop_todo/style/if_unless_modifier.yml1
-rw-r--r--.rubocop_todo/style/percent_literal_delimiters.yml1
-rw-r--r--.rubocop_todo/style/string_concatenation.yml1
-rw-r--r--GITALY_SERVER_VERSION2
-rw-r--r--app/controllers/groups/usage_quotas_controller.rb2
-rw-r--r--config/feature_flags/development/enable_hamilton_in_usage_quotas_ui.yml8
-rw-r--r--doc/user/project/repository/code_suggestions.md24
-rw-r--r--lib/gitlab/error_tracking/error_repository/open_api_strategy.rb6
-rw-r--r--lib/gitlab/import_export/group/import_export.yml1
-rw-r--r--lib/gitlab/import_export/group/tree_restorer.rb29
-rw-r--r--qa/qa/ce/strategy.rb12
-rw-r--r--qa/qa/page/project/issue/show.rb8
-rw-r--r--qa/qa/page/project/web_ide/edit.rb8
-rw-r--r--qa/qa/resource/badge_base.rb5
-rw-r--r--qa/qa/resource/bulk_import_group.rb4
-rw-r--r--qa/qa/resource/file.rb10
-rw-r--r--qa/qa/resource/group_base.rb12
-rw-r--r--qa/qa/resource/group_milestone.rb14
-rw-r--r--qa/qa/resource/issue.rb10
-rw-r--r--qa/qa/resource/job.rb3
-rw-r--r--qa/qa/resource/protected_branch.rb8
-rw-r--r--qa/qa/resource/registry_repository.rb3
-rw-r--r--qa/qa/resource/repository/commit.rb12
-rw-r--r--qa/qa/resource/repository/push.rb4
-rw-r--r--qa/qa/resource/user.rb27
-rw-r--r--qa/qa/scenario/test/instance/review_blocking.rb6
-rw-r--r--qa/qa/scenario/test/instance/review_non_blocking.rb6
-rw-r--r--qa/qa/specs/features/browser_ui/1_manage/integrations/jenkins/jenkins_build_status_spec.rb2
-rw-r--r--qa/qa/specs/features/browser_ui/1_manage/integrations/jira/jira_basic_integration_spec.rb4
-rw-r--r--qa/qa/vendor/jira/jira_api.rb8
-rw-r--r--qa/spec/support/loglinking_spec.rb21
-rw-r--r--spec/factories/error_tracking/open_api.rb9
-rw-r--r--spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/1689.json48
-rw-r--r--spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/1690.json50
-rw-r--r--spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/1691.json50
-rw-r--r--spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/1692.json50
-rw-r--r--spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/2106.json52
-rw-r--r--spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/2107.json52
-rw-r--r--spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/2108.json52
-rw-r--r--spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/2109.json52
-rw-r--r--spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/2110.json52
-rw-r--r--spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/_all.ndjson9
-rw-r--r--spec/frontend/vue_shared/new_namespace/new_namespace_page_spec.js3
-rw-r--r--spec/lib/gitlab/error_tracking/error_repository/open_api_strategy_spec.rb38
-rw-r--r--spec/lib/gitlab/import_export/group/tree_restorer_spec.rb146
-rw-r--r--spec/models/merge_request_spec.rb197
-rw-r--r--spec/models/namespace_spec.rb72
-rw-r--r--spec/models/note_spec.rb3
-rw-r--r--spec/models/onboarding/progress_spec.rb6
-rw-r--r--spec/models/operations/feature_flags/strategy_spec.rb201
-rw-r--r--spec/models/pages_domain_spec.rb20
-rw-r--r--spec/models/project_spec.rb105
-rw-r--r--spec/models/project_team_spec.rb27
-rw-r--r--spec/models/release_spec.rb6
-rw-r--r--spec/models/remote_mirror_spec.rb44
-rw-r--r--spec/requests/api/project_export_spec.rb2
-rw-r--r--spec/requests/import/gitlab_groups_controller_spec.rb2
61 files changed, 1180 insertions, 476 deletions
diff --git a/.gitlab/ci/package-and-test/main.gitlab-ci.yml b/.gitlab/ci/package-and-test/main.gitlab-ci.yml
index 9e93881384c..fcea49e3103 100644
--- a/.gitlab/ci/package-and-test/main.gitlab-ci.yml
+++ b/.gitlab/ci/package-and-test/main.gitlab-ci.yml
@@ -118,9 +118,11 @@ praefect:
extends:
- .parallel
- .qa
+ parallel: 2
variables:
QA_SCENARIO: Test::Integration::Praefect
QA_CAN_TEST_PRAEFECT: "true"
+ KNAPSACK_TEST_FILE_PATTERN: "qa/specs/features/**/3_create/**/*_spec.rb"
rules:
- !reference [.rules:test:qa-parallel, rules]
- if: $QA_SUITES =~ /Test::Instance::All/
@@ -138,9 +140,11 @@ praefect-selective-parallel:
extends:
- .qa
- .parallel
+ parallel: 2
variables:
QA_SCENARIO: Test::Integration::Praefect
QA_CAN_TEST_PRAEFECT: "true"
+ KNAPSACK_TEST_FILE_PATTERN: "qa/specs/features/**/3_create/**/*_spec.rb"
rules:
- !reference [.rules:test:qa-selective-parallel, rules]
- if: $QA_SUITES =~ /Test::Instance::All/
diff --git a/.rubocop_todo/layout/argument_alignment.yml b/.rubocop_todo/layout/argument_alignment.yml
index 81138c2d253..ca7dba5c8db 100644
--- a/.rubocop_todo/layout/argument_alignment.yml
+++ b/.rubocop_todo/layout/argument_alignment.yml
@@ -1143,7 +1143,6 @@ Layout/ArgumentAlignment:
- 'ee/spec/lib/ee/gitlab/scim/provisioning_service_spec.rb'
- 'ee/spec/lib/ee/gitlab/usage/service_ping_report_spec.rb'
- 'ee/spec/lib/ee/gitlab/usage_data_spec.rb'
- - 'ee/spec/lib/elastic/latest/git_class_proxy_spec.rb'
- 'ee/spec/lib/elastic/latest/project_wiki_class_proxy_spec.rb'
- 'ee/spec/lib/gitlab/analytics/cycle_analytics/data_collector_spec.rb'
- 'ee/spec/lib/gitlab/analytics/cycle_analytics/distinct_stage_loader_spec.rb'
@@ -1561,35 +1560,6 @@ Layout/ArgumentAlignment:
- 'lib/tasks/gitlab/seed/runner_fleet.rake'
- 'lib/tasks/gitlab/shell.rake'
- 'lib/tasks/gitlab/uploads/sanitize.rake'
- - 'qa/qa/ce/strategy.rb'
- - 'qa/qa/ee/page/component/secure_report.rb'
- - 'qa/qa/ee/resource/epic.rb'
- - 'qa/qa/ee/resource/group_iteration.rb'
- - 'qa/qa/ee/resource/scan_result_policy_commit.rb'
- - 'qa/qa/ee/resource/vulnerability_item.rb'
- - 'qa/qa/page/base.rb'
- - 'qa/qa/page/project/issue/show.rb'
- - 'qa/qa/page/project/web_ide/edit.rb'
- - 'qa/qa/resource/badge_base.rb'
- - 'qa/qa/resource/bulk_import_group.rb'
- - 'qa/qa/resource/file.rb'
- - 'qa/qa/resource/group_base.rb'
- - 'qa/qa/resource/group_milestone.rb'
- - 'qa/qa/resource/issue.rb'
- - 'qa/qa/resource/job.rb'
- - 'qa/qa/resource/members.rb'
- - 'qa/qa/resource/protected_branch.rb'
- - 'qa/qa/resource/registry_repository.rb'
- - 'qa/qa/resource/repository/commit.rb'
- - 'qa/qa/resource/repository/push.rb'
- - 'qa/qa/resource/user.rb'
- - 'qa/qa/scenario/test/instance/review_blocking.rb'
- - 'qa/qa/scenario/test/instance/review_non_blocking.rb'
- - 'qa/qa/specs/features/browser_ui/1_manage/integrations/jenkins/jenkins_build_status_spec.rb'
- - 'qa/qa/specs/features/browser_ui/1_manage/integrations/jira/jira_basic_integration_spec.rb'
- - 'qa/qa/specs/features/ee/api/1_manage/integrations/group_webhook_events_spec.rb'
- - 'qa/qa/vendor/jira/jira_api.rb'
- - 'qa/spec/support/loglinking_spec.rb'
- 'rubocop/cop/gitlab/finder_with_find_by.rb'
- 'rubocop/cop/qa/ambiguous_page_object_name.rb'
- 'rubocop/cop/rspec/modify_sidekiq_middleware.rb'
@@ -1944,16 +1914,6 @@ Layout/ArgumentAlignment:
- 'spec/lib/security/weak_passwords_spec.rb'
- 'spec/lib/sidebars/projects/menus/repository_menu_spec.rb'
- 'spec/lib/uploaded_file_spec.rb'
- - 'spec/models/merge_request_spec.rb'
- - 'spec/models/namespace_spec.rb'
- - 'spec/models/note_spec.rb'
- - 'spec/models/onboarding/progress_spec.rb'
- - 'spec/models/operations/feature_flags/strategy_spec.rb'
- - 'spec/models/pages_domain_spec.rb'
- - 'spec/models/project_spec.rb'
- - 'spec/models/project_team_spec.rb'
- - 'spec/models/release_spec.rb'
- - 'spec/models/remote_mirror_spec.rb'
- 'spec/requests/admin/applications_controller_spec.rb'
- 'spec/requests/admin/impersonation_tokens_controller_spec.rb'
- 'spec/requests/api/access_requests_spec.rb'
diff --git a/.rubocop_todo/layout/line_length.yml b/.rubocop_todo/layout/line_length.yml
index 53e122ec700..8c283bdf6ce 100644
--- a/.rubocop_todo/layout/line_length.yml
+++ b/.rubocop_todo/layout/line_length.yml
@@ -1288,7 +1288,6 @@ Layout/LineLength:
- 'ee/lib/ee/sidebars/projects/menus/security_compliance_menu.rb'
- 'ee/lib/elastic/latest/config.rb'
- 'ee/lib/elastic/latest/custom_language_analyzers.rb'
- - 'ee/lib/elastic/latest/git_class_proxy.rb'
- 'ee/lib/elastic/latest/git_instance_proxy.rb'
- 'ee/lib/elastic/latest/issue_class_proxy.rb'
- 'ee/lib/elastic/latest/issue_instance_proxy.rb'
diff --git a/.rubocop_todo/lint/redundant_cop_disable_directive.yml b/.rubocop_todo/lint/redundant_cop_disable_directive.yml
index 6274aecec04..29f15deac2e 100644
--- a/.rubocop_todo/lint/redundant_cop_disable_directive.yml
+++ b/.rubocop_todo/lint/redundant_cop_disable_directive.yml
@@ -141,7 +141,6 @@ Lint/RedundantCopDisableDirective:
- 'ee/lib/ee/gitlab/background_migration/migrate_vulnerabilities_feedback_to_vulnerabilities_state_transition.rb'
- 'ee/lib/ee/gitlab/background_migration/purge_stale_security_scans.rb'
- 'ee/lib/ee/gitlab/usage_data.rb'
- - 'ee/lib/elastic/latest/git_class_proxy.rb'
- 'ee/lib/gitlab/analytics/type_of_work/tasks_by_type.rb'
- 'ee/lib/gitlab/elastic/bool_expr.rb'
- 'ee/lib/gitlab/spdx/license.rb'
diff --git a/.rubocop_todo/style/if_unless_modifier.yml b/.rubocop_todo/style/if_unless_modifier.yml
index 9b079a4e3df..2ca9b22f0ad 100644
--- a/.rubocop_todo/style/if_unless_modifier.yml
+++ b/.rubocop_todo/style/if_unless_modifier.yml
@@ -600,7 +600,6 @@ Style/IfUnlessModifier:
- 'ee/lib/ee/sidebars/projects/menus/analytics_menu.rb'
- 'ee/lib/ee/sidebars/projects/menus/security_compliance_menu.rb'
- 'ee/lib/elastic/latest/custom_language_analyzers.rb'
- - 'ee/lib/elastic/latest/git_class_proxy.rb'
- 'ee/lib/elastic/latest/git_instance_proxy.rb'
- 'ee/lib/gitlab/auth/group_saml/session_enforcer.rb'
- 'ee/lib/gitlab/authority_analyzer.rb'
diff --git a/.rubocop_todo/style/percent_literal_delimiters.yml b/.rubocop_todo/style/percent_literal_delimiters.yml
index 35ddf2b04de..2e03bbf4557 100644
--- a/.rubocop_todo/style/percent_literal_delimiters.yml
+++ b/.rubocop_todo/style/percent_literal_delimiters.yml
@@ -244,7 +244,6 @@ Style/PercentLiteralDelimiters:
- 'ee/lib/elastic/class_proxy_util.rb'
- 'ee/lib/elastic/latest/config.rb'
- 'ee/lib/elastic/latest/custom_language_analyzers.rb'
- - 'ee/lib/elastic/latest/git_class_proxy.rb'
- 'ee/lib/elastic/latest/project_instance_proxy.rb'
- 'ee/lib/elastic/latest/snippet_class_proxy.rb'
- 'ee/lib/gitlab/auth/group_saml/auth_hash.rb'
diff --git a/.rubocop_todo/style/string_concatenation.yml b/.rubocop_todo/style/string_concatenation.yml
index 9403b13e1b5..4e3b17fe4c0 100644
--- a/.rubocop_todo/style/string_concatenation.yml
+++ b/.rubocop_todo/style/string_concatenation.yml
@@ -51,7 +51,6 @@ Style/StringConcatenation:
- 'ee/lib/ee/gitlab/background_migration/backfill_project_statistics_container_repository_size.rb'
- 'ee/lib/ee/gitlab/background_migration/populate_latest_pipeline_ids.rb'
- 'ee/lib/ee/gitlab/background_migration/populate_resolved_on_default_branch_column.rb'
- - 'ee/lib/elastic/latest/git_class_proxy.rb'
- 'ee/lib/gitlab/elastic/search_results.rb'
- 'ee/lib/gitlab/geo/git_ssh_proxy.rb'
- 'ee/lib/omni_auth/strategies/kerberos.rb'
diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION
index 5583c38cdf4..e1700b44903 100644
--- a/GITALY_SERVER_VERSION
+++ b/GITALY_SERVER_VERSION
@@ -1 +1 @@
-fa4f0dbedd76758c0b0422da6e54441a5ac80d18
+ceafa16c0204bd3b155299731c8b7da661ce3511
diff --git a/app/controllers/groups/usage_quotas_controller.rb b/app/controllers/groups/usage_quotas_controller.rb
index 125c8fde004..be4e08f6c49 100644
--- a/app/controllers/groups/usage_quotas_controller.rb
+++ b/app/controllers/groups/usage_quotas_controller.rb
@@ -24,7 +24,7 @@ module Groups
render_404 unless group.usage_quotas_enabled?
end
- # To be overriden in ee/app/controllers/ee/groups/usage_quotas_controller.rb
+ # To be overridden in ee/app/controllers/ee/groups/usage_quotas_controller.rb
def seat_count_data; end
end
end
diff --git a/config/feature_flags/development/enable_hamilton_in_usage_quotas_ui.yml b/config/feature_flags/development/enable_hamilton_in_usage_quotas_ui.yml
new file mode 100644
index 00000000000..3d5c3a4e574
--- /dev/null
+++ b/config/feature_flags/development/enable_hamilton_in_usage_quotas_ui.yml
@@ -0,0 +1,8 @@
+---
+name: enable_hamilton_in_usage_quotas_ui
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/123480
+rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/411855
+milestone: '16.1'
+type: development
+group: group::purchase
+default_enabled: false
diff --git a/doc/user/project/repository/code_suggestions.md b/doc/user/project/repository/code_suggestions.md
index 63dee06c042..932e081b091 100644
--- a/doc/user/project/repository/code_suggestions.md
+++ b/doc/user/project/repository/code_suggestions.md
@@ -82,31 +82,15 @@ Prerequisites:
- Code Suggestions must be [enabled for the top-level group](../../group/manage.md#enable-code-suggestions).
- Code Suggestions must be [enabled for your user account](#enable-code-suggestions-for-an-individual-user).
-- If you use a [personal access token](../../profile/personal_access_tokens.md#create-a-personal-access-token),
- the token must have the `read_api` and `read_user` scopes.
+- Completed the [setup instructions](https://gitlab.com/gitlab-org/gitlab-vscode-extension#setup) for the GitLab Visual Studio Code Extension.
To enable Code Suggestions in VS Code:
-1. Download and configure the
+1. Download and install the
[GitLab Workflow extension](https://marketplace.visualstudio.com/items?itemName=GitLab.gitlab-workflow)
for Visual Studio Code.
-1. In **GitLab: Add Account to VS Code on Mac**, add your GitLab work account to the VS Code extension:
- - In macOS, press <kbd>Shift</kbd> + <kbd>Command</kbd> + <kbd>P</kbd>.
- - In Windows, press <kbd>Shift</kbd> + <kbd>Control</kbd> + <kbd>P</kbd>.
-1. You can Authenticate with OAuth to GitLab.com or you can use a personal access token.
-
- 1. To use OAuth (recommended):
-
- 1. Type `GitLab: Authenticate with GitLab.com`. It appears as a quick action. Select it.
- 1. Follow the alert links to open a GitLab authorization URL in your browser.
- 1. In your browser, select the alert to open the URL with VS Code.
-
- 1. To use a personal access token:
-
- 1. Type `GitLab: Add Account to VS Code`. It appears as a quick action. Select it.
- 1. Provide your GitLab instance URL. A default is provided.
- 1. Provide your personal access token.
-1. Regardless of the method you use to authenticate, after your GitLab account connects successfully, in the left sidebar, select **Extensions**.
+1. Complete the [setup instructions](https://gitlab.com/gitlab-org/gitlab-vscode-extension#setup) for the extension.
+1. After your GitLab account connects successfully, in the left sidebar, select **Extensions**.
1. Find the **GitLab workflow** extension, select **Settings** (**{settings}**), and select **Extension Settings**.
1. Enable **GitLab > AI Assisted Code Suggestions**.
diff --git a/lib/gitlab/error_tracking/error_repository/open_api_strategy.rb b/lib/gitlab/error_tracking/error_repository/open_api_strategy.rb
index 09e76ce9196..398ddebd355 100644
--- a/lib/gitlab/error_tracking/error_repository/open_api_strategy.rb
+++ b/lib/gitlab/error_tracking/error_repository/open_api_strategy.rb
@@ -134,7 +134,8 @@ module Gitlab
last_seen: error.last_seen_at,
status: error.status,
count: error.event_count,
- user_count: error.approximated_user_count
+ user_count: error.approximated_user_count,
+ frequency: error.stats&.frequency&.dig(:'24h') || []
)
end
@@ -155,7 +156,8 @@ module Gitlab
external_base_url: external_base_url,
integrated: true,
first_release_version: release_from(oldest_event_for(error.fingerprint)),
- last_release_version: release_from(newest_event_for(error.fingerprint))
+ last_release_version: release_from(newest_event_for(error.fingerprint)),
+ frequency: error.stats&.frequency&.dig(:'24h') || []
)
end
diff --git a/lib/gitlab/import_export/group/import_export.yml b/lib/gitlab/import_export/group/import_export.yml
index e30414265be..c2a1a1f8575 100644
--- a/lib/gitlab/import_export/group/import_export.yml
+++ b/lib/gitlab/import_export/group/import_export.yml
@@ -56,7 +56,6 @@ excluded_attributes:
- :runners_token
- :runners_token_encrypted
- :saml_discovery_token
- - :visibility_level
- :trial_ends_on
- :shared_runners_minute_limit
- :extra_shared_runners_minutes_limit
diff --git a/lib/gitlab/import_export/group/tree_restorer.rb b/lib/gitlab/import_export/group/tree_restorer.rb
index 19d707aaca5..0b92942eb8a 100644
--- a/lib/gitlab/import_export/group/tree_restorer.rb
+++ b/lib/gitlab/import_export/group/tree_restorer.rb
@@ -65,6 +65,15 @@ module Gitlab
# with existing groups name and/or path.
group_attributes.delete_attributes('name', 'path')
+ if @top_level_group.has_parent?
+ group_attributes.attributes['visibility_level'] = sub_group_visibility_level(
+ group_attributes.attributes['visibility_level'],
+ @top_level_group.parent
+ )
+ elsif Gitlab::VisibilityLevel.restricted_level?(group_attributes.attributes['visibility_level'])
+ group_attributes.delete_attribute('visibility_level')
+ end
+
restore_group(@top_level_group, group_attributes)
end
@@ -86,6 +95,7 @@ module Gitlab
parent_id = group_attributes.delete_attribute('parent_id')
name = group_attributes.delete_attribute('name')
path = group_attributes.delete_attribute('path')
+ visibility_level = group_attributes.delete_attribute('visibility_level')
parent_group = @groups_mapping.fetch(parent_id) { raise(ArgumentError, 'Parent group not found') }
@@ -94,7 +104,7 @@ module Gitlab
name: name,
path: path,
parent_id: parent_group.id,
- visibility_level: sub_group_visibility_level(group_attributes.attributes, parent_group)
+ visibility_level: sub_group_visibility_level(visibility_level, parent_group)
).execute
group.validate!
@@ -124,16 +134,23 @@ module Gitlab
end
end
- def sub_group_visibility_level(group_hash, parent_group)
- original_visibility_level = group_hash['visibility_level'] || Gitlab::VisibilityLevel::PRIVATE
+ def sub_group_visibility_level(visibility_level, parent_group)
+ parent_visibility_level = parent_group.visibility_level
- if parent_group && parent_group.visibility_level < original_visibility_level
- Gitlab::VisibilityLevel.closest_allowed_level(parent_group.visibility_level)
+ original_visibility_level = visibility_level ||
+ closest_allowed_level(parent_visibility_level)
+
+ if parent_visibility_level < original_visibility_level
+ closest_allowed_level(parent_visibility_level)
else
- original_visibility_level
+ closest_allowed_level(original_visibility_level)
end
end
+ def closest_allowed_level(visibility_level)
+ Gitlab::VisibilityLevel.closest_allowed_level(visibility_level)
+ end
+
def reader
strong_memoize(:reader) do
Gitlab::ImportExport::Reader.new(
diff --git a/qa/qa/ce/strategy.rb b/qa/qa/ce/strategy.rb
index 0e12649a070..24398e8eace 100644
--- a/qa/qa/ce/strategy.rb
+++ b/qa/qa/ce/strategy.rb
@@ -7,13 +7,17 @@ module QA
def perform_before_hooks
if QA::Runtime::Env.admin_personal_access_token.present?
- QA::Resource::PersonalAccessTokenCache.set_token_for_username(QA::Runtime::User.admin_username,
- QA::Runtime::Env.admin_personal_access_token)
+ QA::Resource::PersonalAccessTokenCache.set_token_for_username(
+ QA::Runtime::User.admin_username,
+ QA::Runtime::Env.admin_personal_access_token
+ )
end
if QA::Runtime::Env.personal_access_token.present? && QA::Runtime::Env.user_username.present?
- QA::Resource::PersonalAccessTokenCache.set_token_for_username(QA::Runtime::Env.user_username,
- QA::Runtime::Env.personal_access_token)
+ QA::Resource::PersonalAccessTokenCache.set_token_for_username(
+ QA::Runtime::Env.user_username,
+ QA::Runtime::Env.personal_access_token
+ )
end
QA::Runtime::Logger.info("Browser: #{QA::Runtime::Env.browser}")
diff --git a/qa/qa/page/project/issue/show.rb b/qa/qa/page/project/issue/show.rb
index 43d32921ee0..c2f334c930a 100644
--- a/qa/qa/page/project/issue/show.rb
+++ b/qa/qa/page/project/issue/show.rb
@@ -83,9 +83,11 @@ module QA
def delete_issue
has_delete_issue_button?
- click_element(:delete_issue_button,
- Page::Modal::DeleteIssue,
- wait: Support::Repeater::DEFAULT_MAX_WAIT_TIME)
+ click_element(
+ :delete_issue_button,
+ Page::Modal::DeleteIssue,
+ wait: Support::Repeater::DEFAULT_MAX_WAIT_TIME
+ )
Page::Modal::DeleteIssue.perform(&:confirm_delete_issue)
diff --git a/qa/qa/page/project/web_ide/edit.rb b/qa/qa/page/project/web_ide/edit.rb
index b786105d4a8..8432edff046 100644
--- a/qa/qa/page/project/web_ide/edit.rb
+++ b/qa/qa/page/project/web_ide/edit.rb
@@ -111,8 +111,12 @@ module QA
# Used for stablility, due to feature_caching of vscode_web_ide
def wait_until_ide_loads
- Support::Waiter.wait_until(sleep_interval: 2, max_duration: 120, reload_page: page,
- retry_on_exception: true) do
+ Support::Waiter.wait_until(
+ sleep_interval: 2,
+ max_duration: 120,
+ reload_page: page,
+ retry_on_exception: true
+ ) do
has_element?(:commit_mode_tab)
end
end
diff --git a/qa/qa/resource/badge_base.rb b/qa/qa/resource/badge_base.rb
index 5bb7eb98d4e..bc0adf0857d 100644
--- a/qa/qa/resource/badge_base.rb
+++ b/qa/qa/resource/badge_base.rb
@@ -3,10 +3,7 @@
module QA
module Resource
class BadgeBase < Base
- attributes :id,
- :name,
- :link_url,
- :image_url
+ attributes :id, :name, :link_url, :image_url
def initialize
@name = "qa-badge-#{SecureRandom.hex(8)}"
diff --git a/qa/qa/resource/bulk_import_group.rb b/qa/qa/resource/bulk_import_group.rb
index 19ad5f1faf2..5196be39a12 100644
--- a/qa/qa/resource/bulk_import_group.rb
+++ b/qa/qa/resource/bulk_import_group.rb
@@ -3,9 +3,7 @@
module QA
module Resource
class BulkImportGroup < Group
- attributes :source_group,
- :destination_group,
- :import_id
+ attributes :source_group, :destination_group, :import_id
attribute :import_access_token do
api_client.personal_access_token
diff --git a/qa/qa/resource/file.rb b/qa/qa/resource/file.rb
index 253b63e4260..7a180bb189d 100644
--- a/qa/qa/resource/file.rb
+++ b/qa/qa/resource/file.rb
@@ -4,11 +4,11 @@ module QA
module Resource
class File < Base
attr_accessor :author_email,
- :author_name,
- :content,
- :commit_message,
- :name,
- :start_branch
+ :author_name,
+ :content,
+ :commit_message,
+ :name,
+ :start_branch
attr_writer :branch
attribute :project do
diff --git a/qa/qa/resource/group_base.rb b/qa/qa/resource/group_base.rb
index 0ba3444e9c7..263c2ca2aeb 100644
--- a/qa/qa/resource/group_base.rb
+++ b/qa/qa/resource/group_base.rb
@@ -12,12 +12,12 @@ module QA
attr_accessor :path, :avatar
attributes :id,
- :runners_token,
- :name,
- :full_path,
- # Add visibility to enable create private group
- :visibility,
- :shared_with_groups
+ :runners_token,
+ :name,
+ :full_path,
+ # Add visibility to enable create private group
+ :visibility,
+ :shared_with_groups
# Get group projects
#
diff --git a/qa/qa/resource/group_milestone.rb b/qa/qa/resource/group_milestone.rb
index c208270658e..b6dd9ee2dbf 100644
--- a/qa/qa/resource/group_milestone.rb
+++ b/qa/qa/resource/group_milestone.rb
@@ -4,13 +4,13 @@ module QA
module Resource
class GroupMilestone < Base
attributes :id,
- :iid,
- :title,
- :description,
- :start_date,
- :due_date,
- :updated_at,
- :created_at
+ :iid,
+ :title,
+ :description,
+ :start_date,
+ :due_date,
+ :updated_at,
+ :created_at
attribute :group do
Group.fabricate_via_api! do |resource|
diff --git a/qa/qa/resource/issue.rb b/qa/qa/resource/issue.rb
index fb957ccf285..a5d5795b0de 100644
--- a/qa/qa/resource/issue.rb
+++ b/qa/qa/resource/issue.rb
@@ -14,11 +14,11 @@ module QA
end
attributes :id,
- :iid,
- :assignee_ids,
- :labels,
- :title,
- :description
+ :iid,
+ :assignee_ids,
+ :labels,
+ :title,
+ :description
def initialize
@assignee_ids = []
diff --git a/qa/qa/resource/job.rb b/qa/qa/resource/job.rb
index 5b0dac9b2df..dc425cc174c 100644
--- a/qa/qa/resource/job.rb
+++ b/qa/qa/resource/job.rb
@@ -5,8 +5,7 @@ module QA
class Job < Base
attr_accessor :id, :name, :project
- attributes :id,
- :project
+ attributes :id, :project
def fabricate_via_api!
resource_web_url(api_get)
diff --git a/qa/qa/resource/protected_branch.rb b/qa/qa/resource/protected_branch.rb
index 879c3a4282c..729171c7cfd 100644
--- a/qa/qa/resource/protected_branch.rb
+++ b/qa/qa/resource/protected_branch.rb
@@ -4,10 +4,10 @@ module QA
module Resource
class ProtectedBranch < Base
attr_accessor :branch_name,
- :allowed_to_push,
- :allowed_to_merge,
- :new_branch,
- :require_code_owner_approval
+ :allowed_to_push,
+ :allowed_to_merge,
+ :new_branch,
+ :require_code_owner_approval
attribute :project do
Project.fabricate_via_api! do |resource|
diff --git a/qa/qa/resource/registry_repository.rb b/qa/qa/resource/registry_repository.rb
index 148af353a25..66ccc92bf4c 100644
--- a/qa/qa/resource/registry_repository.rb
+++ b/qa/qa/resource/registry_repository.rb
@@ -3,8 +3,7 @@
module QA
module Resource
class RegistryRepository < Base
- attr_accessor :name,
- :tag_name
+ attr_accessor :name, :tag_name
attribute :project do
Project.fabricate_via_api! do |resource|
diff --git a/qa/qa/resource/repository/commit.rb b/qa/qa/resource/repository/commit.rb
index 1fe35f7a77d..f84ffa6aac3 100644
--- a/qa/qa/resource/repository/commit.rb
+++ b/qa/qa/resource/repository/commit.rb
@@ -5,12 +5,12 @@ module QA
module Repository
class Commit < Base
attr_accessor :author_email,
- :author_name,
- :branch,
- :commit_message,
- :file_path,
- :sha,
- :start_branch
+ :author_name,
+ :branch,
+ :commit_message,
+ :file_path,
+ :sha,
+ :start_branch
attribute :short_id
diff --git a/qa/qa/resource/repository/push.rb b/qa/qa/resource/repository/push.rb
index 00bed7ed546..93b820e91c8 100644
--- a/qa/qa/resource/repository/push.rb
+++ b/qa/qa/resource/repository/push.rb
@@ -5,8 +5,8 @@ module QA
module Repository
class Push < Base
attr_accessor :file_name, :file_content, :commit_message,
- :branch_name, :new_branch, :output, :repository_http_uri,
- :repository_ssh_uri, :ssh_key, :user, :use_lfs, :tag_name
+ :branch_name, :new_branch, :output, :repository_http_uri,
+ :repository_ssh_uri, :ssh_key, :user, :use_lfs, :tag_name
attr_writer :remote_branch, :gpg_key_id, :merge_request_push_options
diff --git a/qa/qa/resource/user.rb b/qa/qa/resource/user.rb
index 16d0f6ad380..abee46c41ab 100644
--- a/qa/qa/resource/user.rb
+++ b/qa/qa/resource/user.rb
@@ -8,18 +8,18 @@ module QA
attr_reader :unique_id
attr_writer :username, :password
attr_accessor :admin,
- :provider,
- :extern_uid,
- :expect_fabrication_success,
- :hard_delete_on_api_removal,
- :access_level,
- :email_domain
+ :provider,
+ :extern_uid,
+ :expect_fabrication_success,
+ :hard_delete_on_api_removal,
+ :access_level,
+ :email_domain
attributes :id,
- :name,
- :first_name,
- :last_name,
- :email
+ :name,
+ :first_name,
+ :last_name,
+ :email
def initialize
@admin = false
@@ -177,9 +177,10 @@ module QA
def self.all(per_page: 100)
response = nil
Resource::User.init do |user|
- response = user.get(Runtime::API::Request.new(Runtime::API::Client.as_admin,
- '/users',
- per_page: per_page.to_s).url)
+ response = user.get(Runtime::API::Request.new(
+ Runtime::API::Client.as_admin, '/users', per_page: per_page.to_s
+ ).url)
+
raise ResourceQueryError unless response.code == 200
end.parse_body(response)
end
diff --git a/qa/qa/scenario/test/instance/review_blocking.rb b/qa/qa/scenario/test/instance/review_blocking.rb
index cb1b6c9cf10..41e760baf45 100644
--- a/qa/qa/scenario/test/instance/review_blocking.rb
+++ b/qa/qa/scenario/test/instance/review_blocking.rb
@@ -6,9 +6,9 @@ module QA
module Instance
class ReviewBlocking < All
tags :reliable,
- :sanity_feature_flags,
- :"~orchestrated",
- :"~skip_signup_disabled"
+ :sanity_feature_flags,
+ :"~orchestrated",
+ :"~skip_signup_disabled"
end
end
end
diff --git a/qa/qa/scenario/test/instance/review_non_blocking.rb b/qa/qa/scenario/test/instance/review_non_blocking.rb
index e295171eb0b..7c1b27617d7 100644
--- a/qa/qa/scenario/test/instance/review_non_blocking.rb
+++ b/qa/qa/scenario/test/instance/review_non_blocking.rb
@@ -6,9 +6,9 @@ module QA
module Instance
class ReviewNonBlocking < All
tags :"~reliable",
- :"~smoke",
- :"~skip_signup_disabled",
- *Specs::Runner::DEFAULT_SKIPPED_TAGS.map { |tag| :"~#{tag}" }
+ :"~smoke",
+ :"~skip_signup_disabled",
+ *Specs::Runner::DEFAULT_SKIPPED_TAGS.map { |tag| :"~#{tag}" }
end
end
end
diff --git a/qa/qa/specs/features/browser_ui/1_manage/integrations/jenkins/jenkins_build_status_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/integrations/jenkins/jenkins_build_status_spec.rb
index 913317afc70..63c57ad455b 100644
--- a/qa/qa/specs/features/browser_ui/1_manage/integrations/jenkins/jenkins_build_status_spec.rb
+++ b/qa/qa/specs/features/browser_ui/1_manage/integrations/jenkins/jenkins_build_status_spec.rb
@@ -49,7 +49,7 @@ module QA
end
it 'integrates and displays build status for MR pipeline in GitLab',
- testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347788' do
+ testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347788' do
setup_project_integration
jenkins_integration = project.find_integration('jenkins')
diff --git a/qa/qa/specs/features/browser_ui/1_manage/integrations/jira/jira_basic_integration_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/integrations/jira/jira_basic_integration_spec.rb
index f6f4a6b3786..1bd819ad87d 100644
--- a/qa/qa/specs/features/browser_ui/1_manage/integrations/jira/jira_basic_integration_spec.rb
+++ b/qa/qa/specs/features/browser_ui/1_manage/integrations/jira/jira_basic_integration_spec.rb
@@ -38,7 +38,7 @@ module QA
end
it 'closes an issue via pushing a commit',
- testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347794' do
+ testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347794' do
issue_key = Vendor::Jira::JiraAPI.perform do |jira_api|
jira_api.create_issue(jira_project_key)
end
@@ -49,7 +49,7 @@ module QA
end
it 'closes an issue via a merge request',
- testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347795' do
+ testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347795' do
issue_key = Vendor::Jira::JiraAPI.perform do |jira_api|
jira_api.create_issue(jira_project_key)
end
diff --git a/qa/qa/vendor/jira/jira_api.rb b/qa/qa/vendor/jira/jira_api.rb
index 15039ac244e..4248ee589b5 100644
--- a/qa/qa/vendor/jira/jira_api.rb
+++ b/qa/qa/vendor/jira/jira_api.rb
@@ -21,9 +21,11 @@ module QA
end
def fetch_issue(issue_key)
- response = get("#{api_url}/issue/#{issue_key}",
- user: Runtime::Env.jira_admin_username,
- password: Runtime::Env.jira_admin_password)
+ response = get(
+ "#{api_url}/issue/#{issue_key}",
+ user: Runtime::Env.jira_admin_username,
+ password: Runtime::Env.jira_admin_password
+ )
parse_body(response)
end
diff --git a/qa/spec/support/loglinking_spec.rb b/qa/spec/support/loglinking_spec.rb
index 79004630253..2bea528028f 100644
--- a/qa/spec/support/loglinking_spec.rb
+++ b/qa/spec/support/loglinking_spec.rb
@@ -26,8 +26,11 @@ RSpec.describe QA::Support::Loglinking do
context 'and both Sentry and Kibana exist for the logging environment' do
let(:sentry) { instance_double(QA::Support::SystemLogs::Sentry, url: sentry_url) }
let(:kibana) do
- instance_double(QA::Support::SystemLogs::Kibana,
- discover_url: discover_url, dashboard_url: dashboard_url)
+ instance_double(
+ QA::Support::SystemLogs::Kibana,
+ discover_url: discover_url,
+ dashboard_url: dashboard_url
+ )
end
it 'returns both Sentry and Kibana URLs' do
@@ -43,8 +46,11 @@ RSpec.describe QA::Support::Loglinking do
context 'and only Sentry exists for the logging environment' do
let(:sentry) { instance_double(QA::Support::SystemLogs::Sentry, url: sentry_url) }
let(:kibana) do
- instance_double(QA::Support::SystemLogs::Kibana,
- discover_url: nil, dashboard_url: nil)
+ instance_double(
+ QA::Support::SystemLogs::Kibana,
+ discover_url: nil,
+ dashboard_url: nil
+ )
end
it 'returns only Sentry URL' do
@@ -58,8 +64,11 @@ RSpec.describe QA::Support::Loglinking do
context 'and only Kibana exists for the logging environment' do
let(:sentry) { instance_double(QA::Support::SystemLogs::Sentry, url: nil) }
let(:kibana) do
- instance_double(QA::Support::SystemLogs::Kibana,
- discover_url: discover_url, dashboard_url: dashboard_url)
+ instance_double(
+ QA::Support::SystemLogs::Kibana,
+ discover_url: discover_url,
+ dashboard_url: dashboard_url
+ )
end
it 'returns only Kibana Discover and Dashboard URLs' do
diff --git a/spec/factories/error_tracking/open_api.rb b/spec/factories/error_tracking/open_api.rb
index ad134701fd0..db39ef5feb1 100644
--- a/spec/factories/error_tracking/open_api.rb
+++ b/spec/factories/error_tracking/open_api.rb
@@ -12,6 +12,15 @@ FactoryBot.define do
first_seen_at { Time.now.iso8601 }
last_seen_at { Time.now.iso8601 }
status { 'unresolved' }
+ stats do
+ association(:error_tracking_open_api_error_stats)
+ end
+
+ skip_create
+ end
+
+ factory :error_tracking_open_api_error_stats, class: 'ErrorTrackingOpenAPI::ErrorStats' do
+ frequency { { '24h': [[1, 2], [3, 4]] } }
skip_create
end
diff --git a/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/1689.json b/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/1689.json
new file mode 100644
index 00000000000..4c0a29599b9
--- /dev/null
+++ b/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/1689.json
@@ -0,0 +1,48 @@
+{
+ "depth": 1,
+ "tree_path": [
+ 1689
+ ],
+ "tree_cycle": false,
+ "id": 1689,
+ "name": "public-group-3",
+ "path": "public-group-3",
+ "description": "",
+ "avatar": {
+ "url": null
+ },
+ "membership_lock": false,
+ "share_with_group_lock": false,
+ "visibility_level": 20,
+ "request_access_enabled": true,
+ "ldap_sync_status": "ready",
+ "ldap_sync_error": null,
+ "ldap_sync_last_update_at": null,
+ "ldap_sync_last_successful_update_at": null,
+ "ldap_sync_last_sync_at": null,
+ "lfs_enabled": null,
+ "parent_id": null,
+ "shared_runners_minutes_limit": null,
+ "require_two_factor_authentication": false,
+ "two_factor_grace_period": 48,
+ "project_creation_level": 2,
+ "file_template_project_id": null,
+ "custom_project_templates_group_id": null,
+ "auto_devops_enabled": null,
+ "last_ci_minutes_notification_at": null,
+ "last_ci_minutes_usage_notification_level": null,
+ "subgroup_creation_level": 1,
+ "emails_disabled": null,
+ "max_artifacts_size": null,
+ "mentions_disabled": null,
+ "default_branch_protection": 2,
+ "unlock_membership_to_ldap": null,
+ "max_personal_access_token_lifetime": null,
+ "push_rule_id": null,
+ "shared_runners_enabled": true,
+ "allow_descendants_override_disabled_shared_runners": false,
+ "traversal_ids": [
+ 1689
+ ],
+ "organization_id": 1
+}
diff --git a/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/1690.json b/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/1690.json
new file mode 100644
index 00000000000..f01c79b06d8
--- /dev/null
+++ b/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/1690.json
@@ -0,0 +1,50 @@
+{
+ "depth": 2,
+ "tree_path": [
+ 1689,
+ 1690
+ ],
+ "tree_cycle": false,
+ "id": 1690,
+ "name": "private-subgroup",
+ "path": "private-subgroup",
+ "description": "",
+ "avatar": {
+ "url": null
+ },
+ "membership_lock": false,
+ "share_with_group_lock": false,
+ "visibility_level": 0,
+ "request_access_enabled": true,
+ "ldap_sync_status": "ready",
+ "ldap_sync_error": null,
+ "ldap_sync_last_update_at": null,
+ "ldap_sync_last_successful_update_at": null,
+ "ldap_sync_last_sync_at": null,
+ "lfs_enabled": null,
+ "parent_id": 1689,
+ "shared_runners_minutes_limit": null,
+ "require_two_factor_authentication": false,
+ "two_factor_grace_period": 48,
+ "project_creation_level": 2,
+ "file_template_project_id": null,
+ "custom_project_templates_group_id": null,
+ "auto_devops_enabled": null,
+ "last_ci_minutes_notification_at": null,
+ "last_ci_minutes_usage_notification_level": null,
+ "subgroup_creation_level": 1,
+ "emails_disabled": null,
+ "max_artifacts_size": null,
+ "mentions_disabled": null,
+ "default_branch_protection": 2,
+ "unlock_membership_to_ldap": null,
+ "max_personal_access_token_lifetime": null,
+ "push_rule_id": null,
+ "shared_runners_enabled": true,
+ "allow_descendants_override_disabled_shared_runners": false,
+ "traversal_ids": [
+ 1689,
+ 1690
+ ],
+ "organization_id": 1
+}
diff --git a/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/1691.json b/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/1691.json
new file mode 100644
index 00000000000..f9c08b420c0
--- /dev/null
+++ b/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/1691.json
@@ -0,0 +1,50 @@
+{
+ "depth": 2,
+ "tree_path": [
+ 1689,
+ 1691
+ ],
+ "tree_cycle": false,
+ "id": 1691,
+ "name": "internal-subgroup",
+ "path": "internal-subgroup",
+ "description": "",
+ "avatar": {
+ "url": null
+ },
+ "membership_lock": false,
+ "share_with_group_lock": false,
+ "visibility_level": 10,
+ "request_access_enabled": true,
+ "ldap_sync_status": "ready",
+ "ldap_sync_error": null,
+ "ldap_sync_last_update_at": null,
+ "ldap_sync_last_successful_update_at": null,
+ "ldap_sync_last_sync_at": null,
+ "lfs_enabled": null,
+ "parent_id": 1689,
+ "shared_runners_minutes_limit": null,
+ "require_two_factor_authentication": false,
+ "two_factor_grace_period": 48,
+ "project_creation_level": 2,
+ "file_template_project_id": null,
+ "custom_project_templates_group_id": null,
+ "auto_devops_enabled": null,
+ "last_ci_minutes_notification_at": null,
+ "last_ci_minutes_usage_notification_level": null,
+ "subgroup_creation_level": 1,
+ "emails_disabled": null,
+ "max_artifacts_size": null,
+ "mentions_disabled": null,
+ "default_branch_protection": 2,
+ "unlock_membership_to_ldap": null,
+ "max_personal_access_token_lifetime": null,
+ "push_rule_id": null,
+ "shared_runners_enabled": true,
+ "allow_descendants_override_disabled_shared_runners": false,
+ "traversal_ids": [
+ 1689,
+ 1691
+ ],
+ "organization_id": 1
+}
diff --git a/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/1692.json b/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/1692.json
new file mode 100644
index 00000000000..381230e86a8
--- /dev/null
+++ b/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/1692.json
@@ -0,0 +1,50 @@
+{
+ "depth": 2,
+ "tree_path": [
+ 1689,
+ 1692
+ ],
+ "tree_cycle": false,
+ "id": 1692,
+ "name": "public-subgroup",
+ "path": "public-subgroup",
+ "description": "",
+ "avatar": {
+ "url": null
+ },
+ "membership_lock": false,
+ "share_with_group_lock": false,
+ "visibility_level": 20,
+ "request_access_enabled": true,
+ "ldap_sync_status": "ready",
+ "ldap_sync_error": null,
+ "ldap_sync_last_update_at": null,
+ "ldap_sync_last_successful_update_at": null,
+ "ldap_sync_last_sync_at": null,
+ "lfs_enabled": null,
+ "parent_id": 1689,
+ "shared_runners_minutes_limit": null,
+ "require_two_factor_authentication": false,
+ "two_factor_grace_period": 48,
+ "project_creation_level": 2,
+ "file_template_project_id": null,
+ "custom_project_templates_group_id": null,
+ "auto_devops_enabled": null,
+ "last_ci_minutes_notification_at": null,
+ "last_ci_minutes_usage_notification_level": null,
+ "subgroup_creation_level": 1,
+ "emails_disabled": null,
+ "max_artifacts_size": null,
+ "mentions_disabled": null,
+ "default_branch_protection": 2,
+ "unlock_membership_to_ldap": null,
+ "max_personal_access_token_lifetime": null,
+ "push_rule_id": null,
+ "shared_runners_enabled": true,
+ "allow_descendants_override_disabled_shared_runners": false,
+ "traversal_ids": [
+ 1689,
+ 1692
+ ],
+ "organization_id": 1
+}
diff --git a/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/2106.json b/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/2106.json
new file mode 100644
index 00000000000..1707e341129
--- /dev/null
+++ b/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/2106.json
@@ -0,0 +1,52 @@
+{
+ "depth": 3,
+ "tree_path": [
+ 1689,
+ 1691,
+ 2106
+ ],
+ "tree_cycle": false,
+ "id": 2106,
+ "name": "internal-sub-subgroup",
+ "path": "internal-sub-subgroup",
+ "description": "",
+ "avatar": {
+ "url": null
+ },
+ "membership_lock": false,
+ "share_with_group_lock": false,
+ "visibility_level": 10,
+ "request_access_enabled": true,
+ "ldap_sync_status": "ready",
+ "ldap_sync_error": null,
+ "ldap_sync_last_update_at": null,
+ "ldap_sync_last_successful_update_at": null,
+ "ldap_sync_last_sync_at": null,
+ "lfs_enabled": null,
+ "parent_id": 1691,
+ "shared_runners_minutes_limit": null,
+ "require_two_factor_authentication": false,
+ "two_factor_grace_period": 48,
+ "project_creation_level": 2,
+ "file_template_project_id": null,
+ "custom_project_templates_group_id": null,
+ "auto_devops_enabled": null,
+ "last_ci_minutes_notification_at": null,
+ "last_ci_minutes_usage_notification_level": null,
+ "subgroup_creation_level": 1,
+ "emails_disabled": null,
+ "max_artifacts_size": null,
+ "mentions_disabled": null,
+ "default_branch_protection": 2,
+ "unlock_membership_to_ldap": null,
+ "max_personal_access_token_lifetime": null,
+ "push_rule_id": null,
+ "shared_runners_enabled": true,
+ "allow_descendants_override_disabled_shared_runners": false,
+ "traversal_ids": [
+ 1689,
+ 1691,
+ 2106
+ ],
+ "organization_id": 1
+}
diff --git a/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/2107.json b/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/2107.json
new file mode 100644
index 00000000000..cac1c826821
--- /dev/null
+++ b/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/2107.json
@@ -0,0 +1,52 @@
+{
+ "depth": 3,
+ "tree_path": [
+ 1689,
+ 1692,
+ 2107
+ ],
+ "tree_cycle": false,
+ "id": 2107,
+ "name": "internal-sub-subgroup",
+ "path": "internal-sub-subgroup",
+ "description": "",
+ "avatar": {
+ "url": null
+ },
+ "membership_lock": false,
+ "share_with_group_lock": false,
+ "visibility_level": 10,
+ "request_access_enabled": true,
+ "ldap_sync_status": "ready",
+ "ldap_sync_error": null,
+ "ldap_sync_last_update_at": null,
+ "ldap_sync_last_successful_update_at": null,
+ "ldap_sync_last_sync_at": null,
+ "lfs_enabled": null,
+ "parent_id": 1692,
+ "shared_runners_minutes_limit": null,
+ "require_two_factor_authentication": false,
+ "two_factor_grace_period": 48,
+ "project_creation_level": 2,
+ "file_template_project_id": null,
+ "custom_project_templates_group_id": null,
+ "auto_devops_enabled": null,
+ "last_ci_minutes_notification_at": null,
+ "last_ci_minutes_usage_notification_level": null,
+ "subgroup_creation_level": 1,
+ "emails_disabled": null,
+ "max_artifacts_size": null,
+ "mentions_disabled": null,
+ "default_branch_protection": 2,
+ "unlock_membership_to_ldap": null,
+ "max_personal_access_token_lifetime": null,
+ "push_rule_id": null,
+ "shared_runners_enabled": true,
+ "allow_descendants_override_disabled_shared_runners": false,
+ "traversal_ids": [
+ 1689,
+ 1692,
+ 2107
+ ],
+ "organization_id": 1
+}
diff --git a/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/2108.json b/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/2108.json
new file mode 100644
index 00000000000..d464b41e908
--- /dev/null
+++ b/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/2108.json
@@ -0,0 +1,52 @@
+{
+ "depth": 3,
+ "tree_path": [
+ 1689,
+ 1692,
+ 2108
+ ],
+ "tree_cycle": false,
+ "id": 2108,
+ "name": "public-sub-subgroup",
+ "path": "public-sub-subgroup",
+ "description": "",
+ "avatar": {
+ "url": null
+ },
+ "membership_lock": false,
+ "share_with_group_lock": false,
+ "visibility_level": 20,
+ "request_access_enabled": true,
+ "ldap_sync_status": "ready",
+ "ldap_sync_error": null,
+ "ldap_sync_last_update_at": null,
+ "ldap_sync_last_successful_update_at": null,
+ "ldap_sync_last_sync_at": null,
+ "lfs_enabled": null,
+ "parent_id": 1692,
+ "shared_runners_minutes_limit": null,
+ "require_two_factor_authentication": false,
+ "two_factor_grace_period": 48,
+ "project_creation_level": 2,
+ "file_template_project_id": null,
+ "custom_project_templates_group_id": null,
+ "auto_devops_enabled": null,
+ "last_ci_minutes_notification_at": null,
+ "last_ci_minutes_usage_notification_level": null,
+ "subgroup_creation_level": 1,
+ "emails_disabled": null,
+ "max_artifacts_size": null,
+ "mentions_disabled": null,
+ "default_branch_protection": 2,
+ "unlock_membership_to_ldap": null,
+ "max_personal_access_token_lifetime": null,
+ "push_rule_id": null,
+ "shared_runners_enabled": true,
+ "allow_descendants_override_disabled_shared_runners": false,
+ "traversal_ids": [
+ 1689,
+ 1692,
+ 2108
+ ],
+ "organization_id": 1
+}
diff --git a/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/2109.json b/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/2109.json
new file mode 100644
index 00000000000..7f3adf364d7
--- /dev/null
+++ b/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/2109.json
@@ -0,0 +1,52 @@
+{
+ "depth": 3,
+ "tree_path": [
+ 1689,
+ 1692,
+ 2109
+ ],
+ "tree_cycle": false,
+ "id": 2109,
+ "name": "private-sub-subgroup",
+ "path": "private-sub-subgroup",
+ "description": "",
+ "avatar": {
+ "url": null
+ },
+ "membership_lock": false,
+ "share_with_group_lock": false,
+ "visibility_level": 0,
+ "request_access_enabled": true,
+ "ldap_sync_status": "ready",
+ "ldap_sync_error": null,
+ "ldap_sync_last_update_at": null,
+ "ldap_sync_last_successful_update_at": null,
+ "ldap_sync_last_sync_at": null,
+ "lfs_enabled": null,
+ "parent_id": 1692,
+ "shared_runners_minutes_limit": null,
+ "require_two_factor_authentication": false,
+ "two_factor_grace_period": 48,
+ "project_creation_level": 2,
+ "file_template_project_id": null,
+ "custom_project_templates_group_id": null,
+ "auto_devops_enabled": null,
+ "last_ci_minutes_notification_at": null,
+ "last_ci_minutes_usage_notification_level": null,
+ "subgroup_creation_level": 1,
+ "emails_disabled": null,
+ "max_artifacts_size": null,
+ "mentions_disabled": null,
+ "default_branch_protection": 2,
+ "unlock_membership_to_ldap": null,
+ "max_personal_access_token_lifetime": null,
+ "push_rule_id": null,
+ "shared_runners_enabled": true,
+ "allow_descendants_override_disabled_shared_runners": false,
+ "traversal_ids": [
+ 1689,
+ 1692,
+ 2109
+ ],
+ "organization_id": 1
+}
diff --git a/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/2110.json b/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/2110.json
new file mode 100644
index 00000000000..744b8d36b16
--- /dev/null
+++ b/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/2110.json
@@ -0,0 +1,52 @@
+{
+ "depth": 3,
+ "tree_path": [
+ 1689,
+ 1690,
+ 2110
+ ],
+ "tree_cycle": false,
+ "id": 2110,
+ "name": "private-sub-subgroup",
+ "path": "private-sub-subgroup",
+ "description": "",
+ "avatar": {
+ "url": null
+ },
+ "membership_lock": false,
+ "share_with_group_lock": false,
+ "visibility_level": 0,
+ "request_access_enabled": true,
+ "ldap_sync_status": "ready",
+ "ldap_sync_error": null,
+ "ldap_sync_last_update_at": null,
+ "ldap_sync_last_successful_update_at": null,
+ "ldap_sync_last_sync_at": null,
+ "lfs_enabled": null,
+ "parent_id": 1690,
+ "shared_runners_minutes_limit": null,
+ "require_two_factor_authentication": false,
+ "two_factor_grace_period": 48,
+ "project_creation_level": 2,
+ "file_template_project_id": null,
+ "custom_project_templates_group_id": null,
+ "auto_devops_enabled": null,
+ "last_ci_minutes_notification_at": null,
+ "last_ci_minutes_usage_notification_level": null,
+ "subgroup_creation_level": 1,
+ "emails_disabled": null,
+ "max_artifacts_size": null,
+ "mentions_disabled": null,
+ "default_branch_protection": 2,
+ "unlock_membership_to_ldap": null,
+ "max_personal_access_token_lifetime": null,
+ "push_rule_id": null,
+ "shared_runners_enabled": true,
+ "allow_descendants_override_disabled_shared_runners": false,
+ "traversal_ids": [
+ 1689,
+ 1690,
+ 2110
+ ],
+ "organization_id": 1
+}
diff --git a/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/_all.ndjson b/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/_all.ndjson
new file mode 100644
index 00000000000..6c0425eabf4
--- /dev/null
+++ b/spec/fixtures/lib/gitlab/import_export/group_exports/visibility_levels/nested_subgroups/tree/groups/_all.ndjson
@@ -0,0 +1,9 @@
+1689
+1690
+1691
+1692
+2110
+2106
+2107
+2108
+2109
diff --git a/spec/frontend/vue_shared/new_namespace/new_namespace_page_spec.js b/spec/frontend/vue_shared/new_namespace/new_namespace_page_spec.js
index 1ee6f2cfff3..abc69da7a58 100644
--- a/spec/frontend/vue_shared/new_namespace/new_namespace_page_spec.js
+++ b/spec/frontend/vue_shared/new_namespace/new_namespace_page_spec.js
@@ -35,9 +35,6 @@ describe('Experimental new namespace creation app', () => {
...DEFAULT_PROPS,
...propsData,
},
- stubs: {
- NewTopLevelGroupAlert,
- },
});
};
diff --git a/spec/lib/gitlab/error_tracking/error_repository/open_api_strategy_spec.rb b/spec/lib/gitlab/error_tracking/error_repository/open_api_strategy_spec.rb
index 3a5df997f7c..c25cba704b3 100644
--- a/spec/lib/gitlab/error_tracking/error_repository/open_api_strategy_spec.rb
+++ b/spec/lib/gitlab/error_tracking/error_repository/open_api_strategy_spec.rb
@@ -97,10 +97,43 @@ RSpec.describe Gitlab::ErrorTracking::ErrorRepository::OpenApiStrategy do
tags: { level: nil, logger: nil },
external_url: "http://localhost/#{project.full_path}/-/error_tracking/#{error.fingerprint}/details",
external_base_url: "http://localhost/#{project.full_path}",
- integrated: true
+ integrated: true,
+ frequency: [[1, 2], [3, 4]]
)
end
+ context 'with missing stats' do
+ let(:error) { build(:error_tracking_open_api_error, project_id: project.id, stats: nil) }
+
+ it 'returns empty frequency' do
+ is_expected.to have_attributes(
+ frequency: []
+ )
+ end
+ end
+
+ context 'with missing frequency' do
+ let(:empty_freq) { build(:error_tracking_open_api_error_stats, { frequency: nil }) }
+ let(:error) { build(:error_tracking_open_api_error, project_id: project.id, stats: empty_freq) }
+
+ it 'returns empty frequency' do
+ is_expected.to have_attributes(
+ frequency: []
+ )
+ end
+ end
+
+ context 'with missing frequency data' do
+ let(:empty_freq) { build(:error_tracking_open_api_error_stats, { frequency: {} }) }
+ let(:error) { build(:error_tracking_open_api_error, project_id: project.id, stats: empty_freq) }
+
+ it 'returns empty frequency' do
+ is_expected.to have_attributes(
+ frequency: []
+ )
+ end
+ end
+
it 'returns no first and last release version' do
is_expected.to have_attributes(
first_release_version: nil,
@@ -194,7 +227,8 @@ RSpec.describe Gitlab::ErrorTracking::ErrorRepository::OpenApiStrategy do
last_seen: error.last_seen_at,
status: error.status,
count: error.event_count,
- user_count: error.approximated_user_count
+ user_count: error.approximated_user_count,
+ frequency: [[1, 2], [3, 4]]
))
end
diff --git a/spec/lib/gitlab/import_export/group/tree_restorer_spec.rb b/spec/lib/gitlab/import_export/group/tree_restorer_spec.rb
index a6afd0a36ec..9766d5d6d59 100644
--- a/spec/lib/gitlab/import_export/group/tree_restorer_spec.rb
+++ b/spec/lib/gitlab/import_export/group/tree_restorer_spec.rb
@@ -177,30 +177,146 @@ RSpec.describe Gitlab::ImportExport::Group::TreeRestorer, feature: :subgroups, f
end
context 'group visibility levels' do
- let(:user) { create(:user) }
- let(:shared) { Gitlab::ImportExport::Shared.new(group) }
- let(:group_tree_restorer) { described_class.new(user: user, shared: shared, group: group) }
+ context 'when the @top_level_group is the destination_group' do
+ let(:user) { create(:user) }
+ let(:shared) { Gitlab::ImportExport::Shared.new(group) }
+ let(:group_tree_restorer) { described_class.new(user: user, shared: shared, group: group) }
+
+ shared_examples 'with visibility level' do |visibility_level, expected_visibilities|
+ context "when visibility level is #{visibility_level}" do
+ let(:group) { create(:group, visibility_level) }
+ let(:filepath) { "group_exports/visibility_levels/#{visibility_level}" }
+
+ before do
+ setup_import_export_config(filepath)
+ group_tree_restorer.restore
+ end
- before do
- setup_import_export_config(filepath)
+ it "imports all subgroups as #{visibility_level}" do
+ expect(group.children.map(&:visibility_level)).to match_array(expected_visibilities)
+ end
+ end
+ end
- group_tree_restorer.restore
+ include_examples 'with visibility level', :public, [20, 10, 0]
+ include_examples 'with visibility level', :private, [0, 0, 0]
+ include_examples 'with visibility level', :internal, [10, 10, 0]
end
- shared_examples 'with visibility level' do |visibility_level, expected_visibilities|
- context "when visibility level is #{visibility_level}" do
- let(:group) { create(:group, visibility_level) }
- let(:filepath) { "group_exports/visibility_levels/#{visibility_level}" }
+ context 'when the destination_group is the @top_level_group.parent' do
+ let(:user) { create(:user) }
+ let(:shared) { Gitlab::ImportExport::Shared.new(group) }
+ let(:group_tree_restorer) { described_class.new(user: user, shared: shared, group: group) }
+
+ shared_examples 'with visibility level' do |visibility_level, expected_visibilities, group_visibility|
+ context "when source level is #{visibility_level}" do
+ let(:parent) { create(:group, visibility_level) }
+ let(:group) { create(:group, visibility_level, parent: parent) }
+ let(:filepath) { "group_exports/visibility_levels/#{visibility_level}" }
+
+ before do
+ setup_import_export_config(filepath)
+ parent.add_maintainer(user)
+ group_tree_restorer.restore
+ end
- it "imports all subgroups as #{visibility_level}" do
- expect(group.children.map(&:visibility_level)).to match_array(expected_visibilities)
+ it "imports all subgroups as #{visibility_level}" do
+ expect(group.visibility_level).to eq(group_visibility)
+ expect(group.children.map(&:visibility_level)).to match_array(expected_visibilities)
+ end
end
end
+
+ include_examples 'with visibility level', :public, [20, 10, 0], 20
+ include_examples 'with visibility level', :private, [0, 0, 0], 0
+ include_examples 'with visibility level', :internal, [10, 10, 0], 10
+ end
+
+ context 'when the visibility level is restricted' do
+ let(:user) { create(:user) }
+ let(:shared) { Gitlab::ImportExport::Shared.new(group) }
+ let(:group_tree_restorer) { described_class.new(user: user, shared: shared, group: group) }
+ let(:group) { create(:group, :internal) }
+ let(:filepath) { "group_exports/visibility_levels/internal" }
+
+ before do
+ setup_import_export_config(filepath)
+ Gitlab::CurrentSettings.restricted_visibility_levels = [10]
+ group_tree_restorer.restore
+ end
+
+ after do
+ Gitlab::CurrentSettings.restricted_visibility_levels = []
+ end
+
+ it 'updates the visibility_level' do
+ expect(group.children.map(&:visibility_level)).to match_array([0, 0, 0])
+ end
end
+ end
+
+ context 'when there are nested subgroups' do
+ let(:filepath) { "group_exports/visibility_levels/nested_subgroups" }
- include_examples 'with visibility level', :public, [20, 10, 0]
- include_examples 'with visibility level', :private, [0, 0, 0]
- include_examples 'with visibility level', :internal, [10, 10, 0]
+ context "when destination level is :public" do
+ let(:user) { create(:user) }
+ let(:shared) { Gitlab::ImportExport::Shared.new(group) }
+ let(:group_tree_restorer) { described_class.new(user: user, shared: shared, group: group) }
+ let(:parent) { create(:group, :public) }
+ let(:group) { create(:group, :public, parent: parent) }
+
+ before do
+ setup_import_export_config(filepath)
+ parent.add_maintainer(user)
+ group_tree_restorer.restore
+ end
+
+ it "imports all subgroups with original visibility_level" do
+ expect(group.visibility_level).to eq(Gitlab::VisibilityLevel::PUBLIC)
+ expect(group.descendants.map(&:visibility_level))
+ .to match_array([0, 0, 0, 10, 10, 10, 20, 20])
+ end
+ end
+
+ context "when destination level is :internal" do
+ let(:user) { create(:user) }
+ let(:shared) { Gitlab::ImportExport::Shared.new(group) }
+ let(:group_tree_restorer) { described_class.new(user: user, shared: shared, group: group) }
+ let(:parent) { create(:group, :internal) }
+ let(:group) { create(:group, :internal, parent: parent) }
+
+ before do
+ setup_import_export_config(filepath)
+ parent.add_maintainer(user)
+ group_tree_restorer.restore
+ end
+
+ it "imports non-public subgroups with original level and public subgroups as internal" do
+ expect(group.visibility_level).to eq(Gitlab::VisibilityLevel::INTERNAL)
+ expect(group.descendants.map(&:visibility_level))
+ .to match_array([0, 0, 0, 10, 10, 10, 10, 10])
+ end
+ end
+
+ context "when destination level is :private" do
+ let(:user) { create(:user) }
+ let(:shared) { Gitlab::ImportExport::Shared.new(group) }
+ let(:group_tree_restorer) { described_class.new(user: user, shared: shared, group: group) }
+ let(:parent) { create(:group, :private) }
+ let(:group) { create(:group, :private, parent: parent) }
+
+ before do
+ setup_import_export_config(filepath)
+ parent.add_maintainer(user)
+ group_tree_restorer.restore
+ end
+
+ it "imports all subgroups as private" do
+ expect(group.visibility_level).to eq(Gitlab::VisibilityLevel::PRIVATE)
+ expect(group.descendants.map(&:visibility_level))
+ .to match_array([0, 0, 0, 0, 0, 0, 0, 0])
+ end
+ end
end
end
diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb
index 2a35efed8e0..e16f7a94eb7 100644
--- a/spec/models/merge_request_spec.rb
+++ b/spec/models/merge_request_spec.rb
@@ -1041,10 +1041,12 @@ RSpec.describe MergeRequest, factory_default: :keep, feature_category: :code_rev
let(:tag_name) { subject.source_branch }
it 'returns the sha of the source branch last commit' do
- subject.source_project.repository.add_tag(subject.author,
- tag_name,
- subject.target_branch_sha,
- 'Add a tag')
+ subject.source_project.repository.add_tag(
+ subject.author,
+ tag_name,
+ subject.target_branch_sha,
+ 'Add a tag'
+ )
expect(subject.source_branch_sha).to eq(last_branch_commit.sha)
@@ -1392,8 +1394,7 @@ RSpec.describe MergeRequest, factory_default: :keep, feature_category: :code_rev
before do
allow(merge_request).to receive(:commits) { [merge_request.source_project.repository.commit] }
- create(:note_on_commit, commit_id: merge_request.commits.first.id,
- project: merge_request.project)
+ create(:note_on_commit, commit_id: merge_request.commits.first.id, project: merge_request.project)
create(:note, noteable: merge_request, project: merge_request.project)
end
@@ -1403,16 +1404,19 @@ RSpec.describe MergeRequest, factory_default: :keep, feature_category: :code_rev
end
it "includes notes for commits from target project as well" do
- create(:note_on_commit, commit_id: merge_request.commits.first.id,
- project: merge_request.target_project)
+ create(:note_on_commit, commit_id: merge_request.commits.first.id, project: merge_request.target_project)
expect(merge_request.commits).not_to be_empty
expect(merge_request.related_notes.count).to eq(3)
end
it "excludes system notes for commits" do
- system_note = create(:note_on_commit, :system, commit_id: merge_request.commits.first.id,
- project: merge_request.project)
+ system_note = create(
+ :note_on_commit,
+ :system,
+ commit_id: merge_request.commits.first.id,
+ project: merge_request.project
+ )
expect(merge_request.related_notes.count).to eq(2)
expect(merge_request.related_notes).not_to include(system_note)
@@ -2168,10 +2172,12 @@ RSpec.describe MergeRequest, factory_default: :keep, feature_category: :code_rev
context 'when there is a pipeline with the diff head sha' do
let!(:pipeline) do
- create(:ci_empty_pipeline,
- project: merge_request.project,
- sha: merge_request.diff_head_sha,
- ref: merge_request.source_branch)
+ create(
+ :ci_empty_pipeline,
+ project: merge_request.project,
+ sha: merge_request.diff_head_sha,
+ ref: merge_request.source_branch
+ )
end
it 'updates the head pipeline' do
@@ -2200,12 +2206,14 @@ RSpec.describe MergeRequest, factory_default: :keep, feature_category: :code_rev
context 'when detached merge request pipeline is run on head ref of the merge request' do
let!(:pipeline) do
- create(:ci_pipeline,
- source: :merge_request_event,
- project: merge_request.source_project,
- ref: merge_request.ref_path,
- sha: sha,
- merge_request: merge_request)
+ create(
+ :ci_pipeline,
+ source: :merge_request_event,
+ project: merge_request.source_project,
+ ref: merge_request.ref_path,
+ sha: sha,
+ merge_request: merge_request
+ )
end
let(:sha) { merge_request.diff_head_sha }
@@ -2565,11 +2573,13 @@ RSpec.describe MergeRequest, factory_default: :keep, feature_category: :code_rev
let(:merge_request) { create(:merge_request, source_project: project) }
let!(:base_pipeline) do
- create(:ci_pipeline,
- :with_test_reports,
- project: project,
- ref: merge_request.target_branch,
- sha: merge_request.diff_base_sha)
+ create(
+ :ci_pipeline,
+ :with_test_reports,
+ project: project,
+ ref: merge_request.target_branch,
+ sha: merge_request.diff_base_sha
+ )
end
before do
@@ -2578,11 +2588,13 @@ RSpec.describe MergeRequest, factory_default: :keep, feature_category: :code_rev
context 'when head pipeline has test reports' do
let!(:head_pipeline) do
- create(:ci_pipeline,
- :with_test_reports,
- project: project,
- ref: merge_request.source_branch,
- sha: merge_request.diff_head_sha)
+ create(
+ :ci_pipeline,
+ :with_test_reports,
+ project: project,
+ ref: merge_request.source_branch,
+ sha: merge_request.diff_head_sha
+ )
end
context 'when reactive cache worker is parsing asynchronously' do
@@ -2618,10 +2630,12 @@ RSpec.describe MergeRequest, factory_default: :keep, feature_category: :code_rev
context 'when head pipeline does not have test reports' do
let!(:head_pipeline) do
- create(:ci_pipeline,
- project: project,
- ref: merge_request.source_branch,
- sha: merge_request.diff_head_sha)
+ create(
+ :ci_pipeline,
+ project: project,
+ ref: merge_request.source_branch,
+ sha: merge_request.diff_head_sha
+ )
end
it 'returns status and error message' do
@@ -2923,10 +2937,12 @@ RSpec.describe MergeRequest, factory_default: :keep, feature_category: :code_rev
before do
project.add_maintainer(current_user)
- ProcessCommitWorker.new.perform(project.id,
- current_user.id,
- project.commit(revert_commit_id).to_hash,
- project.default_branch == branch)
+ ProcessCommitWorker.new.perform(
+ project.id,
+ current_user.id,
+ project.commit(revert_commit_id).to_hash,
+ project.default_branch == branch
+ )
end
context 'but merged at timestamp cannot be found' do
@@ -3023,10 +3039,13 @@ RSpec.describe MergeRequest, factory_default: :keep, feature_category: :code_rev
context 'when resource event for the merge exists' do
before do
- SystemNoteService.change_status(merge_request,
- merge_request.target_project,
- user,
- merge_request.state, nil)
+ SystemNoteService.change_status(
+ merge_request,
+ merge_request.target_project,
+ user,
+ merge_request.state,
+ nil
+ )
end
it 'returns the resource event creation date' do
@@ -3194,9 +3213,7 @@ RSpec.describe MergeRequest, factory_default: :keep, feature_category: :code_rev
context 'with skip_ci_check option' do
before do
- allow(subject).to receive_messages(check_mergeability: nil,
- can_be_merged?: true,
- broken?: false)
+ allow(subject).to receive_messages(check_mergeability: nil, can_be_merged?: true, broken?: false)
end
where(:mergeable_ci_state, :skip_ci_check, :expected_mergeable) do
@@ -3217,10 +3234,12 @@ RSpec.describe MergeRequest, factory_default: :keep, feature_category: :code_rev
context 'with skip_discussions_check option' do
before do
- allow(subject).to receive_messages(mergeable_ci_state?: true,
- check_mergeability: nil,
- can_be_merged?: true,
- broken?: false)
+ allow(subject).to receive_messages(
+ mergeable_ci_state?: true,
+ check_mergeability: nil,
+ can_be_merged?: true,
+ broken?: false
+ )
end
where(:mergeable_discussions_state, :skip_discussions_check, :expected_mergeable) do
@@ -3713,17 +3732,21 @@ RSpec.describe MergeRequest, factory_default: :keep, feature_category: :code_rev
expect_any_instance_of(Discussions::UpdateDiffPositionService).to receive(:execute).with(discussion).and_call_original
- subject.update_diff_discussion_positions(old_diff_refs: old_diff_refs,
- new_diff_refs: new_diff_refs,
- current_user: subject.author)
+ subject.update_diff_discussion_positions(
+ old_diff_refs: old_diff_refs,
+ new_diff_refs: new_diff_refs,
+ current_user: subject.author
+ )
end
it 'does not call the resolve method' do
expect(MergeRequests::ResolvedDiscussionNotificationService).not_to receive(:new)
- subject.update_diff_discussion_positions(old_diff_refs: old_diff_refs,
- new_diff_refs: new_diff_refs,
- current_user: subject.author)
+ subject.update_diff_discussion_positions(
+ old_diff_refs: old_diff_refs,
+ new_diff_refs: new_diff_refs,
+ current_user: subject.author
+ )
end
context 'when resolve_outdated_diff_discussions is set' do
@@ -3738,9 +3761,11 @@ RSpec.describe MergeRequest, factory_default: :keep, feature_category: :code_rev
expect_any_instance_of(MergeRequests::ResolvedDiscussionNotificationService)
.to receive(:execute).with(subject)
- subject.update_diff_discussion_positions(old_diff_refs: old_diff_refs,
- new_diff_refs: new_diff_refs,
- current_user: subject.author)
+ subject.update_diff_discussion_positions(
+ old_diff_refs: old_diff_refs,
+ new_diff_refs: new_diff_refs,
+ current_user: subject.author
+ )
end
end
@@ -3750,9 +3775,11 @@ RSpec.describe MergeRequest, factory_default: :keep, feature_category: :code_rev
it 'does not call the resolve method' do
expect(MergeRequests::ResolvedDiscussionNotificationService).not_to receive(:new)
- subject.update_diff_discussion_positions(old_diff_refs: old_diff_refs,
- new_diff_refs: new_diff_refs,
- current_user: subject.author)
+ subject.update_diff_discussion_positions(
+ old_diff_refs: old_diff_refs,
+ new_diff_refs: new_diff_refs,
+ current_user: subject.author
+ )
end
end
@@ -3764,9 +3791,11 @@ RSpec.describe MergeRequest, factory_default: :keep, feature_category: :code_rev
it 'does not call the resolve method' do
expect(MergeRequests::ResolvedDiscussionNotificationService).not_to receive(:new)
- subject.update_diff_discussion_positions(old_diff_refs: old_diff_refs,
- new_diff_refs: new_diff_refs,
- current_user: subject.author)
+ subject.update_diff_discussion_positions(
+ old_diff_refs: old_diff_refs,
+ new_diff_refs: new_diff_refs,
+ current_user: subject.author
+ )
end
end
end
@@ -4903,10 +4932,7 @@ RSpec.describe MergeRequest, factory_default: :keep, feature_category: :code_rev
let(:target_project) { create(:project, :public) }
let(:source_project) { fork_project(target_project) }
let(:merge_request) do
- create(:merge_request,
- source_project: source_project,
- source_branch: 'fixes',
- target_project: target_project)
+ create(:merge_request, source_project: source_project, source_branch: 'fixes', target_project: target_project)
end
let(:user) { create(:user) }
@@ -4936,10 +4962,7 @@ RSpec.describe MergeRequest, factory_default: :keep, feature_category: :code_rev
let(:user) { create(:user) }
subject do
- create(:merge_request,
- merge_when_pipeline_succeeds: true,
- merge_user: user,
- author: user)
+ create(:merge_request, merge_when_pipeline_succeeds: true, merge_user: user, author: user)
end
context 'author is not a project member' do
@@ -4963,9 +4986,7 @@ RSpec.describe MergeRequest, factory_default: :keep, feature_category: :code_rev
let(:merge_user) { create(:user) }
subject do
- create(:merge_request,
- merge_when_pipeline_succeeds: true,
- merge_user: merge_user)
+ create(:merge_request, merge_when_pipeline_succeeds: true, merge_user: merge_user)
end
before do
@@ -5118,20 +5139,24 @@ RSpec.describe MergeRequest, factory_default: :keep, feature_category: :code_rev
let!(:project) { create(:project) }
let!(:fork) { fork_project(project) }
let!(:merge_request1) do
- create(:merge_request,
- :merge_when_pipeline_succeeds,
- target_project: project,
- target_branch: 'master',
- source_project: project,
- source_branch: 'feature-1')
+ create(
+ :merge_request,
+ :merge_when_pipeline_succeeds,
+ target_project: project,
+ target_branch: 'master',
+ source_project: project,
+ source_branch: 'feature-1'
+ )
end
let!(:merge_request4) do
- create(:merge_request,
- target_project: project,
- target_branch: 'master',
- source_project: fork,
- source_branch: 'fork-feature-2')
+ create(
+ :merge_request,
+ target_project: project,
+ target_branch: 'master',
+ source_project: fork,
+ source_branch: 'fork-feature-2'
+ )
end
let(:query) { described_class.with_auto_merge_enabled }
diff --git a/spec/models/namespace_spec.rb b/spec/models/namespace_spec.rb
index e1629dd354e..3d7d5062ca7 100644
--- a/spec/models/namespace_spec.rb
+++ b/spec/models/namespace_spec.rb
@@ -1103,32 +1103,39 @@ RSpec.describe Namespace, feature_category: :groups_and_projects do
let(:project1) do
create(:project,
- namespace: namespace,
- statistics: build(:project_statistics,
- namespace: namespace,
- repository_size: 101,
- wiki_size: 505,
- lfs_objects_size: 202,
- build_artifacts_size: 303,
- pipeline_artifacts_size: 707,
- packages_size: 404,
- snippets_size: 605,
- uploads_size: 808))
+ namespace: namespace,
+ statistics: build(
+ :project_statistics,
+ namespace: namespace,
+ repository_size: 101,
+ wiki_size: 505,
+ lfs_objects_size: 202,
+ build_artifacts_size: 303,
+ pipeline_artifacts_size: 707,
+ packages_size: 404,
+ snippets_size: 605,
+ uploads_size: 808
+ )
+ )
end
let(:project2) do
- create(:project,
- namespace: namespace,
- statistics: build(:project_statistics,
- namespace: namespace,
- repository_size: 10,
- wiki_size: 50,
- lfs_objects_size: 20,
- build_artifacts_size: 30,
- pipeline_artifacts_size: 70,
- packages_size: 40,
- snippets_size: 60,
- uploads_size: 80))
+ create(
+ :project,
+ namespace: namespace,
+ statistics: build(
+ :project_statistics,
+ namespace: namespace,
+ repository_size: 10,
+ wiki_size: 50,
+ lfs_objects_size: 20,
+ build_artifacts_size: 30,
+ pipeline_artifacts_size: 70,
+ packages_size: 40,
+ snippets_size: 60,
+ uploads_size: 80
+ )
+ )
end
it "sums all project storage counters in the namespace" do
@@ -1191,8 +1198,9 @@ RSpec.describe Namespace, feature_category: :groups_and_projects do
end
it 'raises an error about not movable project' do
- expect { namespace.move_dir }.to raise_error(Gitlab::UpdatePathError,
- /Namespace .* cannot be moved/)
+ expect { namespace.move_dir }.to raise_error(
+ Gitlab::UpdatePathError, /Namespace .* cannot be moved/
+ )
end
end
end
@@ -1857,16 +1865,12 @@ RSpec.describe Namespace, feature_category: :groups_and_projects do
expect(AuthorizedProjectUpdate::UserRefreshFromReplicaWorker).to(
receive(:bulk_perform_in)
- .with(1.hour,
- [[group_one_user.id]],
- batch_delay: 30.seconds, batch_size: 100)
+ .with(1.hour, [[group_one_user.id]], batch_delay: 30.seconds, batch_size: 100)
)
expect(AuthorizedProjectUpdate::UserRefreshFromReplicaWorker).to(
receive(:bulk_perform_in)
- .with(1.hour,
- [[group_two_user.id]],
- batch_delay: 30.seconds, batch_size: 100)
+ .with(1.hour, [[group_two_user.id]], batch_delay: 30.seconds, batch_size: 100)
)
execute_update
@@ -1885,12 +1889,10 @@ RSpec.describe Namespace, feature_category: :groups_and_projects do
it 'updates the authorizations in a non-blocking manner' do
expect(AuthorizedProjectsWorker).to(
- receive(:bulk_perform_async)
- .with([[group_one_user.id]])).once
+ receive(:bulk_perform_async).with([[group_one_user.id]])).once
expect(AuthorizedProjectsWorker).to(
- receive(:bulk_perform_async)
- .with([[group_two_user.id]])).once
+ receive(:bulk_perform_async).with([[group_two_user.id]])).once
execute_update
end
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb
index f82235916f2..e99d77dc0a0 100644
--- a/spec/models/note_spec.rb
+++ b/spec/models/note_spec.rb
@@ -53,8 +53,7 @@ RSpec.describe Note, feature_category: :team_planning do
context 'when noteable and note project differ' do
subject do
- build(:note, noteable: build_stubbed(:issue),
- project: build_stubbed(:project))
+ build(:note, noteable: build_stubbed(:issue), project: build_stubbed(:project))
end
it { is_expected.to be_invalid }
diff --git a/spec/models/onboarding/progress_spec.rb b/spec/models/onboarding/progress_spec.rb
index 7d169464462..c45d8c97385 100644
--- a/spec/models/onboarding/progress_spec.rb
+++ b/spec/models/onboarding/progress_spec.rb
@@ -77,8 +77,10 @@ RSpec.describe Onboarding::Progress do
describe '.completed_actions_with_latest_in_range' do
subject do
- described_class.completed_actions_with_latest_in_range(actions,
- 1.day.ago.beginning_of_day..1.day.ago.end_of_day)
+ described_class.completed_actions_with_latest_in_range(
+ actions,
+ 1.day.ago.beginning_of_day..1.day.ago.end_of_day
+ )
end
let!(:one_action_completed_in_range_one_action_incompleted) do
diff --git a/spec/models/operations/feature_flags/strategy_spec.rb b/spec/models/operations/feature_flags/strategy_spec.rb
index 949f92b3b2a..91a465025a2 100644
--- a/spec/models/operations/feature_flags/strategy_spec.rb
+++ b/spec/models/operations/feature_flags/strategy_spec.rb
@@ -20,10 +20,12 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
with_them do
it 'skips parameters validation' do
- strategy = build(:operations_strategy,
- feature_flag: feature_flag,
- name: invalid_name,
- parameters: { bad: 'params' })
+ strategy = build(
+ :operations_strategy,
+ feature_flag: feature_flag,
+ name: invalid_name,
+ parameters: { bad: 'params' }
+ )
expect(strategy).to be_invalid
@@ -40,10 +42,12 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
with_them do
it 'must have valid parameters for the strategy' do
- strategy = build(:operations_strategy,
- :gradual_rollout,
- feature_flag: feature_flag,
- parameters: invalid_parameters)
+ strategy = build(
+ :operations_strategy,
+ :gradual_rollout,
+ feature_flag: feature_flag,
+ parameters: invalid_parameters
+ )
expect(strategy).to be_invalid
@@ -52,10 +56,12 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
it 'allows the parameters in any order' do
- strategy = build(:operations_strategy,
- :gradual_rollout,
- feature_flag: feature_flag,
- parameters: { percentage: '10', groupId: 'mygroup' })
+ strategy = build(
+ :operations_strategy,
+ :gradual_rollout,
+ feature_flag: feature_flag,
+ parameters: { percentage: '10', groupId: 'mygroup' }
+ )
expect(strategy).to be_valid
end
@@ -68,10 +74,12 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
with_them do
it 'must be a string value between 0 and 100 inclusive and without a percentage sign' do
- strategy = build(:operations_strategy,
- :gradual_rollout,
- feature_flag: feature_flag,
- parameters: { groupId: 'mygroup', percentage: invalid_value })
+ strategy = build(
+ :operations_strategy,
+ :gradual_rollout,
+ feature_flag: feature_flag,
+ parameters: { groupId: 'mygroup', percentage: invalid_value }
+ )
expect(strategy).to be_invalid
@@ -84,10 +92,12 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
with_them do
it 'must be a string value between 0 and 100 inclusive and without a percentage sign' do
- strategy = build(:operations_strategy,
- :gradual_rollout,
- feature_flag: feature_flag,
- parameters: { groupId: 'mygroup', percentage: valid_value })
+ strategy = build(
+ :operations_strategy,
+ :gradual_rollout,
+ feature_flag: feature_flag,
+ parameters: { groupId: 'mygroup', percentage: valid_value }
+ )
expect(strategy).to be_valid
end
@@ -101,10 +111,12 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
with_them do
it 'must be a string value of up to 32 lowercase characters' do
- strategy = build(:operations_strategy,
- :gradual_rollout,
- feature_flag: feature_flag,
- parameters: { groupId: invalid_value, percentage: '40' })
+ strategy = build(
+ :operations_strategy,
+ :gradual_rollout,
+ feature_flag: feature_flag,
+ parameters: { groupId: invalid_value, percentage: '40' }
+ )
expect(strategy).to be_invalid
@@ -117,10 +129,12 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
with_them do
it 'must be a string value of up to 32 lowercase characters' do
- strategy = build(:operations_strategy,
- :gradual_rollout,
- feature_flag: feature_flag,
- parameters: { groupId: valid_value, percentage: '40' })
+ strategy = build(
+ :operations_strategy,
+ :gradual_rollout,
+ feature_flag: feature_flag,
+ parameters: { groupId: valid_value, percentage: '40' }
+ )
expect(strategy).to be_valid
end
@@ -141,10 +155,12 @@ RSpec.describe Operations::FeatureFlags::Strategy do
])
with_them do
it 'must have valid parameters for the strategy' do
- strategy = build(:operations_strategy,
- :flexible_rollout,
- feature_flag: feature_flag,
- parameters: invalid_parameters)
+ strategy = build(
+ :operations_strategy,
+ :flexible_rollout,
+ feature_flag: feature_flag,
+ parameters: invalid_parameters
+ )
expect(strategy).to be_invalid
@@ -158,10 +174,12 @@ RSpec.describe Operations::FeatureFlags::Strategy do
[:groupId, 'mygroup']
].permutation(3).each do |parameters|
it "allows the parameters in the order #{parameters.map { |p| p.first }.join(', ')}" do
- strategy = build(:operations_strategy,
- :flexible_rollout,
- feature_flag: feature_flag,
- parameters: Hash[parameters])
+ strategy = build(
+ :operations_strategy,
+ :flexible_rollout,
+ feature_flag: feature_flag,
+ parameters: Hash[parameters]
+ )
expect(strategy).to be_valid
end
@@ -174,10 +192,12 @@ RSpec.describe Operations::FeatureFlags::Strategy do
with_them do
it 'must be a string value between 0 and 100 inclusive and without a percentage sign' do
parameters = { stickiness: 'default', groupId: 'mygroup', rollout: invalid_value }
- strategy = build(:operations_strategy,
- :flexible_rollout,
- feature_flag: feature_flag,
- parameters: parameters)
+ strategy = build(
+ :operations_strategy,
+ :flexible_rollout,
+ feature_flag: feature_flag,
+ parameters: parameters
+ )
expect(strategy).to be_invalid
@@ -189,10 +209,12 @@ RSpec.describe Operations::FeatureFlags::Strategy do
with_them do
it 'must be a string value between 0 and 100 inclusive and without a percentage sign' do
parameters = { stickiness: 'default', groupId: 'mygroup', rollout: valid_value }
- strategy = build(:operations_strategy,
- :flexible_rollout,
- feature_flag: feature_flag,
- parameters: parameters)
+ strategy = build(
+ :operations_strategy,
+ :flexible_rollout,
+ feature_flag: feature_flag,
+ parameters: parameters
+ )
expect(strategy).to be_valid
end
@@ -205,10 +227,12 @@ RSpec.describe Operations::FeatureFlags::Strategy do
with_them do
it 'must be a string value of up to 32 lowercase characters' do
parameters = { stickiness: 'default', groupId: invalid_value, rollout: '40' }
- strategy = build(:operations_strategy,
- :flexible_rollout,
- feature_flag: feature_flag,
- parameters: parameters)
+ strategy = build(
+ :operations_strategy,
+ :flexible_rollout,
+ feature_flag: feature_flag,
+ parameters: parameters
+ )
expect(strategy).to be_invalid
@@ -220,10 +244,12 @@ RSpec.describe Operations::FeatureFlags::Strategy do
with_them do
it 'must be a string value of up to 32 lowercase characters' do
parameters = { stickiness: 'default', groupId: valid_value, rollout: '40' }
- strategy = build(:operations_strategy,
- :flexible_rollout,
- feature_flag: feature_flag,
- parameters: parameters)
+ strategy = build(
+ :operations_strategy,
+ :flexible_rollout,
+ feature_flag: feature_flag,
+ parameters: parameters
+ )
expect(strategy).to be_valid
end
@@ -235,10 +261,12 @@ RSpec.describe Operations::FeatureFlags::Strategy do
with_them do
it 'must be a string representing a supported stickiness setting' do
parameters = { stickiness: invalid_value, groupId: 'mygroup', rollout: '40' }
- strategy = build(:operations_strategy,
- :flexible_rollout,
- feature_flag: feature_flag,
- parameters: parameters)
+ strategy = build(
+ :operations_strategy,
+ :flexible_rollout,
+ feature_flag: feature_flag,
+ parameters: parameters
+ )
expect(strategy).to be_invalid
@@ -251,10 +279,12 @@ RSpec.describe Operations::FeatureFlags::Strategy do
with_them do
it 'must be a string representing a supported stickiness setting' do
parameters = { stickiness: valid_value, groupId: 'mygroup', rollout: '40' }
- strategy = build(:operations_strategy,
- :flexible_rollout,
- feature_flag: feature_flag,
- parameters: parameters)
+ strategy = build(
+ :operations_strategy,
+ :flexible_rollout,
+ feature_flag: feature_flag,
+ parameters: parameters
+ )
expect(strategy).to be_valid
end
@@ -268,9 +298,12 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
with_them do
it 'must have valid parameters for the strategy' do
- strategy = build(:operations_strategy,
- feature_flag: feature_flag,
- name: 'userWithId', parameters: invalid_parameters)
+ strategy = build(
+ :operations_strategy,
+ feature_flag: feature_flag,
+ name: 'userWithId',
+ parameters: invalid_parameters
+ )
expect(strategy).to be_invalid
@@ -287,10 +320,12 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
with_them do
it 'is valid with a string of comma separated values' do
- strategy = build(:operations_strategy,
- feature_flag: feature_flag,
- name: 'userWithId',
- parameters: { userIds: valid_value })
+ strategy = build(
+ :operations_strategy,
+ feature_flag: feature_flag,
+ name: 'userWithId',
+ parameters: { userIds: valid_value }
+ )
expect(strategy).to be_valid
end
@@ -303,10 +338,12 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
with_them do
it 'is invalid' do
- strategy = build(:operations_strategy,
- feature_flag: feature_flag,
- name: 'userWithId',
- parameters: { userIds: invalid_value })
+ strategy = build(
+ :operations_strategy,
+ feature_flag: feature_flag,
+ name: 'userWithId',
+ parameters: { userIds: invalid_value }
+ )
expect(strategy).to be_invalid
@@ -347,11 +384,13 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
with_them do
it 'is invalid' do
- strategy = build(:operations_strategy,
- :gitlab_userlist,
- user_list: user_list,
- feature_flag: feature_flag,
- parameters: invalid_value)
+ strategy = build(
+ :operations_strategy,
+ :gitlab_userlist,
+ user_list: user_list,
+ feature_flag: feature_flag,
+ parameters: invalid_value
+ )
expect(strategy).to be_invalid
@@ -360,10 +399,12 @@ RSpec.describe Operations::FeatureFlags::Strategy do
end
it 'is valid' do
- strategy = build(:operations_strategy,
- :gitlab_userlist,
- user_list: user_list,
- feature_flag: feature_flag)
+ strategy = build(
+ :operations_strategy,
+ :gitlab_userlist,
+ user_list: user_list,
+ feature_flag: feature_flag
+ )
expect(strategy).to be_valid
end
diff --git a/spec/models/pages_domain_spec.rb b/spec/models/pages_domain_spec.rb
index b218d4dce09..2c63306bd0a 100644
--- a/spec/models/pages_domain_spec.rb
+++ b/spec/models/pages_domain_spec.rb
@@ -427,23 +427,27 @@ RSpec.describe PagesDomain do
end
describe '#user_provided_key=' do
- include_examples('certificate setter', 'key', 'user_provided_key=',
- 'gitlab_provided', 'user_provided')
+ include_examples(
+ 'certificate setter', 'key', 'user_provided_key=', 'gitlab_provided', 'user_provided'
+ )
end
describe '#gitlab_provided_key=' do
- include_examples('certificate setter', 'key', 'gitlab_provided_key=',
- 'user_provided', 'gitlab_provided')
+ include_examples(
+ 'certificate setter', 'key', 'gitlab_provided_key=', 'user_provided', 'gitlab_provided'
+ )
end
describe '#user_provided_certificate=' do
- include_examples('certificate setter', 'certificate', 'user_provided_certificate=',
- 'gitlab_provided', 'user_provided')
+ include_examples(
+ 'certificate setter', 'certificate', 'user_provided_certificate=', 'gitlab_provided', 'user_provided'
+ )
end
describe '#gitlab_provided_certificate=' do
- include_examples('certificate setter', 'certificate', 'gitlab_provided_certificate=',
- 'user_provided', 'gitlab_provided')
+ include_examples(
+ 'certificate setter', 'certificate', 'gitlab_provided_certificate=', 'user_provided', 'gitlab_provided'
+ )
end
describe '#save' do
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 2164d5fc787..f44331521e9 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -209,9 +209,12 @@ RSpec.describe Project, factory_default: :keep, feature_category: :groups_and_pr
project = create(:project)
lfs_object = create(:lfs_object)
[:project, :design].each do |repository_type|
- create(:lfs_objects_project, project: project,
- lfs_object: lfs_object,
- repository_type: repository_type)
+ create(
+ :lfs_objects_project,
+ project: project,
+ lfs_object: lfs_object,
+ repository_type: repository_type
+ )
end
expect(project.lfs_objects_projects.size).to eq(2)
@@ -781,14 +784,11 @@ RSpec.describe Project, factory_default: :keep, feature_category: :groups_and_pr
describe 'project pending deletion' do
let!(:project_pending_deletion) do
- create(:project,
- pending_delete: true)
+ create(:project, pending_delete: true)
end
let(:new_project) do
- build(:project,
- path: project_pending_deletion.path,
- namespace: project_pending_deletion.namespace)
+ build(:project, path: project_pending_deletion.path, namespace: project_pending_deletion.namespace)
end
before do
@@ -3397,8 +3397,7 @@ RSpec.describe Project, factory_default: :keep, feature_category: :groups_and_pr
before do
create(:container_repository, project: project, name: 'image')
- stub_container_registry_tags(repository: /image/,
- tags: %w[latest rc1])
+ stub_container_registry_tags(repository: /image/, tags: %w[latest rc1])
end
it 'has image tags' do
@@ -3408,8 +3407,7 @@ RSpec.describe Project, factory_default: :keep, feature_category: :groups_and_pr
context 'when tags are present for root repository' do
before do
- stub_container_registry_tags(repository: project.full_path,
- tags: %w[latest rc1 pre1])
+ stub_container_registry_tags(repository: project.full_path, tags: %w[latest rc1 pre1])
end
it 'has image tags' do
@@ -3527,18 +3525,15 @@ RSpec.describe Project, factory_default: :keep, feature_category: :groups_and_pr
let(:second_branch) { project.repository.branches[2] }
let!(:pipeline_for_default_branch) do
- create(:ci_pipeline, project: project, sha: project.commit.id,
- ref: project.default_branch)
+ create(:ci_pipeline, project: project, sha: project.commit.id, ref: project.default_branch)
end
let!(:pipeline_for_second_branch) do
- create(:ci_pipeline, project: project, sha: second_branch.target,
- ref: second_branch.name)
+ create(:ci_pipeline, project: project, sha: second_branch.target, ref: second_branch.name)
end
let!(:other_pipeline_for_default_branch) do
- create(:ci_pipeline, project: project, sha: project.commit.parent.id,
- ref: project.default_branch)
+ create(:ci_pipeline, project: project, sha: project.commit.parent.id, ref: project.default_branch)
end
context 'default repository branch' do
@@ -3568,8 +3563,12 @@ RSpec.describe Project, factory_default: :keep, feature_category: :groups_and_pr
context 'with provided sha' do
let!(:latest_pipeline_for_ref) do
- create(:ci_pipeline, project: project, sha: pipeline_for_second_branch.sha,
- ref: pipeline_for_second_branch.ref)
+ create(
+ :ci_pipeline,
+ project: project,
+ sha: pipeline_for_second_branch.sha,
+ ref: pipeline_for_second_branch.ref
+ )
end
subject { project.latest_pipeline(second_branch.name, second_branch.target) }
@@ -4442,21 +4441,25 @@ RSpec.describe Project, factory_default: :keep, feature_category: :groups_and_pr
let(:project) { create(:project) }
let!(:default_cluster) do
- create(:cluster,
- :not_managed,
- platform_type: :kubernetes,
- projects: [project],
- environment_scope: '*',
- platform_kubernetes: default_cluster_kubernetes)
+ create(
+ :cluster,
+ :not_managed,
+ platform_type: :kubernetes,
+ projects: [project],
+ environment_scope: '*',
+ platform_kubernetes: default_cluster_kubernetes
+ )
end
let!(:review_env_cluster) do
- create(:cluster,
- :not_managed,
- platform_type: :kubernetes,
- projects: [project],
- environment_scope: 'review/*',
- platform_kubernetes: review_env_cluster_kubernetes)
+ create(
+ :cluster,
+ :not_managed,
+ platform_type: :kubernetes,
+ projects: [project],
+ environment_scope: 'review/*',
+ platform_kubernetes: review_env_cluster_kubernetes
+ )
end
let(:default_cluster_kubernetes) { create(:cluster_platform_kubernetes, token: 'default-AAA') }
@@ -6572,12 +6575,14 @@ RSpec.describe Project, factory_default: :keep, feature_category: :groups_and_pr
end
it 'does not allow access to branches for which the merge request was closed' do
- create(:merge_request, :closed,
- target_project: target_project,
- target_branch: 'target-branch',
- source_project: project,
- source_branch: 'rejected-feature-1',
- allow_collaboration: true)
+ create(
+ :merge_request, :closed,
+ target_project: target_project,
+ target_branch: 'target-branch',
+ source_project: project,
+ source_branch: 'rejected-feature-1',
+ allow_collaboration: true
+ )
expect(project.branch_allows_collaboration?(user, 'rejected-feature-1'))
.to be_falsy
@@ -6612,8 +6617,7 @@ RSpec.describe Project, factory_default: :keep, feature_category: :groups_and_pr
it 'returns the classification label if it was configured on the project' do
enable_external_authorization_service_check
- project = build(:project,
- external_authorization_classification_label: 'hello')
+ project = build(:project, external_authorization_classification_label: 'hello')
expect(project.external_authorization_classification_label)
.to eq('hello')
@@ -9066,16 +9070,21 @@ RSpec.describe Project, factory_default: :keep, feature_category: :groups_and_pr
end
def create_pipeline(project, status = 'success')
- create(:ci_pipeline, project: project,
- sha: project.commit.sha,
- ref: project.default_branch,
- status: status)
+ create(
+ :ci_pipeline,
+ project: project,
+ sha: project.commit.sha,
+ ref: project.default_branch,
+ status: status
+ )
end
def create_build(new_pipeline = pipeline, name = 'test')
- create(:ci_build, :success, :artifacts,
- pipeline: new_pipeline,
- status: new_pipeline.status,
- name: name)
+ create(
+ :ci_build, :success, :artifacts,
+ pipeline: new_pipeline,
+ status: new_pipeline.status,
+ name: name
+ )
end
end
diff --git a/spec/models/project_team_spec.rb b/spec/models/project_team_spec.rb
index 4ff77faf5bf..f3139e72113 100644
--- a/spec/models/project_team_spec.rb
+++ b/spec/models/project_team_spec.rb
@@ -126,9 +126,12 @@ RSpec.describe ProjectTeam, feature_category: :groups_and_projects do
it 'returns invited members of a group' do
group_member = create(:group_member)
- create(:project_group_link, group: group_member.group,
- project: project,
- group_access: Gitlab::Access::GUEST)
+ create(
+ :project_group_link,
+ group: group_member.group,
+ project: project,
+ group_access: Gitlab::Access::GUEST
+ )
expect(project.team.members)
.to contain_exactly(group_member.user, project.first_owner)
@@ -136,9 +139,12 @@ RSpec.describe ProjectTeam, feature_category: :groups_and_projects do
it 'returns invited members of a group of a specified level' do
group_member = create(:group_member)
- create(:project_group_link, group: group_member.group,
- project: project,
- group_access: Gitlab::Access::REPORTER)
+ create(
+ :project_group_link,
+ group: group_member.group,
+ project: project,
+ group_access: Gitlab::Access::REPORTER
+ )
expect(project.team.guests).to be_empty
expect(project.team.reporters).to contain_exactly(group_member.user)
@@ -579,8 +585,7 @@ RSpec.describe ProjectTeam, feature_category: :groups_and_projects do
all_users = users + [new_contributor.id, second_new_user.id]
create(:merge_request, :merged, author: new_contributor, target_project: project, source_project: new_fork_project, target_branch: project.default_branch.to_s)
- expected_all = expected.merge(new_contributor.id => true,
- second_new_user.id => false)
+ expected_all = expected.merge(new_contributor.id => true, second_new_user.id => false)
contributors(users)
@@ -677,8 +682,10 @@ RSpec.describe ProjectTeam, feature_category: :groups_and_projects do
second_new_user = create(:user)
all_users = users + [new_user.id, second_new_user.id]
- expected_all = expected.merge(new_user.id => Gitlab::Access::NO_ACCESS,
- second_new_user.id => Gitlab::Access::NO_ACCESS)
+ expected_all = expected.merge(
+ new_user.id => Gitlab::Access::NO_ACCESS,
+ second_new_user.id => Gitlab::Access::NO_ACCESS
+ )
access_levels(users)
diff --git a/spec/models/release_spec.rb b/spec/models/release_spec.rb
index 863cc11f0b2..bddd0516400 100644
--- a/spec/models/release_spec.rb
+++ b/spec/models/release_spec.rb
@@ -54,9 +54,9 @@ RSpec.describe Release, feature_category: :release_orchestration do
it 'creates a validation error' do
milestone = build(:milestone, project: create(:project))
- expect { release.milestones << milestone }
- .to raise_error(ActiveRecord::RecordInvalid,
- 'Validation failed: Release does not have the same project as the milestone')
+ expect { release.milestones << milestone }.to raise_error(
+ ActiveRecord::RecordInvalid, 'Validation failed: Release does not have the same project as the milestone'
+ )
end
end
diff --git a/spec/models/remote_mirror_spec.rb b/spec/models/remote_mirror_spec.rb
index adb4777ae90..382718620f5 100644
--- a/spec/models/remote_mirror_spec.rb
+++ b/spec/models/remote_mirror_spec.rb
@@ -252,19 +252,23 @@ RSpec.describe RemoteMirror, :mailer do
context 'stuck mirrors' do
it 'includes mirrors that were started over an hour ago' do
- mirror = create_mirror(url: 'http://cantbeblank',
- update_status: 'started',
- last_update_started_at: 3.hours.ago,
- last_update_at: 2.hours.ago)
+ mirror = create_mirror(
+ url: 'http://cantbeblank',
+ update_status: 'started',
+ last_update_started_at: 3.hours.ago,
+ last_update_at: 2.hours.ago
+ )
expect(described_class.stuck.last).to eq(mirror)
end
it 'includes mirrors started over 3 hours ago for their first sync' do
- mirror = create_mirror(url: 'http://cantbeblank',
- update_status: 'started',
- last_update_at: nil,
- last_update_started_at: 4.hours.ago)
+ mirror = create_mirror(
+ url: 'http://cantbeblank',
+ update_status: 'started',
+ last_update_at: nil,
+ last_update_started_at: 4.hours.ago
+ )
expect(described_class.stuck.last).to eq(mirror)
end
@@ -358,11 +362,13 @@ RSpec.describe RemoteMirror, :mailer do
let(:remote_mirror) { create(:project, :repository, :remote_mirror).remote_mirrors.first }
it 'resets all the columns when URL changes' do
- remote_mirror.update!(last_error: Time.current,
- last_update_at: Time.current,
- last_successful_update_at: Time.current,
- update_status: 'started',
- error_notification_sent: true)
+ remote_mirror.update!(
+ last_error: Time.current,
+ last_update_at: Time.current,
+ last_successful_update_at: Time.current,
+ update_status: 'started',
+ error_notification_sent: true
+ )
expect { remote_mirror.update_attribute(:url, 'http://new.example.com') }
.to change { remote_mirror.last_error }.to(nil)
@@ -406,11 +412,13 @@ RSpec.describe RemoteMirror, :mailer do
context 'no project' do
it 'includes mirror with a project in pending_delete' do
- mirror = create_mirror(url: 'http://cantbeblank',
- update_status: 'finished',
- enabled: true,
- last_update_at: nil,
- updated_at: 25.hours.ago)
+ mirror = create_mirror(
+ url: 'http://cantbeblank',
+ update_status: 'finished',
+ enabled: true,
+ last_update_at: nil,
+ updated_at: 25.hours.ago
+ )
project = mirror.project
project.pending_delete = true
project.save!
diff --git a/spec/requests/api/project_export_spec.rb b/spec/requests/api/project_export_spec.rb
index 22d7ea36f6c..434936c0ee7 100644
--- a/spec/requests/api/project_export_spec.rb
+++ b/spec/requests/api/project_export_spec.rb
@@ -284,7 +284,7 @@ RSpec.describe API::ProjectExport, :aggregate_failures, :clean_gitlab_redis_cach
stub_application_setting(project_download_export_limit: 1)
end
- it 'throttles downloads within same namespaces' do
+ it 'throttles downloads within same namespaces', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/413230' do
# simulate prior request to the same namespace, which increments the rate limit counter for that scope
Gitlab::ApplicationRateLimiter.throttled?(:project_download_export, scope: [user, project_finished.namespace])
diff --git a/spec/requests/import/gitlab_groups_controller_spec.rb b/spec/requests/import/gitlab_groups_controller_spec.rb
index 1766c48cca1..734a4cefc5c 100644
--- a/spec/requests/import/gitlab_groups_controller_spec.rb
+++ b/spec/requests/import/gitlab_groups_controller_spec.rb
@@ -69,7 +69,7 @@ RSpec.describe Import::GitlabGroupsController, feature_category: :importers do
expect(GroupImportWorker).to have_received(:perform_async).with(user.id, group.id)
expect(group.description).to eq 'A voluptate non sequi temporibus quam at.'
- expect(group.visibility_level).to eq Gitlab::VisibilityLevel::PRIVATE
+ expect(group.visibility_level).to eq Gitlab::VisibilityLevel::PUBLIC
end
end