diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-14 12:08:14 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-14 12:08:14 +0000 |
commit | 075c890053f626018ba680e4da21a93743acb244 (patch) | |
tree | f7a417c83956d02522c6234070974e4e53f9cd34 | |
parent | af60c8a79f77c8230292a133fb9d09dab5cd5cd3 (diff) | |
download | gitlab-ce-075c890053f626018ba680e4da21a93743acb244.tar.gz |
Add latest changes from gitlab-org/gitlab@master
147 files changed, 468 insertions, 374 deletions
diff --git a/.gitlab/ci/frontend.gitlab-ci.yml b/.gitlab/ci/frontend.gitlab-ci.yml index 4d120de277a..cde023c149a 100644 --- a/.gitlab/ci/frontend.gitlab-ci.yml +++ b/.gitlab/ci/frontend.gitlab-ci.yml @@ -273,32 +273,6 @@ coverage-frontend: coverage_format: cobertura path: coverage-frontend/cobertura-coverage.xml -.qa-frontend-node: - extends: - - .default-retry - - .default-utils-before_script - - .qa-frontend-node-cache - - .frontend:rules:qa-frontend-node - stage: test - needs: [] - script: - - yarn_install_script - - run_timed_command "retry yarn run webpack-prod" - -qa-frontend-node:14: - extends: .qa-frontend-node - image: ${GITLAB_DEPENDENCY_PROXY_ADDRESS}node:14 - -qa-frontend-node:16: - extends: .qa-frontend-node - image: ${GITLAB_DEPENDENCY_PROXY_ADDRESS}node:16 - -qa-frontend-node:latest: - extends: - - .qa-frontend-node - - .frontend:rules:qa-frontend-node-latest - image: ${GITLAB_DEPENDENCY_PROXY_ADDRESS}node:latest - webpack-dev-server: extends: - .default-retry diff --git a/.gitlab/ci/global.gitlab-ci.yml b/.gitlab/ci/global.gitlab-ci.yml index 8d5a2bef9d6..5e35ae6aff3 100644 --- a/.gitlab/ci/global.gitlab-ci.yml +++ b/.gitlab/ci/global.gitlab-ci.yml @@ -201,11 +201,6 @@ cache: - *node-modules-cache -.qa-frontend-node-cache: - cache: - - *node-modules-cache - - *assets-tmp-cache - .assets-compile-cache: cache: - *ruby-gems-cache diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index e5132c03997..cee5aba8d4a 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -1030,22 +1030,6 @@ - <<: *if-default-branch-refs changes: *code-backstage-patterns -.frontend:rules:qa-frontend-node: - rules: - - <<: *if-default-branch-refs - changes: *frontend-dependency-patterns - - <<: *if-merge-request - changes: *frontend-dependency-patterns - -.frontend:rules:qa-frontend-node-latest: - rules: - - <<: *if-default-branch-refs - changes: *frontend-dependency-patterns - allow_failure: true - - <<: *if-merge-request - changes: *frontend-dependency-patterns - allow_failure: true - .frontend:rules:bundle-size-review: rules: - <<: *if-not-canonical-namespace diff --git a/.rubocop_todo/rspec/leaky_constant_declaration.yml b/.rubocop_todo/rspec/leaky_constant_declaration.yml index f05805adeb5..e08625eb2a7 100644 --- a/.rubocop_todo/rspec/leaky_constant_declaration.yml +++ b/.rubocop_todo/rspec/leaky_constant_declaration.yml @@ -8,4 +8,3 @@ RSpec/LeakyConstantDeclaration: - 'spec/mailers/notify_spec.rb' - 'spec/models/concerns/batch_destroy_dependent_associations_spec.rb' - 'spec/models/concerns/bulk_insert_safe_spec.rb' - - 'spec/models/concerns/bulk_insertable_associations_spec.rb' diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index 3ee269cd5e3..2d9ebcf1150 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -06b92cf488942c6746795b581d27854339becc60 +93488d22495586a8ab51adacc42afb3811f1291a diff --git a/app/assets/javascripts/pages/projects/forks/new/components/fork_form.vue b/app/assets/javascripts/pages/projects/forks/new/components/fork_form.vue index 30cefa3d717..91650003d4a 100644 --- a/app/assets/javascripts/pages/projects/forks/new/components/fork_form.vue +++ b/app/assets/javascripts/pages/projects/forks/new/components/fork_form.vue @@ -23,6 +23,7 @@ import { VISIBILITY_LEVEL_INTERNAL_STRING, VISIBILITY_LEVEL_PUBLIC_STRING, VISIBILITY_LEVELS_STRING_TO_INTEGER, + VISIBILITY_LEVELS_INTEGER_TO_STRING, } from '~/visibility_level/constants'; import ProjectNamespace from './project_namespace.vue'; @@ -105,39 +106,8 @@ export default { }; }, computed: { - projectVisibilityLevel() { - return VISIBILITY_LEVELS_STRING_TO_INTEGER[this.projectVisibility]; - }, - namespaceVisibilityLevel() { - const visibility = - this.form.fields.namespace.value?.visibility || VISIBILITY_LEVEL_PUBLIC_STRING; - return VISIBILITY_LEVELS_STRING_TO_INTEGER[visibility]; - }, - visibilityLevelCap() { - return Math.min(this.projectVisibilityLevel, this.namespaceVisibilityLevel); - }, - restrictedVisibilityLevelsSet() { - return new Set(this.restrictedVisibilityLevels); - }, allowedVisibilityLevels() { - const allowedLevels = Object.entries(VISIBILITY_LEVELS_STRING_TO_INTEGER).reduce( - (levels, [levelName, levelValue]) => { - if ( - !this.restrictedVisibilityLevelsSet.has(levelValue) && - levelValue <= this.visibilityLevelCap - ) { - levels.push(levelName); - } - return levels; - }, - [], - ); - - if (!allowedLevels.length) { - return [VISIBILITY_LEVEL_PRIVATE_STRING]; - } - - return allowedLevels; + return this.getAllowedVisibilityLevels(); }, visibilityLevels() { return [ @@ -178,13 +148,60 @@ export default { return !this.allowedVisibilityLevels.includes(visibility); }, getInitialVisibilityValue() { - return this.restrictedVisibilityLevels.length !== 0 ? null : this.projectVisibility; + return this.getMaximumAllowedVisibilityLevel(this.projectVisibility); }, setNamespace(namespace) { - this.form.fields.visibility.value = - this.restrictedVisibilityLevels.length !== 0 ? null : VISIBILITY_LEVEL_PRIVATE_STRING; this.form.fields.namespace.value = namespace; this.form.fields.namespace.state = true; + this.form.fields.visibility.value = this.getMaximumAllowedVisibilityLevel( + this.form.fields.visibility.value, + ); + }, + getProjectVisibilityLevel() { + return VISIBILITY_LEVELS_STRING_TO_INTEGER[this.projectVisibility]; + }, + getNamespaceVisibilityLevel() { + const visibility = + this.form?.fields?.namespace?.value?.visibility || VISIBILITY_LEVEL_PUBLIC_STRING; + return VISIBILITY_LEVELS_STRING_TO_INTEGER[visibility]; + }, + getVisibilityLevelCap() { + return Math.min(this.getProjectVisibilityLevel(), this.getNamespaceVisibilityLevel()); + }, + getRestrictedVisibilityLevelsSet() { + return new Set(this.restrictedVisibilityLevels); + }, + getAllowedVisibilityLevels() { + const allowedLevels = Object.entries(VISIBILITY_LEVELS_STRING_TO_INTEGER).reduce( + (levels, [levelName, levelValue]) => { + if ( + !this.getRestrictedVisibilityLevelsSet().has(levelValue) && + levelValue <= this.getVisibilityLevelCap() + ) { + levels.push(levelName); + } + return levels; + }, + [], + ); + + if (!allowedLevels.length) { + return [VISIBILITY_LEVEL_PRIVATE_STRING]; + } + + return allowedLevels; + }, + getMaximumAllowedVisibilityLevel(visibility) { + const allowedVisibilities = this.getAllowedVisibilityLevels().map( + (s) => VISIBILITY_LEVELS_STRING_TO_INTEGER[s], + ); + const current = VISIBILITY_LEVELS_STRING_TO_INTEGER[visibility]; + const lower = allowedVisibilities.filter((l) => l <= current); + if (lower.length) { + return VISIBILITY_LEVELS_INTEGER_TO_STRING[Math.max(...lower)]; + } + const higher = allowedVisibilities.filter((l) => l >= current); + return VISIBILITY_LEVELS_INTEGER_TO_STRING[Math.min(...higher)]; }, async onSubmit() { this.form.showValidation = true; diff --git a/app/models/integration.rb b/app/models/integration.rb index dfa3642cfe4..a630a6dee11 100644 --- a/app/models/integration.rb +++ b/app/models/integration.rb @@ -41,7 +41,9 @@ class Integration < ApplicationRecord Integrations::BaseCi Integrations::BaseIssueTracker Integrations::BaseMonitoring + Integrations::BaseSlackNotification Integrations::BaseSlashCommands + Integrations::BaseThirdPartyWiki ].freeze SECTION_TYPE_CONFIGURATION = 'configuration' diff --git a/app/services/ci/job_artifacts/create_service.rb b/app/services/ci/job_artifacts/create_service.rb index 3dc097a8603..ee9982cf3ab 100644 --- a/app/services/ci/job_artifacts/create_service.rb +++ b/app/services/ci/job_artifacts/create_service.rb @@ -16,7 +16,7 @@ module Ci def initialize(job) @job = job @project = job.project - @pipeline = job.pipeline if ::Feature.enabled?(:ci_update_unlocked_job_artifacts, @project) + @pipeline = job.pipeline end def authorize(artifact_type:, filesize: nil) @@ -85,7 +85,7 @@ module Ci expire_in: expire_in } - artifact_attributes[:locked] = pipeline.locked if ::Feature.enabled?(:ci_update_unlocked_job_artifacts, project) + artifact_attributes[:locked] = pipeline.locked artifact = Ci::JobArtifact.new( artifact_attributes.merge( diff --git a/app/services/ci/unlock_artifacts_service.rb b/app/services/ci/unlock_artifacts_service.rb index 574cdae6480..237f1997edb 100644 --- a/app/services/ci/unlock_artifacts_service.rb +++ b/app/services/ci/unlock_artifacts_service.rb @@ -11,42 +11,21 @@ module Ci unlocked_pipeline_artifacts: 0 } - if ::Feature.enabled?(:ci_update_unlocked_job_artifacts, ci_ref.project) - loop do - unlocked_pipelines = [] - unlocked_job_artifacts = [] + loop do + unlocked_pipelines = [] + unlocked_job_artifacts = [] - ::Ci::Pipeline.transaction do - unlocked_pipelines = unlock_pipelines(ci_ref, before_pipeline) - unlocked_job_artifacts = unlock_job_artifacts(unlocked_pipelines) + ::Ci::Pipeline.transaction do + unlocked_pipelines = unlock_pipelines(ci_ref, before_pipeline) + unlocked_job_artifacts = unlock_job_artifacts(unlocked_pipelines) - results[:unlocked_pipeline_artifacts] += unlock_pipeline_artifacts(unlocked_pipelines) - end + results[:unlocked_pipeline_artifacts] += unlock_pipeline_artifacts(unlocked_pipelines) + end - break if unlocked_pipelines.empty? + break if unlocked_pipelines.empty? - results[:unlocked_pipelines] += unlocked_pipelines.length - results[:unlocked_job_artifacts] += unlocked_job_artifacts.length - end - else - query = <<~SQL.squish - UPDATE "ci_pipelines" - SET "locked" = #{::Ci::Pipeline.lockeds[:unlocked]} - WHERE "ci_pipelines"."id" in ( - #{collect_pipelines(ci_ref, before_pipeline).select(:id).to_sql} - LIMIT #{BATCH_SIZE} - FOR UPDATE SKIP LOCKED - ) - RETURNING "ci_pipelines"."id"; - SQL - - loop do - unlocked_pipelines = Ci::Pipeline.connection.exec_query(query) - - break if unlocked_pipelines.empty? - - results[:unlocked_pipelines] += unlocked_pipelines.length - end + results[:unlocked_pipelines] += unlocked_pipelines.length + results[:unlocked_job_artifacts] += unlocked_job_artifacts.length end results @@ -88,13 +67,6 @@ module Ci private - def collect_pipelines(ci_ref, before_pipeline) - pipeline_scope = ci_ref.pipelines - pipeline_scope = pipeline_scope.before_pipeline(before_pipeline) if before_pipeline - - pipeline_scope.artifacts_locked - end - def unlock_job_artifacts(pipelines) return if pipelines.empty? diff --git a/config/feature_flags/development/ci_update_unlocked_job_artifacts.yml b/config/feature_flags/development/ci_update_unlocked_job_artifacts.yml deleted file mode 100644 index 7cb79c05774..00000000000 --- a/config/feature_flags/development/ci_update_unlocked_job_artifacts.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: ci_update_unlocked_job_artifacts -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70235 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/343465 -milestone: '14.5' -type: development -group: group::pipeline insights -default_enabled: true diff --git a/db/post_migrate/20221104115712_backfill_project_statistics_storage_size_without_uploads_size.rb b/db/post_migrate/20221104115712_backfill_project_statistics_storage_size_without_uploads_size.rb new file mode 100644 index 00000000000..9dd64a3e7b5 --- /dev/null +++ b/db/post_migrate/20221104115712_backfill_project_statistics_storage_size_without_uploads_size.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +class BackfillProjectStatisticsStorageSizeWithoutUploadsSize < Gitlab::Database::Migration[2.0] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + DELAY_INTERVAL = 2.minutes.to_i + BATCH_SIZE = 500 + MIGRATION_CLASS = 'BackfillProjectStatisticsStorageSizeWithoutUploadsSize' + SUB_BATCH_SIZE = 100 + + disable_ddl_transaction! + + def up + return unless Gitlab.dev_or_test_env? || Gitlab.org_or_com? + + queue_batched_background_migration( + MIGRATION_CLASS, + :project_statistics, + :project_id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + return unless Gitlab.dev_or_test_env? || Gitlab.org_or_com? + + delete_batched_background_migration(MIGRATION_CLASS, :project_statistics, :project_id, []) + end +end diff --git a/db/schema_migrations/20221104115712 b/db/schema_migrations/20221104115712 new file mode 100644 index 00000000000..c3b87b343d9 --- /dev/null +++ b/db/schema_migrations/20221104115712 @@ -0,0 +1 @@ +61322973112a2450036fbbd6e329105ff16d5dc5efac72c75c152bcf87a84aeb
\ No newline at end of file diff --git a/doc/ci/testing/code_quality.md b/doc/ci/testing/code_quality.md index 6b736f5c487..8e1c3d72d3d 100644 --- a/doc/ci/testing/code_quality.md +++ b/doc/ci/testing/code_quality.md @@ -71,6 +71,7 @@ See also the Code Climate list of [Supported Languages for Maintainability](http > - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/284140) in GitLab 13.12. > - [Disabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/2526) in GitLab 14.0 due to [this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/334116). > - [Inline annotation added](https://gitlab.com/gitlab-org/gitlab/-/issues/2526) and [feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/284140) in GitLab 14.1. +> - [Updated](https://gitlab.com/groups/gitlab-org/-/epics/8071) to handle multiple findings better in GitLab 15.7, disabled by default behind the `refactor_code_quality_inline_findings` [feature flag](../../administration/feature_flags.md). Changes to files in merge requests can cause Code Quality to fall if merged. In these cases, the merge request's diff view displays an indicator next to lines with new Code Quality violations. For example: diff --git a/doc/install/installation.md b/doc/install/installation.md index 39fb6e3ae95..1191b32181e 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -47,11 +47,11 @@ If the highest number stable branch is unclear, check the [GitLab blog](https:// ## Software requirements | Software | Minimum version | Notes | -| ------------------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| ------------------ | --------------- |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Ruby](#2-ruby) | `2.7` | From GitLab 13.6, Ruby 2.7 is required. Ruby 3.0 is not supported yet (see [the relevant epic](https://gitlab.com/groups/gitlab-org/-/epics/5149) for the current status). You must use the standard MRI implementation of Ruby. We love [JRuby](https://www.jruby.org/) and [Rubinius](https://github.com/rubinius/rubinius#the-rubinius-language-platform), but GitLab needs several Gems that have native extensions. | | [Go](#3-go) | `1.18` | From GitLab 15.6, Go 1.18 or later is required. | | [Git](#git) | `2.37.x` | From GitLab 15.6, Git 2.37.x and later is required. It's highly recommended that you use the [Git version provided by Gitaly](#git). | -| [Node.js](#4-node) | `14.15.0` | GitLab uses [webpack](https://webpack.js.org/) to compile frontend assets. Node.js 16.x is recommended, as it's faster. You can check which version you're running with `node -v`. You must update it to a newer version if needed. | +| [Node.js](#4-node) | `16.15.0` | From GitLab 15.7, Node.js 16.15.0 or later is required. | ## GitLab directory structure @@ -263,7 +263,8 @@ GitLab requires the use of Node to compile JavaScript assets, and Yarn to manage JavaScript dependencies. The current minimum requirements for these are: -- `node` >= v14.15.0. (We recommend node 16.x as it is faster) +- `node` 16.x releases (v16.15.0 or later). + [Other LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) might be able to build assets, but we only guarantee Node.js 16.x. - `yarn` = v1.22.x (Yarn 2 is not supported yet) In many distributions, diff --git a/doc/user/group/saml_sso/group_sync.md b/doc/user/group/saml_sso/group_sync.md index 6447d8ab750..94fd1253b09 100644 --- a/doc/user/group/saml_sso/group_sync.md +++ b/doc/user/group/saml_sso/group_sync.md @@ -35,7 +35,8 @@ To configure SAML Group Sync: - For GitLab.com, named `Groups` or `groups`. NOTE: -The value for `Groups` or `groups` in the SAML response can be either the group name or the group ID. +The value for `Groups` or `groups` in the SAML response may be either the group name or an ID. +For example, Azure AD sends the Azure Group Object ID instead of the name. Use the ID value when configuring [SAML Group Links](#configure-saml-group-links). ```xml <saml:AttributeStatement> @@ -59,7 +60,7 @@ a SAML identity provider group name to a GitLab role. This can be done for a top To link the SAML groups: -1. In **SAML Group Name**, enter the value of the relevant `saml:AttributeValue`. +1. In **SAML Group Name**, enter the value of the relevant `saml:AttributeValue`. The value entered here must exactly match the value sent in the SAML response. For some IdPs, this may be a group ID or object ID (Azure AD) instead of a friendly group name. 1. Choose the role in **Access Level**. 1. Select **Save**. 1. Repeat to add additional group links if required. diff --git a/lib/gitlab/background_migration/backfill_project_statistics_storage_size_without_uploads_size.rb b/lib/gitlab/background_migration/backfill_project_statistics_storage_size_without_uploads_size.rb new file mode 100644 index 00000000000..1a3dd88ea31 --- /dev/null +++ b/lib/gitlab/background_migration/backfill_project_statistics_storage_size_without_uploads_size.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Gitlab + module BackgroundMigration + # Back-fill storage_size for project_statistics + class BackfillProjectStatisticsStorageSizeWithoutUploadsSize < Gitlab::BackgroundMigration::BatchedMigrationJob + def perform + # no-op + end + end + end +end + +Gitlab::BackgroundMigration::BackfillProjectStatisticsStorageSizeWithoutUploadsSize.prepend_mod_with('Gitlab::BackgroundMigration::BackfillProjectStatisticsStorageSizeWithoutUploadsSize') # rubocop:disable Layout/LineLength diff --git a/scripts/review_apps/review-apps.sh b/scripts/review_apps/review-apps.sh index 1481cecba74..e185ed43e38 100755 --- a/scripts/review_apps/review-apps.sh +++ b/scripts/review_apps/review-apps.sh @@ -373,7 +373,9 @@ function display_deployment_debug() { local namespace="${CI_ENVIRONMENT_SLUG}" # Install dig to inspect DNS entries - apt update && apt install -y dnsutils + # + # Silent install: see https://stackoverflow.com/a/52642167/1620195 + apt-get -qq update && apt-get -qq install -y dnsutils < /dev/null > /dev/null echoinfo "[debugging data] Check review-app webservice DNS entry:" dig +short $(echo "${CI_ENVIRONMENT_URL}" | sed 's~http[s]*://~~g') diff --git a/spec/frontend/pages/projects/forks/new/components/fork_form_spec.js b/spec/frontend/pages/projects/forks/new/components/fork_form_spec.js index 727c5164cdc..9718d847ed5 100644 --- a/spec/frontend/pages/projects/forks/new/components/fork_form_spec.js +++ b/spec/frontend/pages/projects/forks/new/components/fork_form_spec.js @@ -1,5 +1,5 @@ import { GlFormInputGroup, GlFormInput, GlForm, GlFormRadioGroup, GlFormRadio } from '@gitlab/ui'; -import { getByRole, getAllByRole } from '@testing-library/dom'; +import { getByRole } from '@testing-library/dom'; import { mount, shallowMount } from '@vue/test-utils'; import axios from 'axios'; import AxiosMockAdapter from 'axios-mock-adapter'; @@ -133,10 +133,15 @@ describe('ForkForm component', () => { expect(cancelButton.attributes('href')).toBe(projectFullPath); }); - const selectedMockNamespace = { name: 'two', full_name: 'two-group/two', id: 2 }; + const selectedMockNamespace = { + name: 'two', + full_name: 'two-group/two', + id: 2, + visibility: 'public', + }; - const fillForm = () => { - findForkUrlInput().vm.$emit('select', selectedMockNamespace); + const fillForm = (namespace = selectedMockNamespace) => { + findForkUrlInput().vm.$emit('select', namespace); }; it('has input with csrf token', () => { @@ -226,66 +231,139 @@ describe('ForkForm component', () => { }, ]; - it('resets the visibility to default "private"', async () => { + it('resets the visibility to max allowed below current level', async () => { + createFullComponent({ projectVisibility: 'public' }, { namespaces }); + + expect(wrapper.vm.form.fields.visibility.value).toBe('public'); + + fillForm({ + name: 'one', + id: 1, + visibility: 'internal', + }); + await nextTick(); + + expect(getByRole(wrapper.element, 'radio', { name: /internal/i }).checked).toBe(true); + }); + + it('does not reset the visibility when current level is allowed', async () => { + createFullComponent({ projectVisibility: 'public' }, { namespaces }); + + expect(wrapper.vm.form.fields.visibility.value).toBe('public'); + + fillForm({ + name: 'two', + id: 2, + visibility: 'public', + }); + await nextTick(); + + expect(getByRole(wrapper.element, 'radio', { name: /public/i }).checked).toBe(true); + }); + + it('does not reset the visibility when visibility cap is increased', async () => { createFullComponent({ projectVisibility: 'public' }, { namespaces }); expect(wrapper.vm.form.fields.visibility.value).toBe('public'); - fillForm(); + fillForm({ + name: 'three', + id: 3, + visibility: 'internal', + }); + await nextTick(); + + fillForm({ + name: 'four', + id: 4, + visibility: 'public', + }); + await nextTick(); + + expect(getByRole(wrapper.element, 'radio', { name: /internal/i }).checked).toBe(true); + }); + + it('sets the visibility to be next highest from current when restrictedVisibilityLevels is set', async () => { + createFullComponent( + { projectVisibility: 'public', restrictedVisibilityLevels: [10] }, + { namespaces }, + ); + + wrapper.vm.form.fields.visibility.value = 'internal'; + fillForm({ + name: 'five', + id: 5, + visibility: 'public', + }); await nextTick(); expect(getByRole(wrapper.element, 'radio', { name: /private/i }).checked).toBe(true); }); - it('sets the visibility to be null when restrictedVisibilityLevels is set', async () => { - createFullComponent({ restrictedVisibilityLevels: [10] }, { namespaces }); + it('sets the visibility to be next lowest from current when nothing lower is allowed', async () => { + createFullComponent( + { projectVisibility: 'public', restrictedVisibilityLevels: [0] }, + { namespaces }, + ); + + fillForm({ + name: 'six', + id: 6, + visibility: 'private', + }); + await nextTick(); + + expect(getByRole(wrapper.element, 'radio', { name: /private/i }).checked).toBe(true); - fillForm(); + fillForm({ + name: 'six', + id: 6, + visibility: 'public', + }); await nextTick(); - const container = getByRole(wrapper.element, 'radiogroup', { name: /visibility/i }); - const visibilityRadios = getAllByRole(container, 'radio'); - expect(visibilityRadios.filter((e) => e.checked)).toHaveLength(0); + expect(getByRole(wrapper.element, 'radio', { name: /internal/i }).checked).toBe(true); }); }); it.each` - project | restrictedVisibilityLevels - ${'private'} | ${[]} - ${'internal'} | ${[]} - ${'public'} | ${[]} - ${'private'} | ${[0]} - ${'private'} | ${[10]} - ${'private'} | ${[20]} - ${'private'} | ${[0, 10]} - ${'private'} | ${[0, 20]} - ${'private'} | ${[10, 20]} - ${'private'} | ${[0, 10, 20]} - ${'internal'} | ${[0]} - ${'internal'} | ${[10]} - ${'internal'} | ${[20]} - ${'internal'} | ${[0, 10]} - ${'internal'} | ${[0, 20]} - ${'internal'} | ${[10, 20]} - ${'internal'} | ${[0, 10, 20]} - ${'public'} | ${[0]} - ${'public'} | ${[10]} - ${'public'} | ${[0, 10]} - ${'public'} | ${[0, 20]} - ${'public'} | ${[10, 20]} - ${'public'} | ${[0, 10, 20]} - `('checks the correct radio button', ({ project, restrictedVisibilityLevels }) => { - createFullComponent({ - projectVisibility: project, - restrictedVisibilityLevels, - }); + project | restrictedVisibilityLevels | computedVisibilityLevel + ${'private'} | ${[]} | ${'private'} + ${'internal'} | ${[]} | ${'internal'} + ${'public'} | ${[]} | ${'public'} + ${'private'} | ${[0]} | ${'private'} + ${'private'} | ${[10]} | ${'private'} + ${'private'} | ${[20]} | ${'private'} + ${'private'} | ${[0, 10]} | ${'private'} + ${'private'} | ${[0, 20]} | ${'private'} + ${'private'} | ${[10, 20]} | ${'private'} + ${'private'} | ${[0, 10, 20]} | ${'private'} + ${'internal'} | ${[0]} | ${'internal'} + ${'internal'} | ${[10]} | ${'private'} + ${'internal'} | ${[20]} | ${'internal'} + ${'internal'} | ${[0, 10]} | ${'private'} + ${'internal'} | ${[0, 20]} | ${'internal'} + ${'internal'} | ${[10, 20]} | ${'private'} + ${'internal'} | ${[0, 10, 20]} | ${'private'} + ${'public'} | ${[0]} | ${'public'} + ${'public'} | ${[10]} | ${'public'} + ${'public'} | ${[0, 10]} | ${'public'} + ${'public'} | ${[0, 20]} | ${'internal'} + ${'public'} | ${[10, 20]} | ${'private'} + ${'public'} | ${[0, 10, 20]} | ${'private'} + `( + 'checks the correct radio button', + ({ project, restrictedVisibilityLevels, computedVisibilityLevel }) => { + createFullComponent({ + projectVisibility: project, + restrictedVisibilityLevels, + }); - if (restrictedVisibilityLevels.length === 0) { - expect(wrapper.find('[name="visibility"]:checked').attributes('value')).toBe(project); - } else { - expect(wrapper.find('[name="visibility"]:checked').exists()).toBe(false); - } - }); + expect(wrapper.find('[name="visibility"]:checked').attributes('value')).toBe( + computedVisibilityLevel, + ); + }, + ); it.each` project | namespace | privateIsDisabled | internalIsDisabled | publicIsDisabled | restrictedVisibilityLevels diff --git a/spec/migrations/20221104115712_backfill_project_statistics_storage_size_without_uploads_size_spec.rb b/spec/migrations/20221104115712_backfill_project_statistics_storage_size_without_uploads_size_spec.rb new file mode 100644 index 00000000000..cc807951d3e --- /dev/null +++ b/spec/migrations/20221104115712_backfill_project_statistics_storage_size_without_uploads_size_spec.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +require 'spec_helper' +require_migration! + +RSpec.describe BackfillProjectStatisticsStorageSizeWithoutUploadsSize, feature_category: :subscription_usage_reports do + let!(:batched_migration) { described_class::MIGRATION_CLASS } + + it 'does not schedule background jobs when Gitlab.org_or_com? is false' do + allow(Gitlab).to receive(:dev_or_test_env?).and_return(false) + allow(Gitlab).to receive(:org_or_com?).and_return(false) + + reversible_migration do |migration| + migration.before -> { + expect(batched_migration).not_to have_scheduled_batched_migration + } + + migration.after -> { + expect(batched_migration).not_to have_scheduled_batched_migration + } + end + end + + it 'schedules background jobs for each batch of project_statistics' do + allow(Gitlab).to receive(:dev_or_test_env?).and_return(false) + allow(Gitlab).to receive(:org_or_com?).and_return(true) + + reversible_migration do |migration| + migration.before -> { + expect(batched_migration).not_to have_scheduled_batched_migration + } + + migration.after -> { + expect(batched_migration).to have_scheduled_batched_migration( + table_name: :project_statistics, + column_name: :project_id, + interval: described_class::DELAY_INTERVAL + ) + } + end + end +end diff --git a/spec/migrations/add_default_project_approval_rules_vuln_allowed_spec.rb b/spec/migrations/add_default_project_approval_rules_vuln_allowed_spec.rb index 057e95eb158..a6c892db131 100644 --- a/spec/migrations/add_default_project_approval_rules_vuln_allowed_spec.rb +++ b/spec/migrations/add_default_project_approval_rules_vuln_allowed_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe AddDefaultProjectApprovalRulesVulnAllowed do +RSpec.describe AddDefaultProjectApprovalRulesVulnAllowed, feature_category: :source_code_management do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:namespace) { namespaces.create!(name: 'namespace', path: 'namespace') } diff --git a/spec/migrations/add_epics_relative_position_spec.rb b/spec/migrations/add_epics_relative_position_spec.rb index f3b7dd1727b..bdfaacc2bf8 100644 --- a/spec/migrations/add_epics_relative_position_spec.rb +++ b/spec/migrations/add_epics_relative_position_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe AddEpicsRelativePosition, :migration do +RSpec.describe AddEpicsRelativePosition, :migration, feature_category: :portfolio_management do let(:groups) { table(:namespaces) } let(:epics) { table(:epics) } let(:users) { table(:users) } diff --git a/spec/migrations/add_new_trail_plans_spec.rb b/spec/migrations/add_new_trail_plans_spec.rb index c1b488e8c3c..6f8de8435c6 100644 --- a/spec/migrations/add_new_trail_plans_spec.rb +++ b/spec/migrations/add_new_trail_plans_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe AddNewTrailPlans, :migration do +RSpec.describe AddNewTrailPlans, :migration, feature_category: :purchase do describe '#up' do before do allow(Gitlab).to receive(:com?).and_return true diff --git a/spec/migrations/add_open_source_plan_spec.rb b/spec/migrations/add_open_source_plan_spec.rb index 6e1cd544141..f5d68f455e6 100644 --- a/spec/migrations/add_open_source_plan_spec.rb +++ b/spec/migrations/add_open_source_plan_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe AddOpenSourcePlan, :migration do +RSpec.describe AddOpenSourcePlan, :migration, feature_category: :purchase do describe '#up' do before do allow(Gitlab).to receive(:com?).and_return true diff --git a/spec/migrations/add_premium_and_ultimate_plan_limits_spec.rb b/spec/migrations/add_premium_and_ultimate_plan_limits_spec.rb index 0ae4559ca9f..670541128a0 100644 --- a/spec/migrations/add_premium_and_ultimate_plan_limits_spec.rb +++ b/spec/migrations/add_premium_and_ultimate_plan_limits_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe AddPremiumAndUltimatePlanLimits, :migration do +RSpec.describe AddPremiumAndUltimatePlanLimits, :migration, feature_category: :purchase do shared_examples_for 'a migration that does not alter plans or plan limits' do it do expect { migrate! }.not_to change { diff --git a/spec/migrations/add_triggers_to_integrations_type_new_spec.rb b/spec/migrations/add_triggers_to_integrations_type_new_spec.rb index 01af5884170..4fa5fe31d2b 100644 --- a/spec/migrations/add_triggers_to_integrations_type_new_spec.rb +++ b/spec/migrations/add_triggers_to_integrations_type_new_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe AddTriggersToIntegrationsTypeNew do +RSpec.describe AddTriggersToIntegrationsTypeNew, feature_category: :purchase do let(:migration) { described_class.new } let(:integrations) { table(:integrations) } diff --git a/spec/migrations/add_upvotes_count_index_to_issues_spec.rb b/spec/migrations/add_upvotes_count_index_to_issues_spec.rb index c04cb98a107..0012b8a0b96 100644 --- a/spec/migrations/add_upvotes_count_index_to_issues_spec.rb +++ b/spec/migrations/add_upvotes_count_index_to_issues_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe AddUpvotesCountIndexToIssues do +RSpec.describe AddUpvotesCountIndexToIssues, feature_category: :team_planning do let(:migration_instance) { described_class.new } describe '#up' do diff --git a/spec/migrations/add_web_hook_calls_to_plan_limits_paid_tiers_spec.rb b/spec/migrations/add_web_hook_calls_to_plan_limits_paid_tiers_spec.rb index 90d8c91c047..0ad99be1c7b 100644 --- a/spec/migrations/add_web_hook_calls_to_plan_limits_paid_tiers_spec.rb +++ b/spec/migrations/add_web_hook_calls_to_plan_limits_paid_tiers_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe AddWebHookCallsToPlanLimitsPaidTiers do +RSpec.describe AddWebHookCallsToPlanLimitsPaidTiers, feature_category: :purchase do let!(:plans) { table(:plans) } let!(:plan_limits) { table(:plan_limits) } diff --git a/spec/migrations/adjust_task_note_rename_background_migration_values_spec.rb b/spec/migrations/adjust_task_note_rename_background_migration_values_spec.rb index 422d0655e36..01680fa12cc 100644 --- a/spec/migrations/adjust_task_note_rename_background_migration_values_spec.rb +++ b/spec/migrations/adjust_task_note_rename_background_migration_values_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe AdjustTaskNoteRenameBackgroundMigrationValues, :migration do +RSpec.describe AdjustTaskNoteRenameBackgroundMigrationValues, :migration, feature_category: :team_planning do let(:finished_status) { 3 } let(:failed_status) { described_class::MIGRATION_FAILED_STATUS } let(:active_status) { described_class::MIGRATION_ACTIVE_STATUS } diff --git a/spec/migrations/associate_existing_dast_builds_with_variables_spec.rb b/spec/migrations/associate_existing_dast_builds_with_variables_spec.rb index dd86989912f..67d215c781b 100644 --- a/spec/migrations/associate_existing_dast_builds_with_variables_spec.rb +++ b/spec/migrations/associate_existing_dast_builds_with_variables_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe AssociateExistingDastBuildsWithVariables do +RSpec.describe AssociateExistingDastBuildsWithVariables, feature_category: :dynamic_application_security_testing do it 'is a no-op' do migrate! end diff --git a/spec/migrations/backfill_all_project_namespaces_spec.rb b/spec/migrations/backfill_all_project_namespaces_spec.rb index bc968ee905e..52fa46eea57 100644 --- a/spec/migrations/backfill_all_project_namespaces_spec.rb +++ b/spec/migrations/backfill_all_project_namespaces_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe BackfillAllProjectNamespaces, :migration do +RSpec.describe BackfillAllProjectNamespaces, :migration, feature_category: :subgroups do let!(:migration) { described_class::MIGRATION } let(:projects) { table(:projects) } diff --git a/spec/migrations/backfill_cadence_id_for_boards_scoped_to_iteration_spec.rb b/spec/migrations/backfill_cadence_id_for_boards_scoped_to_iteration_spec.rb index 16a08ec47c4..a9500b9f942 100644 --- a/spec/migrations/backfill_cadence_id_for_boards_scoped_to_iteration_spec.rb +++ b/spec/migrations/backfill_cadence_id_for_boards_scoped_to_iteration_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe BackfillCadenceIdForBoardsScopedToIteration, :migration do +RSpec.describe BackfillCadenceIdForBoardsScopedToIteration, :migration, feature_category: :team_planning do let(:projects) { table(:projects) } let(:namespaces) { table(:namespaces) } let(:iterations_cadences) { table(:iterations_cadences) } diff --git a/spec/migrations/backfill_clusters_integration_prometheus_enabled_spec.rb b/spec/migrations/backfill_clusters_integration_prometheus_enabled_spec.rb index 6c116120f05..1c7745a64ef 100644 --- a/spec/migrations/backfill_clusters_integration_prometheus_enabled_spec.rb +++ b/spec/migrations/backfill_clusters_integration_prometheus_enabled_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe BackfillClustersIntegrationPrometheusEnabled, :migration do +RSpec.describe BackfillClustersIntegrationPrometheusEnabled, :migration, feature_category: :clusters_applications_prometheus do def create_cluster!(label = rand(2**64).to_s) table(:clusters).create!( name: "cluster: #{label}", diff --git a/spec/migrations/backfill_cycle_analytics_aggregations_spec.rb b/spec/migrations/backfill_cycle_analytics_aggregations_spec.rb index 2a5d33742ce..47950f918c3 100644 --- a/spec/migrations/backfill_cycle_analytics_aggregations_spec.rb +++ b/spec/migrations/backfill_cycle_analytics_aggregations_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe BackfillCycleAnalyticsAggregations, :migration do +RSpec.describe BackfillCycleAnalyticsAggregations, :migration, feature_category: :value_stream_management do let(:migration) { described_class.new } let(:aggregations) { table(:analytics_cycle_analytics_aggregations) } diff --git a/spec/migrations/backfill_epic_cache_counts_spec.rb b/spec/migrations/backfill_epic_cache_counts_spec.rb index 6084fdad0a6..1dc0079bb01 100644 --- a/spec/migrations/backfill_epic_cache_counts_spec.rb +++ b/spec/migrations/backfill_epic_cache_counts_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe BackfillEpicCacheCounts, :migration do +RSpec.describe BackfillEpicCacheCounts, :migration, feature_category: :portfolio_management do let(:migration) { described_class::MIGRATION } describe '#up' do diff --git a/spec/migrations/backfill_escalation_policies_for_oncall_schedules_spec.rb b/spec/migrations/backfill_escalation_policies_for_oncall_schedules_spec.rb index 413e88d633d..aa77a5c228a 100644 --- a/spec/migrations/backfill_escalation_policies_for_oncall_schedules_spec.rb +++ b/spec/migrations/backfill_escalation_policies_for_oncall_schedules_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe BackfillEscalationPoliciesForOncallSchedules do +RSpec.describe BackfillEscalationPoliciesForOncallSchedules, feature_category: :incident_management do let!(:projects) { table(:projects) } let!(:schedules) { table(:incident_management_oncall_schedules) } let!(:policies) { table(:incident_management_escalation_policies) } diff --git a/spec/migrations/backfill_group_features_spec.rb b/spec/migrations/backfill_group_features_spec.rb index 922d54f43be..1e7729a97d8 100644 --- a/spec/migrations/backfill_group_features_spec.rb +++ b/spec/migrations/backfill_group_features_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe BackfillGroupFeatures, :migration do +RSpec.describe BackfillGroupFeatures, :migration, feature_category: :feature_flags do let(:migration) { described_class::MIGRATION } describe '#up' do diff --git a/spec/migrations/backfill_integrations_enable_ssl_verification_spec.rb b/spec/migrations/backfill_integrations_enable_ssl_verification_spec.rb index 84e58227f07..5029a861d31 100644 --- a/spec/migrations/backfill_integrations_enable_ssl_verification_spec.rb +++ b/spec/migrations/backfill_integrations_enable_ssl_verification_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe BackfillIntegrationsEnableSslVerification do +RSpec.describe BackfillIntegrationsEnableSslVerification, feature_category: :authentication_and_authorization do let!(:migration) { described_class::MIGRATION } let!(:integrations) { described_class::Integration } diff --git a/spec/migrations/backfill_integrations_type_new_spec.rb b/spec/migrations/backfill_integrations_type_new_spec.rb index 1614fd74b1c..79519c4439a 100644 --- a/spec/migrations/backfill_integrations_type_new_spec.rb +++ b/spec/migrations/backfill_integrations_type_new_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe BackfillIntegrationsTypeNew do +RSpec.describe BackfillIntegrationsTypeNew, feature_category: :integrations do let!(:migration) { described_class::MIGRATION } let!(:integrations) { table(:integrations) } diff --git a/spec/migrations/backfill_issues_upvotes_count_spec.rb b/spec/migrations/backfill_issues_upvotes_count_spec.rb index 94cfa29ae89..b8687595b35 100644 --- a/spec/migrations/backfill_issues_upvotes_count_spec.rb +++ b/spec/migrations/backfill_issues_upvotes_count_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe BackfillIssuesUpvotesCount do +RSpec.describe BackfillIssuesUpvotesCount, feature_category: :team_planning do let(:migration) { described_class.new } let(:issues) { table(:issues) } let(:award_emoji) { table(:award_emoji) } diff --git a/spec/migrations/backfill_member_namespace_id_for_group_members_spec.rb b/spec/migrations/backfill_member_namespace_id_for_group_members_spec.rb index c583d82e4ac..892589dd770 100644 --- a/spec/migrations/backfill_member_namespace_id_for_group_members_spec.rb +++ b/spec/migrations/backfill_member_namespace_id_for_group_members_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe BackfillMemberNamespaceIdForGroupMembers do +RSpec.describe BackfillMemberNamespaceIdForGroupMembers, feature_category: :subgroups do let!(:migration) { described_class::MIGRATION } describe '#up' do diff --git a/spec/migrations/backfill_namespace_id_for_namespace_routes_spec.rb b/spec/migrations/backfill_namespace_id_for_namespace_routes_spec.rb index e2d799bcac5..627b18cd889 100644 --- a/spec/migrations/backfill_namespace_id_for_namespace_routes_spec.rb +++ b/spec/migrations/backfill_namespace_id_for_namespace_routes_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe BackfillNamespaceIdForNamespaceRoutes do +RSpec.describe BackfillNamespaceIdForNamespaceRoutes, feature_category: :projects do let!(:migration) { described_class::MIGRATION } describe '#up' do diff --git a/spec/migrations/backfill_namespace_id_for_project_routes_spec.rb b/spec/migrations/backfill_namespace_id_for_project_routes_spec.rb index 28edd17731f..773c1733a4a 100644 --- a/spec/migrations/backfill_namespace_id_for_project_routes_spec.rb +++ b/spec/migrations/backfill_namespace_id_for_project_routes_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe BackfillNamespaceIdForProjectRoutes, :migration do +RSpec.describe BackfillNamespaceIdForProjectRoutes, :migration, feature_category: :subgroups do let(:migration) { described_class::MIGRATION } describe '#up' do diff --git a/spec/migrations/backfill_namespace_id_on_issues_spec.rb b/spec/migrations/backfill_namespace_id_on_issues_spec.rb index 2721d7ce8f1..28453394cb0 100644 --- a/spec/migrations/backfill_namespace_id_on_issues_spec.rb +++ b/spec/migrations/backfill_namespace_id_on_issues_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe BackfillNamespaceIdOnIssues, :migration do +RSpec.describe BackfillNamespaceIdOnIssues, :migration, feature_category: :team_planning do let(:migration) { described_class::MIGRATION } describe '#up' do diff --git a/spec/migrations/backfill_nuget_temporary_packages_to_processing_status_spec.rb b/spec/migrations/backfill_nuget_temporary_packages_to_processing_status_spec.rb index 574020e52d5..ae2656eaf98 100644 --- a/spec/migrations/backfill_nuget_temporary_packages_to_processing_status_spec.rb +++ b/spec/migrations/backfill_nuget_temporary_packages_to_processing_status_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe BackfillNugetTemporaryPackagesToProcessingStatus, :migration do +RSpec.describe BackfillNugetTemporaryPackagesToProcessingStatus, :migration, feature_category: :package_registry do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:packages) { table(:packages_packages) } diff --git a/spec/migrations/backfill_project_import_level_spec.rb b/spec/migrations/backfill_project_import_level_spec.rb index 2e78e205a13..b41e323a92f 100644 --- a/spec/migrations/backfill_project_import_level_spec.rb +++ b/spec/migrations/backfill_project_import_level_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe BackfillProjectImportLevel do +RSpec.describe BackfillProjectImportLevel, feature_category: :importers do let!(:batched_migration) { described_class::MIGRATION } describe '#up' do diff --git a/spec/migrations/backfill_project_namespaces_for_group_spec.rb b/spec/migrations/backfill_project_namespaces_for_group_spec.rb index c039e8e0a58..b21ed6e1aa2 100644 --- a/spec/migrations/backfill_project_namespaces_for_group_spec.rb +++ b/spec/migrations/backfill_project_namespaces_for_group_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe BackfillProjectNamespacesForGroup do +RSpec.describe BackfillProjectNamespacesForGroup, feature_category: :subgroups do let!(:migration) { described_class::MIGRATION } let(:projects) { table(:projects) } diff --git a/spec/migrations/backfill_stage_event_hash_spec.rb b/spec/migrations/backfill_stage_event_hash_spec.rb index cecaddcd3d4..399a9c4dfde 100644 --- a/spec/migrations/backfill_stage_event_hash_spec.rb +++ b/spec/migrations/backfill_stage_event_hash_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe BackfillStageEventHash, schema: 20210730103808 do +RSpec.describe BackfillStageEventHash, schema: 20210730103808, feature_category: :value_stream_management do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:labels) { table(:labels) } diff --git a/spec/migrations/backfill_user_namespace_spec.rb b/spec/migrations/backfill_user_namespace_spec.rb index 2f1fce78373..a58030803b1 100644 --- a/spec/migrations/backfill_user_namespace_spec.rb +++ b/spec/migrations/backfill_user_namespace_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe BackfillUserNamespace do +RSpec.describe BackfillUserNamespace, feature_category: :subgroups do let!(:migration) { described_class::MIGRATION } describe '#up' do diff --git a/spec/migrations/bulk_insert_cluster_enabled_grants_spec.rb b/spec/migrations/bulk_insert_cluster_enabled_grants_spec.rb index a359a78ab45..e85489198ee 100644 --- a/spec/migrations/bulk_insert_cluster_enabled_grants_spec.rb +++ b/spec/migrations/bulk_insert_cluster_enabled_grants_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe BulkInsertClusterEnabledGrants, :migration do +RSpec.describe BulkInsertClusterEnabledGrants, :migration, feature_category: :kubernetes_management do let(:migration) { described_class.new } let(:cluster_enabled_grants) { table(:cluster_enabled_grants) } diff --git a/spec/migrations/change_public_projects_cost_factor_spec.rb b/spec/migrations/change_public_projects_cost_factor_spec.rb index 039edda750b..656c8a45c57 100644 --- a/spec/migrations/change_public_projects_cost_factor_spec.rb +++ b/spec/migrations/change_public_projects_cost_factor_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe ChangePublicProjectsCostFactor, migration: :gitlab_ci do +RSpec.describe ChangePublicProjectsCostFactor, migration: :gitlab_ci, feature_category: :runner do let(:runners) { table(:ci_runners) } let!(:shared_1) { runners.create!(runner_type: 1, public_projects_minutes_cost_factor: 0) } diff --git a/spec/migrations/change_task_system_note_wording_to_checklist_item_spec.rb b/spec/migrations/change_task_system_note_wording_to_checklist_item_spec.rb index 039ee92f8bd..421c519b2bc 100644 --- a/spec/migrations/change_task_system_note_wording_to_checklist_item_spec.rb +++ b/spec/migrations/change_task_system_note_wording_to_checklist_item_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe ChangeTaskSystemNoteWordingToChecklistItem, :migration do +RSpec.describe ChangeTaskSystemNoteWordingToChecklistItem, :migration, feature_category: :team_planning do let(:migration) { described_class::MIGRATION } describe '#up' do diff --git a/spec/migrations/change_web_hook_events_default_spec.rb b/spec/migrations/change_web_hook_events_default_spec.rb index aad187187d0..c6c3f285ff1 100644 --- a/spec/migrations/change_web_hook_events_default_spec.rb +++ b/spec/migrations/change_web_hook_events_default_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe ChangeWebHookEventsDefault do +RSpec.describe ChangeWebHookEventsDefault, feature_category: :integrations do let(:web_hooks) { table(:web_hooks) } let(:projects) { table(:projects) } let(:groups) { table(:namespaces) } diff --git a/spec/migrations/clean_up_pending_builds_table_spec.rb b/spec/migrations/clean_up_pending_builds_table_spec.rb index 17e62e1b486..e044d4a702b 100644 --- a/spec/migrations/clean_up_pending_builds_table_spec.rb +++ b/spec/migrations/clean_up_pending_builds_table_spec.rb @@ -3,7 +3,8 @@ require 'spec_helper' require_migration! -RSpec.describe CleanUpPendingBuildsTable, :suppress_gitlab_schemas_validate_connection do +RSpec.describe CleanUpPendingBuildsTable, :suppress_gitlab_schemas_validate_connection, +feature_category: :continuous_integration do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:queue) { table(:ci_pending_builds) } diff --git a/spec/migrations/cleanup_after_add_primary_email_to_emails_if_user_confirmed_spec.rb b/spec/migrations/cleanup_after_add_primary_email_to_emails_if_user_confirmed_spec.rb index abff7c6aba1..6027199c11c 100644 --- a/spec/migrations/cleanup_after_add_primary_email_to_emails_if_user_confirmed_spec.rb +++ b/spec/migrations/cleanup_after_add_primary_email_to_emails_if_user_confirmed_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe CleanupAfterAddPrimaryEmailToEmailsIfUserConfirmed, :sidekiq do +RSpec.describe CleanupAfterAddPrimaryEmailToEmailsIfUserConfirmed, :sidekiq, feature_category: :users do let(:migration) { described_class.new } let(:users) { table(:users) } let(:emails) { table(:emails) } diff --git a/spec/migrations/cleanup_after_fixing_issue_when_admin_changed_primary_email_spec.rb b/spec/migrations/cleanup_after_fixing_issue_when_admin_changed_primary_email_spec.rb index eda57545c7a..e8dce46bdbc 100644 --- a/spec/migrations/cleanup_after_fixing_issue_when_admin_changed_primary_email_spec.rb +++ b/spec/migrations/cleanup_after_fixing_issue_when_admin_changed_primary_email_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe CleanupAfterFixingIssueWhenAdminChangedPrimaryEmail, :sidekiq do +RSpec.describe CleanupAfterFixingIssueWhenAdminChangedPrimaryEmail, :sidekiq, feature_category: :users do let(:migration) { described_class.new } let(:users) { table(:users) } let(:emails) { table(:emails) } diff --git a/spec/migrations/cleanup_after_fixing_regression_with_new_users_emails_spec.rb b/spec/migrations/cleanup_after_fixing_regression_with_new_users_emails_spec.rb index 043bb091df3..01ceef9f3a1 100644 --- a/spec/migrations/cleanup_after_fixing_regression_with_new_users_emails_spec.rb +++ b/spec/migrations/cleanup_after_fixing_regression_with_new_users_emails_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe CleanupAfterFixingRegressionWithNewUsersEmails, :sidekiq do +RSpec.describe CleanupAfterFixingRegressionWithNewUsersEmails, :sidekiq, feature_category: :users do let(:migration) { described_class.new } let(:users) { table(:users) } let(:emails) { table(:emails) } diff --git a/spec/migrations/cleanup_backfill_integrations_enable_ssl_verification_spec.rb b/spec/migrations/cleanup_backfill_integrations_enable_ssl_verification_spec.rb index 1517405b358..7aaa90ee985 100644 --- a/spec/migrations/cleanup_backfill_integrations_enable_ssl_verification_spec.rb +++ b/spec/migrations/cleanup_backfill_integrations_enable_ssl_verification_spec.rb @@ -3,7 +3,8 @@ require 'spec_helper' require_migration! -RSpec.describe CleanupBackfillIntegrationsEnableSslVerification, :migration do +RSpec.describe CleanupBackfillIntegrationsEnableSslVerification, :migration, +feature_category: :authentication_and_authorization do let(:job_class_name) { 'BackfillIntegrationsEnableSslVerification' } before do diff --git a/spec/migrations/cleanup_move_container_registry_enabled_to_project_feature_spec.rb b/spec/migrations/cleanup_move_container_registry_enabled_to_project_feature_spec.rb index f0f9249515b..1badde62526 100644 --- a/spec/migrations/cleanup_move_container_registry_enabled_to_project_feature_spec.rb +++ b/spec/migrations/cleanup_move_container_registry_enabled_to_project_feature_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe CleanupMoveContainerRegistryEnabledToProjectFeature, :migration do +RSpec.describe CleanupMoveContainerRegistryEnabledToProjectFeature, :migration, feature_category: :navigation do let(:namespace) { table(:namespaces).create!(name: 'gitlab', path: 'gitlab-org') } let(:non_null_project_features) { { pages_access_level: 20 } } let(:bg_class_name) { 'MoveContainerRegistryEnabledToProjectFeature' } diff --git a/spec/migrations/cleanup_mr_attention_request_todos_spec.rb b/spec/migrations/cleanup_mr_attention_request_todos_spec.rb index 9f593ca8292..4fa2419aa7c 100644 --- a/spec/migrations/cleanup_mr_attention_request_todos_spec.rb +++ b/spec/migrations/cleanup_mr_attention_request_todos_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe CleanupMrAttentionRequestTodos, :migration do +RSpec.describe CleanupMrAttentionRequestTodos, :migration, feature_category: :code_review do let(:projects) { table(:projects) } let(:namespaces) { table(:namespaces) } let(:users) { table(:users) } diff --git a/spec/migrations/cleanup_orphaned_routes_spec.rb b/spec/migrations/cleanup_orphaned_routes_spec.rb index 68598939557..a0ce9062c70 100644 --- a/spec/migrations/cleanup_orphaned_routes_spec.rb +++ b/spec/migrations/cleanup_orphaned_routes_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe CleanupOrphanedRoutes, :migration do +RSpec.describe CleanupOrphanedRoutes, :migration, feature_category: :projects do let(:migration) { described_class::MIGRATION } describe '#up' do diff --git a/spec/migrations/cleanup_remaining_orphan_invites_spec.rb b/spec/migrations/cleanup_remaining_orphan_invites_spec.rb index 987535a4f09..598030c99a0 100644 --- a/spec/migrations/cleanup_remaining_orphan_invites_spec.rb +++ b/spec/migrations/cleanup_remaining_orphan_invites_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe CleanupRemainingOrphanInvites, :migration do +RSpec.describe CleanupRemainingOrphanInvites, :migration, feature_category: :subgroups do def create_member(**extra_attributes) defaults = { access_level: 10, diff --git a/spec/migrations/cleanup_vulnerability_state_transitions_with_same_from_state_to_state_spec.rb b/spec/migrations/cleanup_vulnerability_state_transitions_with_same_from_state_to_state_spec.rb index d91f69d68ad..b808f03428d 100644 --- a/spec/migrations/cleanup_vulnerability_state_transitions_with_same_from_state_to_state_spec.rb +++ b/spec/migrations/cleanup_vulnerability_state_transitions_with_same_from_state_to_state_spec.rb @@ -3,7 +3,8 @@ require 'spec_helper' require_migration! -RSpec.describe CleanupVulnerabilityStateTransitionsWithSameFromStateToState, :migration do +RSpec.describe CleanupVulnerabilityStateTransitionsWithSameFromStateToState, :migration, +feature_category: :vulnerability_management do let!(:namespace) { table(:namespaces).create!(name: 'namespace', type: 'Group', path: 'namespace') } let!(:user) { table(:users).create!(email: 'author@example.com', username: 'author', projects_limit: 10) } let!(:project) do diff --git a/spec/migrations/confirm_security_bot_spec.rb b/spec/migrations/confirm_security_bot_spec.rb index 19ca81f92f3..3761c113692 100644 --- a/spec/migrations/confirm_security_bot_spec.rb +++ b/spec/migrations/confirm_security_bot_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe ConfirmSecurityBot, :migration do +RSpec.describe ConfirmSecurityBot, :migration, feature_category: :users do let(:users) { table(:users) } let(:user_type) { 8 } diff --git a/spec/migrations/confirm_support_bot_user_spec.rb b/spec/migrations/confirm_support_bot_user_spec.rb index 52a167ae8ca..863bdb13585 100644 --- a/spec/migrations/confirm_support_bot_user_spec.rb +++ b/spec/migrations/confirm_support_bot_user_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe ConfirmSupportBotUser, :migration do +RSpec.describe ConfirmSupportBotUser, :migration, feature_category: :users do let(:users) { table(:users) } context 'when support bot user is currently unconfirmed' do diff --git a/spec/migrations/delete_migrate_shared_vulnerability_scanners_spec.rb b/spec/migrations/delete_migrate_shared_vulnerability_scanners_spec.rb index 259b175cd19..562b1e25db4 100644 --- a/spec/migrations/delete_migrate_shared_vulnerability_scanners_spec.rb +++ b/spec/migrations/delete_migrate_shared_vulnerability_scanners_spec.rb @@ -4,7 +4,7 @@ require "spec_helper" require_migration! -RSpec.describe DeleteMigrateSharedVulnerabilityScanners, :migration do +RSpec.describe DeleteMigrateSharedVulnerabilityScanners, :migration, feature_category: :vulnerability_management do let(:batched_background_migrations) { table(:batched_background_migrations) } let(:batched_background_migration_jobs) { table(:batched_background_migration_jobs) } diff --git a/spec/migrations/delete_security_findings_without_uuid_spec.rb b/spec/migrations/delete_security_findings_without_uuid_spec.rb index bfd89f1aa82..e4c17288384 100644 --- a/spec/migrations/delete_security_findings_without_uuid_spec.rb +++ b/spec/migrations/delete_security_findings_without_uuid_spec.rb @@ -3,7 +3,8 @@ require 'spec_helper' require_migration! -RSpec.describe DeleteSecurityFindingsWithoutUuid, :suppress_gitlab_schemas_validate_connection do +RSpec.describe DeleteSecurityFindingsWithoutUuid, :suppress_gitlab_schemas_validate_connection, +feature_category: :vulnerability_management do let(:users) { table(:users) } let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } diff --git a/spec/migrations/disable_expiration_policies_linked_to_no_container_images_spec.rb b/spec/migrations/disable_expiration_policies_linked_to_no_container_images_spec.rb index f2be06f1ed6..1d948257fcc 100644 --- a/spec/migrations/disable_expiration_policies_linked_to_no_container_images_spec.rb +++ b/spec/migrations/disable_expiration_policies_linked_to_no_container_images_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe DisableExpirationPoliciesLinkedToNoContainerImages do +RSpec.describe DisableExpirationPoliciesLinkedToNoContainerImages, feature_category: :container_registry do let(:projects) { table(:projects) } let(:container_expiration_policies) { table(:container_expiration_policies) } let(:container_repositories) { table(:container_repositories) } diff --git a/spec/migrations/disable_job_token_scope_when_unused_spec.rb b/spec/migrations/disable_job_token_scope_when_unused_spec.rb index 3ce4ef5c102..fddf3594e2b 100644 --- a/spec/migrations/disable_job_token_scope_when_unused_spec.rb +++ b/spec/migrations/disable_job_token_scope_when_unused_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe DisableJobTokenScopeWhenUnused do +RSpec.describe DisableJobTokenScopeWhenUnused, feature_category: :continuous_integration do it 'is a no-op' do migrate! end diff --git a/spec/migrations/finalize_invalid_member_cleanup_spec.rb b/spec/migrations/finalize_invalid_member_cleanup_spec.rb index 2362ee7095f..29d03f8983c 100644 --- a/spec/migrations/finalize_invalid_member_cleanup_spec.rb +++ b/spec/migrations/finalize_invalid_member_cleanup_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe FinalizeInvalidMemberCleanup, :migration do +RSpec.describe FinalizeInvalidMemberCleanup, :migration, feature_category: :subgroups do let(:batched_migrations) { table(:batched_background_migrations) } let!(:migration) { described_class::MIGRATION } diff --git a/spec/migrations/finalize_orphaned_routes_cleanup_spec.rb b/spec/migrations/finalize_orphaned_routes_cleanup_spec.rb index bb08a08b2ee..78546806039 100644 --- a/spec/migrations/finalize_orphaned_routes_cleanup_spec.rb +++ b/spec/migrations/finalize_orphaned_routes_cleanup_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe FinalizeOrphanedRoutesCleanup, :migration do +RSpec.describe FinalizeOrphanedRoutesCleanup, :migration, feature_category: :projects do let(:batched_migrations) { table(:batched_background_migrations) } let!(:migration) { described_class::MIGRATION } diff --git a/spec/migrations/finalize_project_namespaces_backfill_spec.rb b/spec/migrations/finalize_project_namespaces_backfill_spec.rb index cbd0c19f482..6cc3a694de8 100644 --- a/spec/migrations/finalize_project_namespaces_backfill_spec.rb +++ b/spec/migrations/finalize_project_namespaces_backfill_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe FinalizeProjectNamespacesBackfill, :migration do +RSpec.describe FinalizeProjectNamespacesBackfill, :migration, feature_category: :projects do let(:batched_migrations) { table(:batched_background_migrations) } let!(:migration) { described_class::MIGRATION } diff --git a/spec/migrations/finalize_routes_backfilling_for_projects_spec.rb b/spec/migrations/finalize_routes_backfilling_for_projects_spec.rb index 192cceb41d2..b79fdc98425 100644 --- a/spec/migrations/finalize_routes_backfilling_for_projects_spec.rb +++ b/spec/migrations/finalize_routes_backfilling_for_projects_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe FinalizeRoutesBackfillingForProjects, :migration do +RSpec.describe FinalizeRoutesBackfillingForProjects, :migration, feature_category: :projects do let(:batched_migrations) { table(:batched_background_migrations) } let!(:migration) { described_class::MIGRATION } diff --git a/spec/migrations/finalize_traversal_ids_background_migrations_spec.rb b/spec/migrations/finalize_traversal_ids_background_migrations_spec.rb index 74d6447e6a7..0cebe7b9f91 100644 --- a/spec/migrations/finalize_traversal_ids_background_migrations_spec.rb +++ b/spec/migrations/finalize_traversal_ids_background_migrations_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration!('finalize_traversal_ids_background_migrations') -RSpec.describe FinalizeTraversalIdsBackgroundMigrations, :migration do +RSpec.describe FinalizeTraversalIdsBackgroundMigrations, :migration, feature_category: :database do shared_context 'incomplete background migration' do before do # Jobs enqueued in Sidekiq. diff --git a/spec/migrations/fix_and_backfill_project_namespaces_for_projects_with_duplicate_name_spec.rb b/spec/migrations/fix_and_backfill_project_namespaces_for_projects_with_duplicate_name_spec.rb index 44a2220b2ad..6b9fb1c6f2c 100644 --- a/spec/migrations/fix_and_backfill_project_namespaces_for_projects_with_duplicate_name_spec.rb +++ b/spec/migrations/fix_and_backfill_project_namespaces_for_projects_with_duplicate_name_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe FixAndBackfillProjectNamespacesForProjectsWithDuplicateName, :migration do +RSpec.describe FixAndBackfillProjectNamespacesForProjectsWithDuplicateName, :migration, feature_category: :projects do let(:projects) { table(:projects) } let(:namespaces) { table(:namespaces) } diff --git a/spec/migrations/fix_batched_migrations_old_format_job_arguments_spec.rb b/spec/migrations/fix_batched_migrations_old_format_job_arguments_spec.rb index e15011d0dab..8def53e1858 100644 --- a/spec/migrations/fix_batched_migrations_old_format_job_arguments_spec.rb +++ b/spec/migrations/fix_batched_migrations_old_format_job_arguments_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! # rubocop:disable Style/WordArray -RSpec.describe FixBatchedMigrationsOldFormatJobArguments do +RSpec.describe FixBatchedMigrationsOldFormatJobArguments, feature_category: :users do let(:batched_background_migrations) { table(:batched_background_migrations) } context 'when migrations with legacy job arguments exists' do diff --git a/spec/migrations/generate_customers_dot_jwt_signing_key_spec.rb b/spec/migrations/generate_customers_dot_jwt_signing_key_spec.rb index b7a91abf5d7..1385b67b607 100644 --- a/spec/migrations/generate_customers_dot_jwt_signing_key_spec.rb +++ b/spec/migrations/generate_customers_dot_jwt_signing_key_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe GenerateCustomersDotJwtSigningKey do +RSpec.describe GenerateCustomersDotJwtSigningKey, feature_category: :customersdot_application do let(:application_settings) do Class.new(ActiveRecord::Base) do self.table_name = 'application_settings' diff --git a/spec/migrations/insert_ci_daily_pipeline_schedule_triggers_plan_limits_spec.rb b/spec/migrations/insert_ci_daily_pipeline_schedule_triggers_plan_limits_spec.rb index 9c2afb7cf21..9358b71132c 100644 --- a/spec/migrations/insert_ci_daily_pipeline_schedule_triggers_plan_limits_spec.rb +++ b/spec/migrations/insert_ci_daily_pipeline_schedule_triggers_plan_limits_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe InsertCiDailyPipelineScheduleTriggersPlanLimits do +RSpec.describe InsertCiDailyPipelineScheduleTriggersPlanLimits, feature_category: :purchase do let!(:plans) { table(:plans) } let!(:plan_limits) { table(:plan_limits) } diff --git a/spec/migrations/migrate_elastic_index_settings_spec.rb b/spec/migrations/migrate_elastic_index_settings_spec.rb index 5f39d9b9fc1..b67c4d902c7 100644 --- a/spec/migrations/migrate_elastic_index_settings_spec.rb +++ b/spec/migrations/migrate_elastic_index_settings_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe MigrateElasticIndexSettings do +RSpec.describe MigrateElasticIndexSettings, feature_category: :global_search do let(:elastic_index_settings) { table(:elastic_index_settings) } let(:application_settings) { table(:application_settings) } diff --git a/spec/migrations/migrate_protected_attribute_to_pending_builds_spec.rb b/spec/migrations/migrate_protected_attribute_to_pending_builds_spec.rb index 01805a9eb79..2f62147da9d 100644 --- a/spec/migrations/migrate_protected_attribute_to_pending_builds_spec.rb +++ b/spec/migrations/migrate_protected_attribute_to_pending_builds_spec.rb @@ -3,7 +3,8 @@ require 'spec_helper' require_migration! -RSpec.describe MigrateProtectedAttributeToPendingBuilds, :suppress_gitlab_schemas_validate_connection do +RSpec.describe MigrateProtectedAttributeToPendingBuilds, :suppress_gitlab_schemas_validate_connection, +feature_category: :continuous_integration do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:queue) { table(:ci_pending_builds) } diff --git a/spec/migrations/move_container_registry_enabled_to_project_features3_spec.rb b/spec/migrations/move_container_registry_enabled_to_project_features3_spec.rb index e47cea749d6..25e0ef439bd 100644 --- a/spec/migrations/move_container_registry_enabled_to_project_features3_spec.rb +++ b/spec/migrations/move_container_registry_enabled_to_project_features3_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe MoveContainerRegistryEnabledToProjectFeatures3, :migration do +RSpec.describe MoveContainerRegistryEnabledToProjectFeatures3, :migration, feature_category: :container_registry do let(:namespace) { table(:namespaces).create!(name: 'gitlab', path: 'gitlab-org') } let!(:background_jobs) do diff --git a/spec/migrations/move_security_findings_table_to_gitlab_partitions_dynamic_schema_spec.rb b/spec/migrations/move_security_findings_table_to_gitlab_partitions_dynamic_schema_spec.rb index b5bb86edce2..2533d3224a6 100644 --- a/spec/migrations/move_security_findings_table_to_gitlab_partitions_dynamic_schema_spec.rb +++ b/spec/migrations/move_security_findings_table_to_gitlab_partitions_dynamic_schema_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe MoveSecurityFindingsTableToGitlabPartitionsDynamicSchema do +RSpec.describe MoveSecurityFindingsTableToGitlabPartitionsDynamicSchema, feature_category: :vulnerability_management do let(:partitions_sql) do <<~SQL SELECT diff --git a/spec/migrations/orphaned_invite_tokens_cleanup_spec.rb b/spec/migrations/orphaned_invite_tokens_cleanup_spec.rb index b33e29f82e2..56f47fca864 100644 --- a/spec/migrations/orphaned_invite_tokens_cleanup_spec.rb +++ b/spec/migrations/orphaned_invite_tokens_cleanup_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe OrphanedInviteTokensCleanup, :migration do +RSpec.describe OrphanedInviteTokensCleanup, :migration, feature_category: :subgroups do def create_member(**extra_attributes) defaults = { access_level: 10, diff --git a/spec/migrations/orphaned_invited_members_cleanup_spec.rb b/spec/migrations/orphaned_invited_members_cleanup_spec.rb index 4427e707f56..1d4db5306bc 100644 --- a/spec/migrations/orphaned_invited_members_cleanup_spec.rb +++ b/spec/migrations/orphaned_invited_members_cleanup_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe OrphanedInvitedMembersCleanup, :migration do +RSpec.describe OrphanedInvitedMembersCleanup, :migration, feature_category: :subgroups do describe '#up', :aggregate_failures do it 'removes accepted members with no associated user' do user = create_user!('testuser1') diff --git a/spec/migrations/populate_audit_event_streaming_verification_token_spec.rb b/spec/migrations/populate_audit_event_streaming_verification_token_spec.rb index b3fe1776183..e2c117903d4 100644 --- a/spec/migrations/populate_audit_event_streaming_verification_token_spec.rb +++ b/spec/migrations/populate_audit_event_streaming_verification_token_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe PopulateAuditEventStreamingVerificationToken do +RSpec.describe PopulateAuditEventStreamingVerificationToken, feature_category: :audit_events do let(:groups) { table(:namespaces) } let(:destinations) { table(:audit_events_external_audit_event_destinations) } let(:migration) { described_class.new } diff --git a/spec/migrations/populate_dismissal_information_for_vulnerabilities_spec.rb b/spec/migrations/populate_dismissal_information_for_vulnerabilities_spec.rb index 1db52781956..66fd5eb5ae5 100644 --- a/spec/migrations/populate_dismissal_information_for_vulnerabilities_spec.rb +++ b/spec/migrations/populate_dismissal_information_for_vulnerabilities_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe PopulateDismissalInformationForVulnerabilities do +RSpec.describe PopulateDismissalInformationForVulnerabilities, feature_category: :vulnerability_management do let(:users) { table(:users) } let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } diff --git a/spec/migrations/populate_operation_visibility_permissions_spec.rb b/spec/migrations/populate_operation_visibility_permissions_spec.rb index 6737a6f84c3..704152bd6a9 100644 --- a/spec/migrations/populate_operation_visibility_permissions_spec.rb +++ b/spec/migrations/populate_operation_visibility_permissions_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe PopulateOperationVisibilityPermissions, :migration do +RSpec.describe PopulateOperationVisibilityPermissions, :migration, feature_category: :navigation do let(:migration) { described_class::MIGRATION } before do diff --git a/spec/migrations/populate_releases_access_level_from_repository_spec.rb b/spec/migrations/populate_releases_access_level_from_repository_spec.rb index 2bb97662923..ebb7aa6f7fa 100644 --- a/spec/migrations/populate_releases_access_level_from_repository_spec.rb +++ b/spec/migrations/populate_releases_access_level_from_repository_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe PopulateReleasesAccessLevelFromRepository, :migration do +RSpec.describe PopulateReleasesAccessLevelFromRepository, :migration, feature_category: :navigation do let(:projects) { table(:projects) } let(:groups) { table(:namespaces) } let(:project_features) { table(:project_features) } diff --git a/spec/migrations/queue_backfill_project_feature_package_registry_access_level_spec.rb b/spec/migrations/queue_backfill_project_feature_package_registry_access_level_spec.rb index d0223bf4f9d..6a01b30445b 100644 --- a/spec/migrations/queue_backfill_project_feature_package_registry_access_level_spec.rb +++ b/spec/migrations/queue_backfill_project_feature_package_registry_access_level_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe QueueBackfillProjectFeaturePackageRegistryAccessLevel do +RSpec.describe QueueBackfillProjectFeaturePackageRegistryAccessLevel, feature_category: :package_registry do let!(:batched_migration) { described_class::MIGRATION } it 'schedules a new batched migration' do diff --git a/spec/migrations/queue_backfill_user_details_fields_spec.rb b/spec/migrations/queue_backfill_user_details_fields_spec.rb index d379318c368..e77a66907de 100644 --- a/spec/migrations/queue_backfill_user_details_fields_spec.rb +++ b/spec/migrations/queue_backfill_user_details_fields_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe QueueBackfillUserDetailsFields do +RSpec.describe QueueBackfillUserDetailsFields, feature_category: :users do let!(:batched_migration) { described_class::MIGRATION } it 'schedules a new batched migration' do diff --git a/spec/migrations/queue_populate_projects_star_count_spec.rb b/spec/migrations/queue_populate_projects_star_count_spec.rb index 2897ba69a33..84565d14d52 100644 --- a/spec/migrations/queue_populate_projects_star_count_spec.rb +++ b/spec/migrations/queue_populate_projects_star_count_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe QueuePopulateProjectsStarCount do +RSpec.describe QueuePopulateProjectsStarCount, feature_category: :users do let!(:batched_migration) { described_class::MIGRATION } it 'schedules a new batched migration' do diff --git a/spec/migrations/re_schedule_latest_pipeline_id_population_with_all_security_related_artifact_types_spec.rb b/spec/migrations/re_schedule_latest_pipeline_id_population_with_all_security_related_artifact_types_spec.rb index 45a2772adda..5ebe6787f15 100644 --- a/spec/migrations/re_schedule_latest_pipeline_id_population_with_all_security_related_artifact_types_spec.rb +++ b/spec/migrations/re_schedule_latest_pipeline_id_population_with_all_security_related_artifact_types_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! RSpec.describe ReScheduleLatestPipelineIdPopulationWithAllSecurityRelatedArtifactTypes, - :suppress_gitlab_schemas_validate_connection do + :suppress_gitlab_schemas_validate_connection, feature_category: :vulnerability_management do let(:namespaces) { table(:namespaces) } let(:pipelines) { table(:ci_pipelines) } let(:projects) { table(:projects) } diff --git a/spec/migrations/recount_epic_cache_counts_spec.rb b/spec/migrations/recount_epic_cache_counts_spec.rb index 56aa96cb40c..d065389a726 100644 --- a/spec/migrations/recount_epic_cache_counts_spec.rb +++ b/spec/migrations/recount_epic_cache_counts_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe RecountEpicCacheCounts, :migration do +RSpec.describe RecountEpicCacheCounts, :migration, feature_category: :portfolio_management do let(:migration) { described_class::MIGRATION } describe '#up' do diff --git a/spec/migrations/recreate_index_security_ci_builds_on_name_and_id_parser_features_spec.rb b/spec/migrations/recreate_index_security_ci_builds_on_name_and_id_parser_features_spec.rb index 77824a743fb..80ecc23dfbe 100644 --- a/spec/migrations/recreate_index_security_ci_builds_on_name_and_id_parser_features_spec.rb +++ b/spec/migrations/recreate_index_security_ci_builds_on_name_and_id_parser_features_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe RecreateIndexSecurityCiBuildsOnNameAndIdParserFeatures, :migration do +RSpec.describe RecreateIndexSecurityCiBuildsOnNameAndIdParserFeatures, :migration, feature_category: :database do let(:db) { described_class.new } let(:pg_class) { table(:pg_class) } let(:pg_index) { table(:pg_index) } diff --git a/spec/migrations/recreate_index_security_ci_builds_on_name_and_id_parser_with_new_features_spec.rb b/spec/migrations/recreate_index_security_ci_builds_on_name_and_id_parser_with_new_features_spec.rb index 8ec51d86779..c7709764727 100644 --- a/spec/migrations/recreate_index_security_ci_builds_on_name_and_id_parser_with_new_features_spec.rb +++ b/spec/migrations/recreate_index_security_ci_builds_on_name_and_id_parser_with_new_features_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe RecreateIndexSecurityCiBuildsOnNameAndIdParserWithNewFeatures, :migration do +RSpec.describe RecreateIndexSecurityCiBuildsOnNameAndIdParserWithNewFeatures, :migration, feature_category: :continuous_integration do let(:db) { described_class.new } let(:pg_class) { table(:pg_class) } let(:pg_index) { table(:pg_index) } diff --git a/spec/migrations/remove_duplicate_dast_site_tokens_spec.rb b/spec/migrations/remove_duplicate_dast_site_tokens_spec.rb index a37a2ab964c..2b21dc3b67f 100644 --- a/spec/migrations/remove_duplicate_dast_site_tokens_spec.rb +++ b/spec/migrations/remove_duplicate_dast_site_tokens_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe RemoveDuplicateDastSiteTokens do +RSpec.describe RemoveDuplicateDastSiteTokens, feature_category: :dynamic_application_security_testing do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:dast_site_tokens) { table(:dast_site_tokens) } diff --git a/spec/migrations/remove_duplicate_dast_site_tokens_with_same_token_spec.rb b/spec/migrations/remove_duplicate_dast_site_tokens_with_same_token_spec.rb index 6f860558dd7..6cc25b74d02 100644 --- a/spec/migrations/remove_duplicate_dast_site_tokens_with_same_token_spec.rb +++ b/spec/migrations/remove_duplicate_dast_site_tokens_with_same_token_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe RemoveDuplicateDastSiteTokensWithSameToken do +RSpec.describe RemoveDuplicateDastSiteTokensWithSameToken, feature_category: :dynamic_application_security_testing do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:dast_site_tokens) { table(:dast_site_tokens) } diff --git a/spec/migrations/remove_hipchat_service_records_spec.rb b/spec/migrations/remove_hipchat_service_records_spec.rb index d218b6b23a5..b89572b069e 100644 --- a/spec/migrations/remove_hipchat_service_records_spec.rb +++ b/spec/migrations/remove_hipchat_service_records_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe RemoveHipchatServiceRecords do +RSpec.describe RemoveHipchatServiceRecords, feature_category: :integrations do let(:services) { table(:services) } before do diff --git a/spec/migrations/remove_invalid_integrations_spec.rb b/spec/migrations/remove_invalid_integrations_spec.rb index cab2d79998e..52adc087e0a 100644 --- a/spec/migrations/remove_invalid_integrations_spec.rb +++ b/spec/migrations/remove_invalid_integrations_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe RemoveInvalidIntegrations, :migration do +RSpec.describe RemoveInvalidIntegrations, :migration, feature_category: :integrations do describe '#up' do let!(:integrations) { table(:integrations) } diff --git a/spec/migrations/remove_not_null_contraint_on_title_from_sprints_spec.rb b/spec/migrations/remove_not_null_contraint_on_title_from_sprints_spec.rb index 198644fe183..91687d8d730 100644 --- a/spec/migrations/remove_not_null_contraint_on_title_from_sprints_spec.rb +++ b/spec/migrations/remove_not_null_contraint_on_title_from_sprints_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe RemoveNotNullContraintOnTitleFromSprints, :migration do +RSpec.describe RemoveNotNullContraintOnTitleFromSprints, :migration, feature_category: :team_planning do let(:migration) { described_class.new } let(:namespaces) { table(:namespaces) } let(:sprints) { table(:sprints) } diff --git a/spec/migrations/remove_records_without_group_from_webhooks_table_spec.rb b/spec/migrations/remove_records_without_group_from_webhooks_table_spec.rb index c267e419b42..eabf6271ded 100644 --- a/spec/migrations/remove_records_without_group_from_webhooks_table_spec.rb +++ b/spec/migrations/remove_records_without_group_from_webhooks_table_spec.rb @@ -5,7 +5,7 @@ require 'spec_helper' require_migration! require_migration!('add_not_valid_foreign_key_to_group_hooks') -RSpec.describe RemoveRecordsWithoutGroupFromWebhooksTable, schema: 20210330091751 do +RSpec.describe RemoveRecordsWithoutGroupFromWebhooksTable, schema: 20210330091751, feature_category: :integrations do let(:web_hooks) { table(:web_hooks) } let(:groups) { table(:namespaces) } diff --git a/spec/migrations/remove_schedule_and_status_from_pending_alert_escalations_spec.rb b/spec/migrations/remove_schedule_and_status_from_pending_alert_escalations_spec.rb index f595261ff90..86e161cea43 100644 --- a/spec/migrations/remove_schedule_and_status_from_pending_alert_escalations_spec.rb +++ b/spec/migrations/remove_schedule_and_status_from_pending_alert_escalations_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe RemoveScheduleAndStatusFromPendingAlertEscalations do +RSpec.describe RemoveScheduleAndStatusFromPendingAlertEscalations, feature_category: :incident_management do let(:escalations) { table(:incident_management_pending_alert_escalations) } let(:schedule_index) { 'index_incident_management_pending_alert_escalations_on_schedule' } let(:schedule_foreign_key) { 'fk_rails_fcbfd9338b' } diff --git a/spec/migrations/remove_wiki_notes_spec.rb b/spec/migrations/remove_wiki_notes_spec.rb index 2ffebdee106..55f58ef7be6 100644 --- a/spec/migrations/remove_wiki_notes_spec.rb +++ b/spec/migrations/remove_wiki_notes_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe RemoveWikiNotes, :migration do +RSpec.describe RemoveWikiNotes, :migration, feature_category: :team_planning do let(:notes) { table(:notes) } it 'removes all wiki notes' do diff --git a/spec/migrations/rename_services_to_integrations_spec.rb b/spec/migrations/rename_services_to_integrations_spec.rb index 812dd5efecb..a90b0bfabd2 100644 --- a/spec/migrations/rename_services_to_integrations_spec.rb +++ b/spec/migrations/rename_services_to_integrations_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe RenameServicesToIntegrations do +RSpec.describe RenameServicesToIntegrations, feature_category: :integrations do let(:migration) { described_class.new } let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } diff --git a/spec/migrations/replace_external_wiki_triggers_spec.rb b/spec/migrations/replace_external_wiki_triggers_spec.rb index 392ef76c5ba..c2bc5c44c77 100644 --- a/spec/migrations/replace_external_wiki_triggers_spec.rb +++ b/spec/migrations/replace_external_wiki_triggers_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe ReplaceExternalWikiTriggers do +RSpec.describe ReplaceExternalWikiTriggers, feature_category: :integrations do let(:migration) { described_class.new } let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } diff --git a/spec/migrations/reschedule_backfill_imported_issue_search_data_spec.rb b/spec/migrations/reschedule_backfill_imported_issue_search_data_spec.rb index a59ddec20c4..fe730f452f7 100644 --- a/spec/migrations/reschedule_backfill_imported_issue_search_data_spec.rb +++ b/spec/migrations/reschedule_backfill_imported_issue_search_data_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe RescheduleBackfillImportedIssueSearchData do +RSpec.describe RescheduleBackfillImportedIssueSearchData, feature_category: :global_search do let!(:reschedule_migration) { described_class::MIGRATION } def create_batched_migration(max_value:) diff --git a/spec/migrations/reschedule_delete_orphaned_deployments_spec.rb b/spec/migrations/reschedule_delete_orphaned_deployments_spec.rb index eb91602388c..bbc4494837a 100644 --- a/spec/migrations/reschedule_delete_orphaned_deployments_spec.rb +++ b/spec/migrations/reschedule_delete_orphaned_deployments_spec.rb @@ -4,7 +4,8 @@ require 'spec_helper' require_migration! -RSpec.describe RescheduleDeleteOrphanedDeployments, :sidekiq, schema: 20210617161348 do +RSpec.describe RescheduleDeleteOrphanedDeployments, :sidekiq, schema: 20210617161348, + feature_category: :continuous_delivery do let!(:namespace) { table(:namespaces).create!(name: 'user', path: 'user') } let!(:project) { table(:projects).create!(namespace_id: namespace.id) } let!(:environment) { table(:environments).create!(name: 'production', slug: 'production', project_id: project.id) } diff --git a/spec/migrations/reschedule_issue_work_item_type_id_backfill_spec.rb b/spec/migrations/reschedule_issue_work_item_type_id_backfill_spec.rb index 105144cbe5b..1443ff09241 100644 --- a/spec/migrations/reschedule_issue_work_item_type_id_backfill_spec.rb +++ b/spec/migrations/reschedule_issue_work_item_type_id_backfill_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe RescheduleIssueWorkItemTypeIdBackfill, :migration do +RSpec.describe RescheduleIssueWorkItemTypeIdBackfill, :migration, feature_category: :team_planning do let!(:migration) { described_class::MIGRATION } let!(:interval) { 2.minutes } let!(:issue_type_enum) { { issue: 0, incident: 1, test_case: 2, requirement: 3, task: 4 } } diff --git a/spec/migrations/reschedule_migrate_shared_vulnerability_scanners_spec.rb b/spec/migrations/reschedule_migrate_shared_vulnerability_scanners_spec.rb index e8253f39c68..48422de81fe 100644 --- a/spec/migrations/reschedule_migrate_shared_vulnerability_scanners_spec.rb +++ b/spec/migrations/reschedule_migrate_shared_vulnerability_scanners_spec.rb @@ -4,7 +4,7 @@ require "spec_helper" require_migration! -RSpec.describe RescheduleMigrateSharedVulnerabilityScanners, :migration do +RSpec.describe RescheduleMigrateSharedVulnerabilityScanners, :migration, feature_category: :vulnerability_management do include Gitlab::Database::Migrations::BatchedBackgroundMigrationHelpers def connection diff --git a/spec/migrations/reset_job_token_scope_enabled_again_spec.rb b/spec/migrations/reset_job_token_scope_enabled_again_spec.rb index 8f9e12852e1..9f1180b6e24 100644 --- a/spec/migrations/reset_job_token_scope_enabled_again_spec.rb +++ b/spec/migrations/reset_job_token_scope_enabled_again_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe ResetJobTokenScopeEnabledAgain do +RSpec.describe ResetJobTokenScopeEnabledAgain, feature_category: :continuous_integration do let(:settings) { table(:project_ci_cd_settings) } let(:projects) { table(:projects) } let(:namespaces) { table(:namespaces) } diff --git a/spec/migrations/reset_job_token_scope_enabled_spec.rb b/spec/migrations/reset_job_token_scope_enabled_spec.rb index fb7bd78c11f..4ce9078246a 100644 --- a/spec/migrations/reset_job_token_scope_enabled_spec.rb +++ b/spec/migrations/reset_job_token_scope_enabled_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe ResetJobTokenScopeEnabled do +RSpec.describe ResetJobTokenScopeEnabled, feature_category: :continuous_integration do let(:settings) { table(:project_ci_cd_settings) } let(:projects) { table(:projects) } let(:namespaces) { table(:namespaces) } diff --git a/spec/migrations/reset_severity_levels_to_new_default_spec.rb b/spec/migrations/reset_severity_levels_to_new_default_spec.rb index c352f1f3cee..83e57b852a0 100644 --- a/spec/migrations/reset_severity_levels_to_new_default_spec.rb +++ b/spec/migrations/reset_severity_levels_to_new_default_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe ResetSeverityLevelsToNewDefault do +RSpec.describe ResetSeverityLevelsToNewDefault, feature_category: :source_code_management do let(:approval_project_rules) { table(:approval_project_rules) } let(:projects) { table(:projects) } let(:namespaces) { table(:namespaces) } diff --git a/spec/migrations/retry_backfill_traversal_ids_spec.rb b/spec/migrations/retry_backfill_traversal_ids_spec.rb index 4c93fea65cb..f3658d1b8a3 100644 --- a/spec/migrations/retry_backfill_traversal_ids_spec.rb +++ b/spec/migrations/retry_backfill_traversal_ids_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe RetryBackfillTraversalIds, :migration do +RSpec.describe RetryBackfillTraversalIds, :migration, feature_category: :subgroups do include ReloadHelpers let!(:namespaces_table) { table(:namespaces) } diff --git a/spec/migrations/sanitize_confidential_note_todos_spec.rb b/spec/migrations/sanitize_confidential_note_todos_spec.rb index 00dece82cc1..142378e07e1 100644 --- a/spec/migrations/sanitize_confidential_note_todos_spec.rb +++ b/spec/migrations/sanitize_confidential_note_todos_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe SanitizeConfidentialNoteTodos do +RSpec.describe SanitizeConfidentialNoteTodos, feature_category: :team_planning do let(:migration) { described_class::MIGRATION } describe '#up' do diff --git a/spec/migrations/schedule_add_primary_email_to_emails_if_user_confirmed_spec.rb b/spec/migrations/schedule_add_primary_email_to_emails_if_user_confirmed_spec.rb index c66ac1bd7e9..98d3e9b7c7c 100644 --- a/spec/migrations/schedule_add_primary_email_to_emails_if_user_confirmed_spec.rb +++ b/spec/migrations/schedule_add_primary_email_to_emails_if_user_confirmed_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe ScheduleAddPrimaryEmailToEmailsIfUserConfirmed, :sidekiq do +RSpec.describe ScheduleAddPrimaryEmailToEmailsIfUserConfirmed, :sidekiq, feature_category: :users do let(:migration) { described_class.new } let(:users) { table(:users) } diff --git a/spec/migrations/schedule_backfill_cluster_agents_has_vulnerabilities_spec.rb b/spec/migrations/schedule_backfill_cluster_agents_has_vulnerabilities_spec.rb index bcedc890d4f..84764c89adb 100644 --- a/spec/migrations/schedule_backfill_cluster_agents_has_vulnerabilities_spec.rb +++ b/spec/migrations/schedule_backfill_cluster_agents_has_vulnerabilities_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe ScheduleBackfillClusterAgentsHasVulnerabilities do +RSpec.describe ScheduleBackfillClusterAgentsHasVulnerabilities, feature_category: :vulnerability_management do let!(:batched_migration) { described_class::MIGRATION } it 'schedules background jobs for each batch of cluster agents' do diff --git a/spec/migrations/schedule_backfill_draft_status_on_merge_requests_corrected_regex_spec.rb b/spec/migrations/schedule_backfill_draft_status_on_merge_requests_corrected_regex_spec.rb index 9d7651d01ed..8a14bf58698 100644 --- a/spec/migrations/schedule_backfill_draft_status_on_merge_requests_corrected_regex_spec.rb +++ b/spec/migrations/schedule_backfill_draft_status_on_merge_requests_corrected_regex_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe ScheduleBackfillDraftStatusOnMergeRequestsCorrectedRegex, :sidekiq do +RSpec.describe ScheduleBackfillDraftStatusOnMergeRequestsCorrectedRegex, :sidekiq, feature_category: :code_review do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:merge_requests) { table(:merge_requests) } diff --git a/spec/migrations/schedule_backfilling_the_namespace_id_for_vulnerability_reads_spec.rb b/spec/migrations/schedule_backfilling_the_namespace_id_for_vulnerability_reads_spec.rb index a3478729b89..e547b321c52 100644 --- a/spec/migrations/schedule_backfilling_the_namespace_id_for_vulnerability_reads_spec.rb +++ b/spec/migrations/schedule_backfilling_the_namespace_id_for_vulnerability_reads_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe ScheduleBackfillingTheNamespaceIdForVulnerabilityReads do +RSpec.describe ScheduleBackfillingTheNamespaceIdForVulnerabilityReads, feature_category: :vulnerability_management do let!(:migration) { described_class::MIGRATION_NAME } describe '#up' do diff --git a/spec/migrations/schedule_copy_ci_builds_columns_to_security_scans2_spec.rb b/spec/migrations/schedule_copy_ci_builds_columns_to_security_scans2_spec.rb index 67d54ea92a0..63678a094a7 100644 --- a/spec/migrations/schedule_copy_ci_builds_columns_to_security_scans2_spec.rb +++ b/spec/migrations/schedule_copy_ci_builds_columns_to_security_scans2_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe ScheduleCopyCiBuildsColumnsToSecurityScans2 do +RSpec.describe ScheduleCopyCiBuildsColumnsToSecurityScans2, feature_category: :dependency_scanning do it 'is a no-op' do migrate! end diff --git a/spec/migrations/schedule_disable_expiration_policies_linked_to_no_container_images_spec.rb b/spec/migrations/schedule_disable_expiration_policies_linked_to_no_container_images_spec.rb index 1032c2c3d68..ebcc3fda0a3 100644 --- a/spec/migrations/schedule_disable_expiration_policies_linked_to_no_container_images_spec.rb +++ b/spec/migrations/schedule_disable_expiration_policies_linked_to_no_container_images_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe ScheduleDisableExpirationPoliciesLinkedToNoContainerImages do +RSpec.describe ScheduleDisableExpirationPoliciesLinkedToNoContainerImages, feature_category: :container_registry do let!(:projects) { table(:projects) } let!(:container_expiration_policies) { table(:container_expiration_policies) } let!(:container_repositories) { table(:container_repositories) } diff --git a/spec/migrations/schedule_fix_incorrect_max_seats_used2_spec.rb b/spec/migrations/schedule_fix_incorrect_max_seats_used2_spec.rb index 3720be6cf3e..26764f855b7 100644 --- a/spec/migrations/schedule_fix_incorrect_max_seats_used2_spec.rb +++ b/spec/migrations/schedule_fix_incorrect_max_seats_used2_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe ScheduleFixIncorrectMaxSeatsUsed2, :migration do +RSpec.describe ScheduleFixIncorrectMaxSeatsUsed2, :migration, feature_category: :purchase do let(:migration_name) { described_class::MIGRATION.to_s.demodulize } describe '#up' do diff --git a/spec/migrations/schedule_fix_incorrect_max_seats_used_spec.rb b/spec/migrations/schedule_fix_incorrect_max_seats_used_spec.rb index 74258f03630..194a1d39ad1 100644 --- a/spec/migrations/schedule_fix_incorrect_max_seats_used_spec.rb +++ b/spec/migrations/schedule_fix_incorrect_max_seats_used_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe ScheduleFixIncorrectMaxSeatsUsed, :migration do +RSpec.describe ScheduleFixIncorrectMaxSeatsUsed, :migration, feature_category: :purchase do let(:migration) { described_class.new } describe '#up' do diff --git a/spec/migrations/schedule_populate_requirements_issue_id_spec.rb b/spec/migrations/schedule_populate_requirements_issue_id_spec.rb index 5d238e75bd9..000c42cc4fc 100644 --- a/spec/migrations/schedule_populate_requirements_issue_id_spec.rb +++ b/spec/migrations/schedule_populate_requirements_issue_id_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe SchedulePopulateRequirementsIssueId do +RSpec.describe SchedulePopulateRequirementsIssueId, feature_category: :requirements_management do include MigrationHelpers::WorkItemTypesHelper let(:issues) { table(:issues) } diff --git a/spec/migrations/schedule_purging_stale_security_scans_spec.rb b/spec/migrations/schedule_purging_stale_security_scans_spec.rb index d8a729783f1..b39baa145ff 100644 --- a/spec/migrations/schedule_purging_stale_security_scans_spec.rb +++ b/spec/migrations/schedule_purging_stale_security_scans_spec.rb @@ -3,7 +3,8 @@ require 'spec_helper' require_migration! -RSpec.describe SchedulePurgingStaleSecurityScans, :suppress_gitlab_schemas_validate_connection do +RSpec.describe SchedulePurgingStaleSecurityScans, :suppress_gitlab_schemas_validate_connection, +feature_category: :vulnerability_management do let!(:namespaces) { table(:namespaces) } let!(:projects) { table(:projects) } let!(:pipelines) { table(:ci_pipelines) } diff --git a/spec/migrations/schedule_recalculate_vulnerability_finding_signatures_for_findings_spec.rb b/spec/migrations/schedule_recalculate_vulnerability_finding_signatures_for_findings_spec.rb index 9eb09e0215a..8903a32285e 100644 --- a/spec/migrations/schedule_recalculate_vulnerability_finding_signatures_for_findings_spec.rb +++ b/spec/migrations/schedule_recalculate_vulnerability_finding_signatures_for_findings_spec.rb @@ -3,7 +3,8 @@ require 'spec_helper' require_migration! -RSpec.describe ScheduleRecalculateVulnerabilityFindingSignaturesForFindings, :migration do +RSpec.describe ScheduleRecalculateVulnerabilityFindingSignaturesForFindings, :migration, +feature_category: :vulnerability_management do before do allow(Gitlab).to receive(:ee?).and_return(ee?) stub_const("#{described_class.name}::BATCH_SIZE", 2) diff --git a/spec/migrations/schedule_security_setting_creation_spec.rb b/spec/migrations/schedule_security_setting_creation_spec.rb index e1b7b540d7f..edabb2a2299 100644 --- a/spec/migrations/schedule_security_setting_creation_spec.rb +++ b/spec/migrations/schedule_security_setting_creation_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe ScheduleSecuritySettingCreation, :sidekiq do +RSpec.describe ScheduleSecuritySettingCreation, :sidekiq, feature_category: :projects do describe '#up' do let(:projects) { table(:projects) } let(:namespaces) { table(:namespaces) } diff --git a/spec/migrations/schedule_set_correct_vulnerability_state_spec.rb b/spec/migrations/schedule_set_correct_vulnerability_state_spec.rb index 9f2b2cd6b2a..e888a1132c0 100644 --- a/spec/migrations/schedule_set_correct_vulnerability_state_spec.rb +++ b/spec/migrations/schedule_set_correct_vulnerability_state_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe ScheduleSetCorrectVulnerabilityState do +RSpec.describe ScheduleSetCorrectVulnerabilityState, feature_category: :vulnerability_management do let!(:migration) { described_class::MIGRATION_NAME } describe '#up' do diff --git a/spec/migrations/schedule_update_timelogs_null_spent_at_spec.rb b/spec/migrations/schedule_update_timelogs_null_spent_at_spec.rb index 8ab2e3179b7..99ee9e58f4e 100644 --- a/spec/migrations/schedule_update_timelogs_null_spent_at_spec.rb +++ b/spec/migrations/schedule_update_timelogs_null_spent_at_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe ScheduleUpdateTimelogsNullSpentAt do +RSpec.describe ScheduleUpdateTimelogsNullSpentAt, feature_category: :team_planning do let!(:namespace) { table(:namespaces).create!(name: 'namespace', path: 'namespace') } let!(:project) { table(:projects).create!(namespace_id: namespace.id) } let!(:issue) { table(:issues).create!(project_id: project.id) } diff --git a/spec/migrations/schedule_update_timelogs_project_id_spec.rb b/spec/migrations/schedule_update_timelogs_project_id_spec.rb index b9130fd86be..5ce3f7dd36c 100644 --- a/spec/migrations/schedule_update_timelogs_project_id_spec.rb +++ b/spec/migrations/schedule_update_timelogs_project_id_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe ScheduleUpdateTimelogsProjectId do +RSpec.describe ScheduleUpdateTimelogsProjectId, feature_category: :team_planning do let!(:namespace) { table(:namespaces).create!(name: 'namespace', path: 'namespace') } let!(:project) { table(:projects).create!(namespace_id: namespace.id) } let!(:issue) { table(:issues).create!(project_id: project.id) } diff --git a/spec/migrations/schedule_update_users_where_two_factor_auth_required_from_group_spec.rb b/spec/migrations/schedule_update_users_where_two_factor_auth_required_from_group_spec.rb index 2fe739659f0..c9f22c02a0b 100644 --- a/spec/migrations/schedule_update_users_where_two_factor_auth_required_from_group_spec.rb +++ b/spec/migrations/schedule_update_users_where_two_factor_auth_required_from_group_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe ScheduleUpdateUsersWhereTwoFactorAuthRequiredFromGroup do +RSpec.describe ScheduleUpdateUsersWhereTwoFactorAuthRequiredFromGroup, feature_category: :require_two_factor_authentication_from_group do let(:users) { table(:users) } let!(:user_1) { users.create!(require_two_factor_authentication_from_group: false, name: "user1", email: "user1@example.com", projects_limit: 1) } let!(:user_2) { users.create!(require_two_factor_authentication_from_group: true, name: "user2", email: "user2@example.com", projects_limit: 1) } diff --git a/spec/migrations/set_default_job_token_scope_true_spec.rb b/spec/migrations/set_default_job_token_scope_true_spec.rb index e7c77357318..25f4f07e15a 100644 --- a/spec/migrations/set_default_job_token_scope_true_spec.rb +++ b/spec/migrations/set_default_job_token_scope_true_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe SetDefaultJobTokenScopeTrue, schema: 20210819153805 do +RSpec.describe SetDefaultJobTokenScopeTrue, schema: 20210819153805, feature_category: :continuous_integration do let(:ci_cd_settings) { table(:project_ci_cd_settings) } let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } diff --git a/spec/migrations/set_email_confirmation_setting_before_removing_send_user_confirmation_email_column_spec.rb b/spec/migrations/set_email_confirmation_setting_before_removing_send_user_confirmation_email_column_spec.rb index b9e92cddfb8..4303713744e 100644 --- a/spec/migrations/set_email_confirmation_setting_before_removing_send_user_confirmation_email_column_spec.rb +++ b/spec/migrations/set_email_confirmation_setting_before_removing_send_user_confirmation_email_column_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe SetEmailConfirmationSettingBeforeRemovingSendUserConfirmationEmailColumn do +RSpec.describe SetEmailConfirmationSettingBeforeRemovingSendUserConfirmationEmailColumn, feature_category: :users do let(:migration) { described_class.new } let(:application_settings_table) { table(:application_settings) } diff --git a/spec/migrations/set_email_confirmation_setting_from_send_user_confirmation_email_setting_spec.rb b/spec/migrations/set_email_confirmation_setting_from_send_user_confirmation_email_setting_spec.rb index 761c0ef2fdb..e08aa8679a1 100644 --- a/spec/migrations/set_email_confirmation_setting_from_send_user_confirmation_email_setting_spec.rb +++ b/spec/migrations/set_email_confirmation_setting_from_send_user_confirmation_email_setting_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe SetEmailConfirmationSettingFromSendUserConfirmationEmailSetting do +RSpec.describe SetEmailConfirmationSettingFromSendUserConfirmationEmailSetting, feature_category: :users do let(:migration) { described_class.new } let(:application_settings_table) { table(:application_settings) } diff --git a/spec/migrations/slice_merge_request_diff_commit_migrations_spec.rb b/spec/migrations/slice_merge_request_diff_commit_migrations_spec.rb index b03a5c41a11..fdbd8093fa5 100644 --- a/spec/migrations/slice_merge_request_diff_commit_migrations_spec.rb +++ b/spec/migrations/slice_merge_request_diff_commit_migrations_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe SliceMergeRequestDiffCommitMigrations, :migration do +RSpec.describe SliceMergeRequestDiffCommitMigrations, :migration, feature_category: :code_review do let(:migration) { described_class.new } describe '#up' do diff --git a/spec/migrations/start_backfill_ci_queuing_tables_spec.rb b/spec/migrations/start_backfill_ci_queuing_tables_spec.rb index 08fd244089f..c308a16d5b8 100644 --- a/spec/migrations/start_backfill_ci_queuing_tables_spec.rb +++ b/spec/migrations/start_backfill_ci_queuing_tables_spec.rb @@ -3,7 +3,8 @@ require 'spec_helper' require_migration! -RSpec.describe StartBackfillCiQueuingTables, :suppress_gitlab_schemas_validate_connection do +RSpec.describe StartBackfillCiQueuingTables, :suppress_gitlab_schemas_validate_connection, +feature_category: :continuous_integration do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:builds) { table(:ci_builds) } diff --git a/spec/migrations/steal_merge_request_diff_commit_users_migration_spec.rb b/spec/migrations/steal_merge_request_diff_commit_users_migration_spec.rb index 4fb4ba61a34..d2cd7a6980d 100644 --- a/spec/migrations/steal_merge_request_diff_commit_users_migration_spec.rb +++ b/spec/migrations/steal_merge_request_diff_commit_users_migration_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe StealMergeRequestDiffCommitUsersMigration, :migration do +RSpec.describe StealMergeRequestDiffCommitUsersMigration, :migration, feature_category: :source_code_management do let(:migration) { described_class.new } describe '#up' do diff --git a/spec/migrations/sync_new_amount_used_for_ci_namespace_monthly_usages_spec.rb b/spec/migrations/sync_new_amount_used_for_ci_namespace_monthly_usages_spec.rb index 9a17f375f82..da8790f4450 100644 --- a/spec/migrations/sync_new_amount_used_for_ci_namespace_monthly_usages_spec.rb +++ b/spec/migrations/sync_new_amount_used_for_ci_namespace_monthly_usages_spec.rb @@ -4,7 +4,8 @@ require 'spec_helper' require_migration! -RSpec.describe SyncNewAmountUsedForCiNamespaceMonthlyUsages, migration: :gitlab_ci do +RSpec.describe SyncNewAmountUsedForCiNamespaceMonthlyUsages, migration: :gitlab_ci, + feature_category: :continuous_integration do let(:namespace_usages) { table(:ci_namespace_monthly_usages) } before do diff --git a/spec/migrations/sync_new_amount_used_for_ci_project_monthly_usages_spec.rb b/spec/migrations/sync_new_amount_used_for_ci_project_monthly_usages_spec.rb index 8d45f1107ea..1c9b2711687 100644 --- a/spec/migrations/sync_new_amount_used_for_ci_project_monthly_usages_spec.rb +++ b/spec/migrations/sync_new_amount_used_for_ci_project_monthly_usages_spec.rb @@ -4,7 +4,8 @@ require 'spec_helper' require_migration! -RSpec.describe SyncNewAmountUsedForCiProjectMonthlyUsages, migration: :gitlab_ci do +RSpec.describe SyncNewAmountUsedForCiProjectMonthlyUsages, migration: :gitlab_ci, + feature_category: :continuous_integration do let(:project_usages) { table(:ci_project_monthly_usages) } before do diff --git a/spec/migrations/toggle_vsa_aggregations_enable_spec.rb b/spec/migrations/toggle_vsa_aggregations_enable_spec.rb index a6850d493b7..5b3e513e9f6 100644 --- a/spec/migrations/toggle_vsa_aggregations_enable_spec.rb +++ b/spec/migrations/toggle_vsa_aggregations_enable_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe ToggleVsaAggregationsEnable, :migration do +RSpec.describe ToggleVsaAggregationsEnable, :migration, feature_category: :value_stream_management do let(:aggregations) { table(:analytics_cycle_analytics_aggregations) } let(:groups) { table(:namespaces) } diff --git a/spec/migrations/update_application_settings_container_registry_exp_pol_worker_capacity_default_spec.rb b/spec/migrations/update_application_settings_container_registry_exp_pol_worker_capacity_default_spec.rb index 842456089fe..d249fcecf66 100644 --- a/spec/migrations/update_application_settings_container_registry_exp_pol_worker_capacity_default_spec.rb +++ b/spec/migrations/update_application_settings_container_registry_exp_pol_worker_capacity_default_spec.rb @@ -3,7 +3,8 @@ require 'spec_helper' require_migration! -RSpec.describe UpdateApplicationSettingsContainerRegistryExpPolWorkerCapacityDefault do +RSpec.describe UpdateApplicationSettingsContainerRegistryExpPolWorkerCapacityDefault, +feature_category: :container_registry do let(:settings) { table(:application_settings) } context 'with no rows in the application_settings table' do diff --git a/spec/migrations/update_application_settings_protected_paths_spec.rb b/spec/migrations/update_application_settings_protected_paths_spec.rb index b24eef2fcfc..d61eadf9f9c 100644 --- a/spec/migrations/update_application_settings_protected_paths_spec.rb +++ b/spec/migrations/update_application_settings_protected_paths_spec.rb @@ -3,7 +3,8 @@ require 'spec_helper' require_migration! -RSpec.describe UpdateApplicationSettingsProtectedPaths, :aggregate_failures do +RSpec.describe UpdateApplicationSettingsProtectedPaths, :aggregate_failures, +feature_category: :authentication_and_authorization do subject(:migration) { described_class.new } let!(:application_settings) { table(:application_settings) } diff --git a/spec/migrations/update_default_scan_method_of_dast_site_profile_spec.rb b/spec/migrations/update_default_scan_method_of_dast_site_profile_spec.rb index b73aa7016a1..ac7a4171063 100644 --- a/spec/migrations/update_default_scan_method_of_dast_site_profile_spec.rb +++ b/spec/migrations/update_default_scan_method_of_dast_site_profile_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_migration! -RSpec.describe UpdateDefaultScanMethodOfDastSiteProfile do +RSpec.describe UpdateDefaultScanMethodOfDastSiteProfile, feature_category: :dynamic_application_security_testing do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:dast_sites) { table(:dast_sites) } diff --git a/spec/migrations/update_integrations_trigger_type_new_on_insert_spec.rb b/spec/migrations/update_integrations_trigger_type_new_on_insert_spec.rb index 41cf35b40f4..efc051d9a68 100644 --- a/spec/migrations/update_integrations_trigger_type_new_on_insert_spec.rb +++ b/spec/migrations/update_integrations_trigger_type_new_on_insert_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe UpdateIntegrationsTriggerTypeNewOnInsert do +RSpec.describe UpdateIntegrationsTriggerTypeNewOnInsert, feature_category: :integrations do let(:migration) { described_class.new } let(:integrations) { table(:integrations) } diff --git a/spec/migrations/update_invalid_member_states_spec.rb b/spec/migrations/update_invalid_member_states_spec.rb index 802634230a9..6ae4b9f3c0f 100644 --- a/spec/migrations/update_invalid_member_states_spec.rb +++ b/spec/migrations/update_invalid_member_states_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe UpdateInvalidMemberStates do +RSpec.describe UpdateInvalidMemberStates, feature_category: :subgroups do let(:members) { table(:members) } let(:groups) { table(:namespaces) } let(:projects) { table(:projects) } diff --git a/spec/migrations/update_invalid_web_hooks_spec.rb b/spec/migrations/update_invalid_web_hooks_spec.rb index a65f82d7082..9e69d3637b8 100644 --- a/spec/migrations/update_invalid_web_hooks_spec.rb +++ b/spec/migrations/update_invalid_web_hooks_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require_migration! -RSpec.describe UpdateInvalidWebHooks do +RSpec.describe UpdateInvalidWebHooks, feature_category: :integrations do let(:web_hooks) { table(:web_hooks) } let(:groups) { table(:namespaces) } let(:projects) { table(:projects) } diff --git a/spec/models/concerns/bulk_insertable_associations_spec.rb b/spec/models/concerns/bulk_insertable_associations_spec.rb index 9713f1ce9a4..3187dcd8f93 100644 --- a/spec/models/concerns/bulk_insertable_associations_spec.rb +++ b/spec/models/concerns/bulk_insertable_associations_spec.rb @@ -3,34 +3,41 @@ require 'spec_helper' RSpec.describe BulkInsertableAssociations do - class BulkFoo < ApplicationRecord - include BulkInsertSafe + before do + stub_const('BulkFoo', Class.new(ApplicationRecord)) + stub_const('BulkBar', Class.new(ApplicationRecord)) + stub_const('SimpleBar', Class.new(ApplicationRecord)) + stub_const('BulkParent', Class.new(ApplicationRecord)) - self.table_name = '_test_bulk_foos' + BulkFoo.class_eval do + include BulkInsertSafe - validates :name, presence: true - end + self.table_name = '_test_bulk_foos' - class BulkBar < ApplicationRecord - include BulkInsertSafe + validates :name, presence: true + end - self.table_name = '_test_bulk_bars' - end + BulkBar.class_eval do + include BulkInsertSafe - SimpleBar = Class.new(ApplicationRecord) do - self.table_name = '_test_simple_bars' - end + self.table_name = '_test_bulk_bars' + end + + SimpleBar.class_eval do + self.table_name = '_test_simple_bars' + end - class BulkParent < ApplicationRecord - include BulkInsertableAssociations + BulkParent.class_eval do + include BulkInsertableAssociations - self.table_name = '_test_bulk_parents' + self.table_name = '_test_bulk_parents' - has_many :bulk_foos, class_name: 'BulkFoo' - has_many :bulk_hunks, class_name: 'BulkFoo' - has_many :bulk_bars, class_name: 'BulkBar' - has_many :simple_bars, class_name: 'SimpleBar' # not `BulkInsertSafe` - has_one :bulk_foo # not supported + has_many :bulk_foos, class_name: 'BulkFoo' + has_many :bulk_hunks, class_name: 'BulkFoo' + has_many :bulk_bars, class_name: 'BulkBar' + has_many :simple_bars, class_name: 'SimpleBar' # not `BulkInsertSafe` + has_one :bulk_foo # not supported + end end before(:all) do diff --git a/spec/services/ci/unlock_artifacts_service_spec.rb b/spec/services/ci/unlock_artifacts_service_spec.rb index f21afc7fe9e..c15e1cb2b5d 100644 --- a/spec/services/ci/unlock_artifacts_service_spec.rb +++ b/spec/services/ci/unlock_artifacts_service_spec.rb @@ -5,11 +5,11 @@ require 'spec_helper' RSpec.describe Ci::UnlockArtifactsService do using RSpec::Parameterized::TableSyntax - where(:tag, :ci_update_unlocked_job_artifacts) do - false | false - false | true - true | false - true | true + where(:tag) do + [ + [false], + [true] + ] end with_them do @@ -31,7 +31,6 @@ RSpec.describe Ci::UnlockArtifactsService do before do stub_const("#{described_class}::BATCH_SIZE", 1) - stub_feature_flags(ci_update_unlocked_job_artifacts: ci_update_unlocked_job_artifacts) end describe '#execute' do @@ -69,17 +68,11 @@ RSpec.describe Ci::UnlockArtifactsService do end it 'unlocks job artifact records' do - pending unless ci_update_unlocked_job_artifacts - expect { execute }.to change { ::Ci::JobArtifact.artifact_unlocked.count }.from(0).to(2) end it 'unlocks pipeline artifact records' do - if ci_update_unlocked_job_artifacts - expect { execute }.to change { ::Ci::PipelineArtifact.artifact_unlocked.count }.from(0).to(1) - else - expect { execute }.not_to change { ::Ci::PipelineArtifact.artifact_unlocked.count } - end + expect { execute }.to change { ::Ci::PipelineArtifact.artifact_unlocked.count }.from(0).to(1) end end @@ -111,17 +104,11 @@ RSpec.describe Ci::UnlockArtifactsService do end it 'unlocks job artifact records' do - pending unless ci_update_unlocked_job_artifacts - expect { execute }.to change { ::Ci::JobArtifact.artifact_unlocked.count }.from(0).to(8) end it 'unlocks pipeline artifact records' do - if ci_update_unlocked_job_artifacts - expect { execute }.to change { ::Ci::PipelineArtifact.artifact_unlocked.count }.from(0).to(1) - else - expect { execute }.not_to change { ::Ci::PipelineArtifact.artifact_unlocked.count } - end + expect { execute }.to change { ::Ci::PipelineArtifact.artifact_unlocked.count }.from(0).to(1) end end end diff --git a/spec/workers/ci/ref_delete_unlock_artifacts_worker_spec.rb b/spec/workers/ci/ref_delete_unlock_artifacts_worker_spec.rb index fe4bc2421a4..f14b7f9d1d0 100644 --- a/spec/workers/ci/ref_delete_unlock_artifacts_worker_spec.rb +++ b/spec/workers/ci/ref_delete_unlock_artifacts_worker_spec.rb @@ -46,30 +46,11 @@ RSpec.describe Ci::RefDeleteUnlockArtifactsWorker do context 'when a locked pipeline with persisted artifacts exists' do let!(:pipeline) { create(:ci_pipeline, :with_persisted_artifacts, ref: 'master', project: project, locked: :artifacts_locked) } - context 'with ci_update_unlocked_job_artifacts disabled' do - before do - stub_feature_flags(ci_update_unlocked_job_artifacts: false) - end + it 'logs the correct extra metadata' do + expect(worker).to receive(:log_extra_metadata_on_done).with(:unlocked_pipelines, 1) + expect(worker).to receive(:log_extra_metadata_on_done).with(:unlocked_job_artifacts, 2) - it 'logs the correct extra metadata' do - expect(worker).to receive(:log_extra_metadata_on_done).with(:unlocked_pipelines, 1) - expect(worker).to receive(:log_extra_metadata_on_done).with(:unlocked_job_artifacts, 0) - - perform - end - end - - context 'with ci_update_unlocked_job_artifacts enabled' do - before do - stub_feature_flags(ci_update_unlocked_job_artifacts: true) - end - - it 'logs the correct extra metadata' do - expect(worker).to receive(:log_extra_metadata_on_done).with(:unlocked_pipelines, 1) - expect(worker).to receive(:log_extra_metadata_on_done).with(:unlocked_job_artifacts, 2) - - perform - end + perform end end end |