diff options
69 files changed, 342 insertions, 191 deletions
diff --git a/app/assets/javascripts/ci/ci_variable_list/components/ci_variable_shared.vue b/app/assets/javascripts/ci/ci_variable_list/components/ci_variable_shared.vue index f11d2c5ea65..011a424b6c2 100644 --- a/app/assets/javascripts/ci/ci_variable_list/components/ci_variable_shared.vue +++ b/app/assets/javascripts/ci/ci_variable_list/components/ci_variable_shared.vue @@ -2,7 +2,7 @@ import { createAlert } from '~/alert'; import { __ } from '~/locale'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; -import { reportMessageToSentry } from '~/ci/utils'; +import { reportToSentry } from '~/ci/utils'; import { mapEnvironmentNames } from '../utils'; import { ADD_MUTATION_ACTION, @@ -140,7 +140,7 @@ export default { this.loadingCounter += 1; } else { createAlert({ message: this.$options.tooManyCallsError }); - reportMessageToSentry(this.componentName, this.$options.tooManyCallsError); + reportToSentry(this.componentName, new Error(this.$options.tooManyCallsError)); } } }, diff --git a/app/assets/javascripts/ci/inherited_ci_variables/components/inherited_ci_variables_app.vue b/app/assets/javascripts/ci/inherited_ci_variables/components/inherited_ci_variables_app.vue index 42ec18d50aa..0b079ccb64f 100644 --- a/app/assets/javascripts/ci/inherited_ci_variables/components/inherited_ci_variables_app.vue +++ b/app/assets/javascripts/ci/inherited_ci_variables/components/inherited_ci_variables_app.vue @@ -3,7 +3,7 @@ import { produce } from 'immer'; import { s__ } from '~/locale'; import { createAlert } from '~/alert'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; -import { reportMessageToSentry } from '~/ci/utils'; +import { reportToSentry } from '~/ci/utils'; import CiVariableTable from '~/ci/ci_variable_list/components/ci_variable_table.vue'; import getInheritedCiVariables from '../graphql/queries/inherited_ci_variables.query.graphql'; @@ -51,7 +51,7 @@ export default { this.loadingCounter += 1; } else { createAlert({ message: this.$options.i18n.tooManyCallsError }); - reportMessageToSentry(this.$options.name, this.$options.i18n.tooManyCallsError); + reportToSentry(this.$options.name, new Error(this.$options.i18n.tooManyCallsError)); } }, error() { diff --git a/app/assets/javascripts/ci/job_details/components/manual_variables_form.vue b/app/assets/javascripts/ci/job_details/components/manual_variables_form.vue index b9f0a277348..7f419a249cf 100644 --- a/app/assets/javascripts/ci/job_details/components/manual_variables_form.vue +++ b/app/assets/javascripts/ci/job_details/components/manual_variables_form.vue @@ -18,7 +18,7 @@ import { JOB_GRAPHQL_ERRORS } from '~/ci/constants'; import { helpPagePath } from '~/helpers/help_page_helper'; import { redirectTo } from '~/lib/utils/url_utility'; // eslint-disable-line import/no-deprecated import { s__ } from '~/locale'; -import { reportMessageToSentry } from '~/ci/utils'; +import { reportToSentry } from '~/ci/utils'; import GetJob from '../graphql/queries/get_job.query.graphql'; import playJobWithVariablesMutation from '../graphql/mutations/job_play_with_variables.mutation.graphql'; import retryJobWithVariablesMutation from '../graphql/mutations/job_retry_with_variables.mutation.graphql'; @@ -57,7 +57,7 @@ export default { }, error(error) { createAlert({ message: JOB_GRAPHQL_ERRORS.jobQueryErrorText }); - reportMessageToSentry(this.$options.name, error); + reportToSentry(this.$options.name, error); }, }, }, @@ -141,7 +141,7 @@ export default { } } catch (error) { createAlert({ message: JOB_GRAPHQL_ERRORS.jobMutationErrorText }); - reportMessageToSentry(this.$options.name, error); + reportToSentry(this.$options.name, error); } }, async retryJob() { @@ -157,7 +157,7 @@ export default { } } catch (error) { createAlert({ message: JOB_GRAPHQL_ERRORS.jobMutationErrorText }); - reportMessageToSentry(this.$options.name, error); + reportToSentry(this.$options.name, error); } }, addEmptyVariable() { diff --git a/app/assets/javascripts/ci/jobs_page/components/job_cells/actions_cell.vue b/app/assets/javascripts/ci/jobs_page/components/job_cells/actions_cell.vue index abdb1f7c436..3ad2582e36b 100644 --- a/app/assets/javascripts/ci/jobs_page/components/job_cells/actions_cell.vue +++ b/app/assets/javascripts/ci/jobs_page/components/job_cells/actions_cell.vue @@ -7,7 +7,7 @@ import { GlSprintf, GlTooltipDirective, } from '@gitlab/ui'; -import { reportMessageToSentry } from '~/ci/utils'; +import { reportToSentry } from '~/ci/utils'; import GlCountdown from '~/vue_shared/components/gl_countdown.vue'; import { redirectTo } from '~/lib/utils/url_utility'; // eslint-disable-line import/no-deprecated import { @@ -133,7 +133,7 @@ export default { variables: { id: this.job.id }, }); if (errors.length > 0) { - reportMessageToSentry(this.$options.name, errors.join(', ')); + reportToSentry(this.$options.name, new Error(errors.join(', '))); this.showToastMessage(); } else if (redirect) { // Retry and Play actions redirect to job detail view @@ -143,7 +143,7 @@ export default { eventHub.$emit('jobActionPerformed'); } } catch (failure) { - reportMessageToSentry(this.$options.name, failure); + reportToSentry(this.$options.name, failure); this.showToastMessage(); } }, diff --git a/app/assets/javascripts/ci/pipeline_details/graph/graph_component_wrapper.vue b/app/assets/javascripts/ci/pipeline_details/graph/graph_component_wrapper.vue index 5ebdc838803..a6e7a645442 100644 --- a/app/assets/javascripts/ci/pipeline_details/graph/graph_component_wrapper.vue +++ b/app/assets/javascripts/ci/pipeline_details/graph/graph_component_wrapper.vue @@ -6,7 +6,7 @@ import { __, s__ } from '~/locale'; import LocalStorageSync from '~/vue_shared/components/local_storage_sync.vue'; import { DEFAULT, DRAW_FAILURE, LOAD_FAILURE } from '~/ci/pipeline_details/constants'; import getPipelineQuery from '~/ci/pipeline_details/header/graphql/queries/get_pipeline_header_data.query.graphql'; -import { reportToSentry, reportMessageToSentry } from '~/ci/utils'; +import { reportToSentry } from '~/ci/utils'; import DismissPipelineGraphCallout from './graphql/mutations/dismiss_pipeline_notification.graphql'; import { ACTION_FAILURE, @@ -156,10 +156,7 @@ export default { error(err) { this.reportFailure({ type: LOAD_FAILURE, skipSentry: true }); - reportMessageToSentry( - this.$options.name, - `| type: ${LOAD_FAILURE} , info: ${JSON.stringify(err)}`, - ); + reportToSentry(this.$options.name, new Error(err)); }, result({ data, error }) { const stages = data?.project?.pipeline?.stages?.nodes || []; diff --git a/app/assets/javascripts/ci/utils.js b/app/assets/javascripts/ci/utils.js index 5b57f63f44f..8a4f28404c6 100644 --- a/app/assets/javascripts/ci/utils.js +++ b/app/assets/javascripts/ci/utils.js @@ -7,11 +7,3 @@ export const reportToSentry = (component, failureType) => { }, }); }; - -export const reportMessageToSentry = (component, message) => { - Sentry.captureMessage(message, { - tags: { - component, - }, - }); -}; diff --git a/app/assets/javascripts/sentry/init_sentry.js b/app/assets/javascripts/sentry/init_sentry.js index 8561634cf9a..6f32c8c4165 100644 --- a/app/assets/javascripts/sentry/init_sentry.js +++ b/app/assets/javascripts/sentry/init_sentry.js @@ -8,7 +8,6 @@ import { // exports captureException, - captureMessage, SDK_VERSION, } from 'sentrybrowser'; @@ -82,7 +81,6 @@ const initSentry = () => { // eslint-disable-next-line no-underscore-dangle window._Sentry = { captureException, - captureMessage, SDK_VERSION, // used to verify compatibility with the Sentry instance }; }; diff --git a/app/assets/javascripts/sentry/sentry_browser_wrapper.js b/app/assets/javascripts/sentry/sentry_browser_wrapper.js index 83df04a7213..03cf53fabef 100644 --- a/app/assets/javascripts/sentry/sentry_browser_wrapper.js +++ b/app/assets/javascripts/sentry/sentry_browser_wrapper.js @@ -13,11 +13,3 @@ export const captureException = (...args) => { Sentry?.captureException(...args); }; - -/** @type {import('@sentry/core').captureMessage} */ -export const captureMessage = (...args) => { - // eslint-disable-next-line no-underscore-dangle - const Sentry = window._Sentry; - - Sentry?.captureMessage(...args); -}; diff --git a/app/models/award_emoji.rb b/app/models/award_emoji.rb index 73e3fa709b0..e445d08a096 100644 --- a/app/models/award_emoji.rb +++ b/app/models/award_emoji.rb @@ -9,7 +9,7 @@ class AwardEmoji < ApplicationRecord include Importable include IgnorableColumns - ignore_column :awardable_id_convert_to_bigint, remove_with: '16.2', remove_after: '2023-07-22' + ignore_column :awardable_id_convert_to_bigint, remove_with: '16.7', remove_after: '2023-11-16' belongs_to :awardable, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations belongs_to :user diff --git a/app/models/ci/ref.rb b/app/models/ci/ref.rb index a54d0b1d1db..8655e8eb9b8 100644 --- a/app/models/ci/ref.rb +++ b/app/models/ci/ref.rb @@ -36,11 +36,7 @@ module Ci next unless ci_ref.artifacts_locked? ci_ref.run_after_commit do - if Feature.enabled?(:ci_unlock_pipelines_queue, ci_ref.project) - Ci::Refs::UnlockPreviousPipelinesWorker.perform_async(ci_ref.id) - else - Ci::PipelineSuccessUnlockArtifactsWorker.perform_async(ci_ref.last_finished_pipeline_id) - end + Ci::Refs::UnlockPreviousPipelinesWorker.perform_async(ci_ref.id) end end end diff --git a/app/models/commit_user_mention.rb b/app/models/commit_user_mention.rb index 9215e15f07d..fa7f065b6b4 100644 --- a/app/models/commit_user_mention.rb +++ b/app/models/commit_user_mention.rb @@ -3,7 +3,7 @@ class CommitUserMention < UserMention include IgnorableColumns - ignore_column :note_id_convert_to_bigint, remove_with: '16.2', remove_after: '2023-07-22' + ignore_column :note_id_convert_to_bigint, remove_with: '16.7', remove_after: '2023-11-16' belongs_to :note end diff --git a/app/models/design_user_mention.rb b/app/models/design_user_mention.rb index 7d0cd72e9eb..ba1ef1b5712 100644 --- a/app/models/design_user_mention.rb +++ b/app/models/design_user_mention.rb @@ -3,7 +3,7 @@ class DesignUserMention < UserMention include IgnorableColumns - ignore_column :note_id_convert_to_bigint, remove_with: '16.2', remove_after: '2023-07-22' + ignore_column :note_id_convert_to_bigint, remove_with: '16.7', remove_after: '2023-11-16' belongs_to :design, class_name: 'DesignManagement::Design' belongs_to :note diff --git a/app/models/event.rb b/app/models/event.rb index 9e4a662aaa5..7de7ad8ccd6 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -12,7 +12,7 @@ class Event < ApplicationRecord include IgnorableColumns include EachBatch - ignore_column :target_id_convert_to_bigint, remove_with: '16.4', remove_after: '2023-09-22' + ignore_column :target_id_convert_to_bigint, remove_with: '16.7', remove_after: '2023-11-16' ACTIONS = HashWithIndifferentAccess.new( created: 1, diff --git a/app/models/issue_user_mention.rb b/app/models/issue_user_mention.rb index ad0df0dca78..6c3bedfccca 100644 --- a/app/models/issue_user_mention.rb +++ b/app/models/issue_user_mention.rb @@ -5,5 +5,5 @@ class IssueUserMention < UserMention belongs_to :note include IgnorableColumns - ignore_column :note_id_convert_to_bigint, remove_with: '16.2', remove_after: '2023-07-22' + ignore_column :note_id_convert_to_bigint, remove_with: '16.7', remove_after: '2023-11-16' end diff --git a/app/models/merge_request_user_mention.rb b/app/models/merge_request_user_mention.rb index 3157f1ca2aa..548a91162cd 100644 --- a/app/models/merge_request_user_mention.rb +++ b/app/models/merge_request_user_mention.rb @@ -3,7 +3,7 @@ class MergeRequestUserMention < UserMention include IgnorableColumns - ignore_column :note_id_convert_to_bigint, remove_with: '16.2', remove_after: '2023-07-22' + ignore_column :note_id_convert_to_bigint, remove_with: '16.7', remove_after: '2023-11-16' belongs_to :merge_request belongs_to :note diff --git a/app/models/note.rb b/app/models/note.rb index 64e8bb6ca17..eae7a40fb4e 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -26,7 +26,7 @@ class Note < ApplicationRecord include IgnorableColumns include Spammable - ignore_column :id_convert_to_bigint, remove_with: '16.3', remove_after: '2023-08-22' + ignore_column :id_convert_to_bigint, remove_with: '16.7', remove_after: '2023-11-16' ISSUE_TASK_SYSTEM_NOTE_PATTERN = /\A.*marked\sthe\stask.+as\s(completed|incomplete).*\z/ diff --git a/app/models/note_diff_file.rb b/app/models/note_diff_file.rb index b0f6af0d853..624a722e369 100644 --- a/app/models/note_diff_file.rb +++ b/app/models/note_diff_file.rb @@ -4,7 +4,7 @@ class NoteDiffFile < ApplicationRecord include DiffFile include IgnorableColumns - ignore_column :diff_note_id_convert_to_bigint, remove_with: '16.2', remove_after: '2023-07-22' + ignore_column :diff_note_id_convert_to_bigint, remove_with: '16.7', remove_after: '2023-11-16' scope :referencing_sha, -> (oids, project_id:) do joins(:diff_note).where(notes: { project_id: project_id, commit_id: oids }) diff --git a/app/models/snippet_user_mention.rb b/app/models/snippet_user_mention.rb index 8ef2c579a5a..2b6845495bc 100644 --- a/app/models/snippet_user_mention.rb +++ b/app/models/snippet_user_mention.rb @@ -3,7 +3,7 @@ class SnippetUserMention < UserMention include IgnorableColumns - ignore_column :note_id_convert_to_bigint, remove_with: '16.2', remove_after: '2023-07-22' + ignore_column :note_id_convert_to_bigint, remove_with: '16.7', remove_after: '2023-11-16' belongs_to :snippet belongs_to :note diff --git a/app/models/suggestion.rb b/app/models/suggestion.rb index 58a154b8986..c4178d3c5f1 100644 --- a/app/models/suggestion.rb +++ b/app/models/suggestion.rb @@ -5,7 +5,7 @@ class Suggestion < ApplicationRecord include Suggestible include IgnorableColumns - ignore_column :note_id_convert_to_bigint, remove_with: '16.2', remove_after: '2023-07-22' + ignore_column :note_id_convert_to_bigint, remove_with: '16.7', remove_after: '2023-11-16' belongs_to :note, inverse_of: :suggestions validates :note, presence: true, unless: :importing? diff --git a/app/models/system_note_metadata.rb b/app/models/system_note_metadata.rb index 4e71a13a3a1..dc93decce5e 100644 --- a/app/models/system_note_metadata.rb +++ b/app/models/system_note_metadata.rb @@ -4,7 +4,7 @@ class SystemNoteMetadata < ApplicationRecord include Importable include IgnorableColumns - ignore_column :note_id_convert_to_bigint, remove_with: '16.2', remove_after: '2023-07-22' + ignore_column :note_id_convert_to_bigint, remove_with: '16.7', remove_after: '2023-11-16' # These notes's action text might contain a reference that is external. # We should always force a deep validation upon references that are found diff --git a/app/models/timelog.rb b/app/models/timelog.rb index eb72456b435..b6b4decc64b 100644 --- a/app/models/timelog.rb +++ b/app/models/timelog.rb @@ -5,7 +5,7 @@ class Timelog < ApplicationRecord include IgnorableColumns include Sortable - ignore_column :note_id_convert_to_bigint, remove_with: '16.2', remove_after: '2023-07-22' + ignore_column :note_id_convert_to_bigint, remove_with: '16.7', remove_after: '2023-11-16' before_save :set_project diff --git a/app/models/todo.rb b/app/models/todo.rb index c49ed1093e1..e64dbf83a4c 100644 --- a/app/models/todo.rb +++ b/app/models/todo.rb @@ -6,7 +6,7 @@ class Todo < ApplicationRecord include EachBatch include IgnorableColumns - ignore_column :note_id_convert_to_bigint, remove_with: '16.2', remove_after: '2023-07-22' + ignore_column :note_id_convert_to_bigint, remove_with: '16.7', remove_after: '2023-11-16' # Time to wait for todos being removed when not visible for user anymore. # Prevents TODOs being removed by mistake, for example, removing access from a user diff --git a/app/views/layouts/terms.html.haml b/app/views/layouts/terms.html.haml index 29a561ae1a9..32f00a4c0c6 100644 --- a/app/views/layouts/terms.html.haml +++ b/app/views/layouts/terms.html.haml @@ -20,14 +20,11 @@ = render Pajamas::CardComponent.new do |c| - c.with_header do = brand_header_logo({add_gitlab_black_text: true}) + - if current_user + .gl-display-flex.gl-gap-2.gl-align-items-center + .gl-text-right.gl-line-height-normal + .gl-font-weight-bold= current_user.name + .gl-text-gray-700 @#{current_user.username} + = render Pajamas::AvatarComponent.new(current_user, size: 32, avatar_options: { data: { qa_selector: 'user_avatar_content' } }) - c.with_body do - - if header_link?(:user_dropdown) - .navbar-collapse - %ul.nav.navbar-nav - %li.header-user.dropdown - = link_to current_user, class: user_dropdown_class, data: { toggle: "dropdown" } do - = render Pajamas::AvatarComponent.new(current_user, size: 24, class: 'gl-mr-3', avatar_options: { data: { qa_selector: 'user_avatar_content' } }) - = sprite_icon('chevron-down') - .dropdown-menu.dropdown-menu-right - = render 'layouts/header/current_user_dropdown' = yield diff --git a/app/workers/ci/ref_delete_unlock_artifacts_worker.rb b/app/workers/ci/ref_delete_unlock_artifacts_worker.rb index 1565e2483e8..e343c0aedd4 100644 --- a/app/workers/ci/ref_delete_unlock_artifacts_worker.rb +++ b/app/workers/ci/ref_delete_unlock_artifacts_worker.rb @@ -13,13 +13,9 @@ module Ci def perform(project_id, user_id, ref_path) ::Project.find_by_id(project_id).try do |project| - ::User.find_by_id(user_id).try do |user| + ::User.find_by_id(user_id).try do |_| project.ci_refs.find_by_ref_path(ref_path).try do |ci_ref| - if Feature.enabled?(:ci_ref_delete_use_new_unlock_mechanism, project) - enqueue_pipelines_to_unlock(ci_ref) - else - unlock_artifacts(project, user, ci_ref) - end + enqueue_pipelines_to_unlock(ci_ref) end end end @@ -27,15 +23,6 @@ module Ci private - def unlock_artifacts(project, user, ci_ref) - result = ::Ci::UnlockArtifactsService - .new(project, user) - .execute(ci_ref) - - log_extra_metadata_on_done(:unlocked_pipelines, result[:unlocked_pipelines]) - log_extra_metadata_on_done(:unlocked_job_artifacts, result[:unlocked_job_artifacts]) - end - def enqueue_pipelines_to_unlock(ci_ref) result = ::Ci::Refs::EnqueuePipelinesToUnlockService.new.execute(ci_ref) diff --git a/app/workers/ci/unlock_pipelines_in_queue_worker.rb b/app/workers/ci/unlock_pipelines_in_queue_worker.rb index 2ae8e057b64..de579504711 100644 --- a/app/workers/ci/unlock_pipelines_in_queue_worker.rb +++ b/app/workers/ci/unlock_pipelines_in_queue_worker.rb @@ -45,6 +45,7 @@ module Ci elsif ::Feature.enabled?(:ci_unlock_pipelines_medium, type: :ops) MAX_RUNNING_MEDIUM elsif ::Feature.enabled?(:ci_unlock_pipelines, type: :ops) + # This is the default enabled flag MAX_RUNNING_LOW else 0 diff --git a/config/feature_flags/development/ci_ref_delete_use_new_unlock_mechanism.yml b/config/feature_flags/development/ci_ref_delete_use_new_unlock_mechanism.yml deleted file mode 100644 index 852e68bf2ed..00000000000 --- a/config/feature_flags/development/ci_ref_delete_use_new_unlock_mechanism.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: ci_ref_delete_use_new_unlock_mechanism -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/126757 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/426676 -milestone: '16.5' -type: development -group: group::pipeline security -default_enabled: false diff --git a/config/feature_flags/development/ci_unlock_pipelines_queue.yml b/config/feature_flags/development/ci_unlock_pipelines_queue.yml deleted file mode 100644 index 4e5792f807f..00000000000 --- a/config/feature_flags/development/ci_unlock_pipelines_queue.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: ci_unlock_pipelines_queue -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/124112 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/415503 -milestone: '16.2' -type: development -group: group::pipeline security -default_enabled: false diff --git a/config/feature_flags/ops/ci_unlock_pipelines.yml b/config/feature_flags/ops/ci_unlock_pipelines.yml index 30e9de203f3..c3503fab86c 100644 --- a/config/feature_flags/ops/ci_unlock_pipelines.yml +++ b/config/feature_flags/ops/ci_unlock_pipelines.yml @@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/415503 milestone: '16.2' type: ops group: group::pipeline security -default_enabled: false +default_enabled: true diff --git a/db/post_migrate/20231015225919_cleanup_bigint_conversion_for_notes_for_self_managed.rb b/db/post_migrate/20231015225919_cleanup_bigint_conversion_for_notes_for_self_managed.rb new file mode 100644 index 00000000000..3d2db6112d4 --- /dev/null +++ b/db/post_migrate/20231015225919_cleanup_bigint_conversion_for_notes_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForNotesForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:notes, [:id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231015230919_cleanup_bigint_conversion_for_todos_for_self_managed.rb b/db/post_migrate/20231015230919_cleanup_bigint_conversion_for_todos_for_self_managed.rb new file mode 100644 index 00000000000..7ca7ed4cf3f --- /dev/null +++ b/db/post_migrate/20231015230919_cleanup_bigint_conversion_for_todos_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForTodosForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:todos, [:note_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231015231919_cleanup_bigint_conversion_for_system_note_metadata_for_self_managed.rb b/db/post_migrate/20231015231919_cleanup_bigint_conversion_for_system_note_metadata_for_self_managed.rb new file mode 100644 index 00000000000..56ed481dcbd --- /dev/null +++ b/db/post_migrate/20231015231919_cleanup_bigint_conversion_for_system_note_metadata_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForSystemNoteMetadataForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:system_note_metadata, [:note_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231015232919_cleanup_bigint_conversion_for_epic_user_mentions_for_self_managed.rb b/db/post_migrate/20231015232919_cleanup_bigint_conversion_for_epic_user_mentions_for_self_managed.rb new file mode 100644 index 00000000000..8349fc45947 --- /dev/null +++ b/db/post_migrate/20231015232919_cleanup_bigint_conversion_for_epic_user_mentions_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForEpicUserMentionsForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:epic_user_mentions, [:note_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231015233919_cleanup_bigint_conversion_for_suggestions_for_self_managed.rb b/db/post_migrate/20231015233919_cleanup_bigint_conversion_for_suggestions_for_self_managed.rb new file mode 100644 index 00000000000..cca28e2ad8f --- /dev/null +++ b/db/post_migrate/20231015233919_cleanup_bigint_conversion_for_suggestions_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForSuggestionsForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:suggestions, [:note_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231015234919_cleanup_bigint_conversion_for_issue_user_mentions_for_self_managed.rb b/db/post_migrate/20231015234919_cleanup_bigint_conversion_for_issue_user_mentions_for_self_managed.rb new file mode 100644 index 00000000000..bc88aeb5f49 --- /dev/null +++ b/db/post_migrate/20231015234919_cleanup_bigint_conversion_for_issue_user_mentions_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForIssueUserMentionsForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:issue_user_mentions, [:note_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231015235919_cleanup_bigint_conversion_for_note_diff_files_for_self_managed.rb b/db/post_migrate/20231015235919_cleanup_bigint_conversion_for_note_diff_files_for_self_managed.rb new file mode 100644 index 00000000000..cde8d0ac745 --- /dev/null +++ b/db/post_migrate/20231015235919_cleanup_bigint_conversion_for_note_diff_files_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForNoteDiffFilesForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:note_diff_files, [:diff_note_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231016000919_cleanup_bigint_conversion_for_snippet_user_mentions_for_self_managed.rb b/db/post_migrate/20231016000919_cleanup_bigint_conversion_for_snippet_user_mentions_for_self_managed.rb new file mode 100644 index 00000000000..ad92e9416a0 --- /dev/null +++ b/db/post_migrate/20231016000919_cleanup_bigint_conversion_for_snippet_user_mentions_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForSnippetUserMentionsForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:snippet_user_mentions, [:note_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231016001919_cleanup_bigint_conversion_for_design_user_mentions_for_self_managed.rb b/db/post_migrate/20231016001919_cleanup_bigint_conversion_for_design_user_mentions_for_self_managed.rb new file mode 100644 index 00000000000..2d24be9988e --- /dev/null +++ b/db/post_migrate/20231016001919_cleanup_bigint_conversion_for_design_user_mentions_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForDesignUserMentionsForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:design_user_mentions, [:note_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231016002919_cleanup_bigint_conversion_for_vulnerability_user_mentions_for_self_managed.rb b/db/post_migrate/20231016002919_cleanup_bigint_conversion_for_vulnerability_user_mentions_for_self_managed.rb new file mode 100644 index 00000000000..253767ddc83 --- /dev/null +++ b/db/post_migrate/20231016002919_cleanup_bigint_conversion_for_vulnerability_user_mentions_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForVulnerabilityUserMentionsForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:vulnerability_user_mentions, [:note_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231016003919_cleanup_bigint_conversion_for_commit_user_mentions_for_self_managed.rb b/db/post_migrate/20231016003919_cleanup_bigint_conversion_for_commit_user_mentions_for_self_managed.rb new file mode 100644 index 00000000000..984e6df9a29 --- /dev/null +++ b/db/post_migrate/20231016003919_cleanup_bigint_conversion_for_commit_user_mentions_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForCommitUserMentionsForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:commit_user_mentions, [:note_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231016004919_cleanup_bigint_conversion_for_merge_request_user_mentions_for_self_managed.rb b/db/post_migrate/20231016004919_cleanup_bigint_conversion_for_merge_request_user_mentions_for_self_managed.rb new file mode 100644 index 00000000000..b0b5dde3a97 --- /dev/null +++ b/db/post_migrate/20231016004919_cleanup_bigint_conversion_for_merge_request_user_mentions_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForMergeRequestUserMentionsForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:merge_request_user_mentions, [:note_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231016005919_cleanup_bigint_conversion_for_timelogs_for_self_managed.rb b/db/post_migrate/20231016005919_cleanup_bigint_conversion_for_timelogs_for_self_managed.rb new file mode 100644 index 00000000000..91227c04428 --- /dev/null +++ b/db/post_migrate/20231016005919_cleanup_bigint_conversion_for_timelogs_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForTimelogsForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:timelogs, [:note_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231016010919_cleanup_bigint_conversion_for_award_emoji_for_self_managed.rb b/db/post_migrate/20231016010919_cleanup_bigint_conversion_for_award_emoji_for_self_managed.rb new file mode 100644 index 00000000000..25490c9403d --- /dev/null +++ b/db/post_migrate/20231016010919_cleanup_bigint_conversion_for_award_emoji_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForAwardEmojiForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:award_emoji, [:awardable_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231016011919_cleanup_bigint_conversion_for_events_for_self_managed.rb b/db/post_migrate/20231016011919_cleanup_bigint_conversion_for_events_for_self_managed.rb new file mode 100644 index 00000000000..e6df386cc14 --- /dev/null +++ b/db/post_migrate/20231016011919_cleanup_bigint_conversion_for_events_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForEventsForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:events, [:target_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231018100907_drop_index_namespaces_on_ldap_sync_last_update_at.rb b/db/post_migrate/20231018100907_drop_index_namespaces_on_ldap_sync_last_update_at.rb new file mode 100644 index 00000000000..862a68f84b9 --- /dev/null +++ b/db/post_migrate/20231018100907_drop_index_namespaces_on_ldap_sync_last_update_at.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class DropIndexNamespacesOnLdapSyncLastUpdateAt < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = :namespaces + INDEX_NAME = :index_namespaces_on_ldap_sync_last_update_at + + def up + remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME + end + + def down + # no-op + # Since adding the same index will be time consuming, + # we have to create it asynchronously using 'prepare_async_index' helper (if needed). + end +end diff --git a/db/schema_migrations/20231015225919 b/db/schema_migrations/20231015225919 new file mode 100644 index 00000000000..9bd05b9d7df --- /dev/null +++ b/db/schema_migrations/20231015225919 @@ -0,0 +1 @@ +3cd23fe20ec6c5ab7b98b35a5f6d393979c1881d7ef42a7f4bd062db0171bec3
\ No newline at end of file diff --git a/db/schema_migrations/20231015230919 b/db/schema_migrations/20231015230919 new file mode 100644 index 00000000000..6e0ce386ae4 --- /dev/null +++ b/db/schema_migrations/20231015230919 @@ -0,0 +1 @@ +d529c8f8a64426b708cf175ee97a2908d85b5c3a6404e5a579994f3f000e9d2b
\ No newline at end of file diff --git a/db/schema_migrations/20231015231919 b/db/schema_migrations/20231015231919 new file mode 100644 index 00000000000..0eda877e703 --- /dev/null +++ b/db/schema_migrations/20231015231919 @@ -0,0 +1 @@ +289e8527ee8986350994b4a0097b55232c46cbc52a76918a636615f4cfb61541
\ No newline at end of file diff --git a/db/schema_migrations/20231015232919 b/db/schema_migrations/20231015232919 new file mode 100644 index 00000000000..94915a1414b --- /dev/null +++ b/db/schema_migrations/20231015232919 @@ -0,0 +1 @@ +37b2dc0863c344eb099183ac6012e3d3a965fc3211e88bc3d09e6ea49ae347dd
\ No newline at end of file diff --git a/db/schema_migrations/20231015233919 b/db/schema_migrations/20231015233919 new file mode 100644 index 00000000000..3288438cadb --- /dev/null +++ b/db/schema_migrations/20231015233919 @@ -0,0 +1 @@ +18da30a225d477df0f8c3317308b076cb2d43326f9740a516b57f68f6851f757
\ No newline at end of file diff --git a/db/schema_migrations/20231015234919 b/db/schema_migrations/20231015234919 new file mode 100644 index 00000000000..2054d1e3948 --- /dev/null +++ b/db/schema_migrations/20231015234919 @@ -0,0 +1 @@ +285964fe818b347995a2c9bdc9d444b948fad99008657288f8ef05dcfe2d1277
\ No newline at end of file diff --git a/db/schema_migrations/20231015235919 b/db/schema_migrations/20231015235919 new file mode 100644 index 00000000000..221dd934dba --- /dev/null +++ b/db/schema_migrations/20231015235919 @@ -0,0 +1 @@ +784925e2c826975925b1eccd22ef4deff3af85caf52aaec9b71a9b44bb4125ae
\ No newline at end of file diff --git a/db/schema_migrations/20231016000919 b/db/schema_migrations/20231016000919 new file mode 100644 index 00000000000..2368f6cbd4c --- /dev/null +++ b/db/schema_migrations/20231016000919 @@ -0,0 +1 @@ +169fecc0f790e7a4765b0985b3e43e864f7f01a556e761fa30279940a37dd48c
\ No newline at end of file diff --git a/db/schema_migrations/20231016001919 b/db/schema_migrations/20231016001919 new file mode 100644 index 00000000000..408807d7a44 --- /dev/null +++ b/db/schema_migrations/20231016001919 @@ -0,0 +1 @@ +f84c337bc2befb1adfa6503db4adb4def52ad21a7f54afdbb17f0101de29bca7
\ No newline at end of file diff --git a/db/schema_migrations/20231016002919 b/db/schema_migrations/20231016002919 new file mode 100644 index 00000000000..07347e8a482 --- /dev/null +++ b/db/schema_migrations/20231016002919 @@ -0,0 +1 @@ +044d1d9c92b1e919a46db38134e1c451a0d0f44f6ae8a5e6be9bb85fac75bae4
\ No newline at end of file diff --git a/db/schema_migrations/20231016003919 b/db/schema_migrations/20231016003919 new file mode 100644 index 00000000000..1affa939a1c --- /dev/null +++ b/db/schema_migrations/20231016003919 @@ -0,0 +1 @@ +97f73e53981498655ba7bf73a22b0d3ee2287c9e3aae598644a31a334e7d3706
\ No newline at end of file diff --git a/db/schema_migrations/20231016004919 b/db/schema_migrations/20231016004919 new file mode 100644 index 00000000000..9b413b5d212 --- /dev/null +++ b/db/schema_migrations/20231016004919 @@ -0,0 +1 @@ +ef0489e703573dd89523a5d0789b2e27b4d5a0224549ef585371f787278c578e
\ No newline at end of file diff --git a/db/schema_migrations/20231016005919 b/db/schema_migrations/20231016005919 new file mode 100644 index 00000000000..3c2341316e5 --- /dev/null +++ b/db/schema_migrations/20231016005919 @@ -0,0 +1 @@ +eb163a8ef9ab96364ebdb91d86a3fb27df2623cbb26e68e0e8de2ff675360f1f
\ No newline at end of file diff --git a/db/schema_migrations/20231016010919 b/db/schema_migrations/20231016010919 new file mode 100644 index 00000000000..fee9b0e672a --- /dev/null +++ b/db/schema_migrations/20231016010919 @@ -0,0 +1 @@ +06fadb1cdfcca7e7674f49933e13ffa2c2277f3f17d854459bb515e2f4685a6c
\ No newline at end of file diff --git a/db/schema_migrations/20231016011919 b/db/schema_migrations/20231016011919 new file mode 100644 index 00000000000..6dc926d5119 --- /dev/null +++ b/db/schema_migrations/20231016011919 @@ -0,0 +1 @@ +d8e42e7e8e25373a3c59d638bfd23d8397fa7ae9983b3239bfe862b37ed20912
\ No newline at end of file diff --git a/db/schema_migrations/20231018100907 b/db/schema_migrations/20231018100907 new file mode 100644 index 00000000000..b83d601cb68 --- /dev/null +++ b/db/schema_migrations/20231018100907 @@ -0,0 +1 @@ +66176906b640cd7226c81618e9deb26b51800f07e2ecc1192d72dea3273108c4
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 9788ae9ad15..d7d5d469d9e 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -33173,8 +33173,6 @@ CREATE INDEX index_namespaces_on_file_template_project_id ON namespaces USING bt CREATE INDEX index_namespaces_on_ldap_sync_last_successful_update_at ON namespaces USING btree (ldap_sync_last_successful_update_at); -CREATE INDEX index_namespaces_on_ldap_sync_last_update_at ON namespaces USING btree (ldap_sync_last_update_at); - CREATE INDEX index_namespaces_on_name_trigram ON namespaces USING gin (name gin_trgm_ops); CREATE INDEX index_namespaces_on_organization_id ON namespaces USING btree (organization_id); diff --git a/lib/gitlab/database/migration_helpers.rb b/lib/gitlab/database/migration_helpers.rb index 2489b9a7e14..efcceafda90 100644 --- a/lib/gitlab/database/migration_helpers.rb +++ b/lib/gitlab/database/migration_helpers.rb @@ -751,7 +751,7 @@ module Gitlab trigger_name = rename_trigger_name(table, columns, temporary_columns) remove_rename_triggers(table, trigger_name) - temporary_columns.each { |column| remove_column(table, column) } + temporary_columns.each { |column| remove_column(table, column, if_exists: true) } end alias_method :cleanup_conversion_of_integer_to_bigint, :revert_initialize_conversion_of_integer_to_bigint diff --git a/spec/features/users/terms_spec.rb b/spec/features/users/terms_spec.rb index 3495af3ae85..e51ed3a0e80 100644 --- a/spec/features/users/terms_spec.rb +++ b/spec/features/users/terms_spec.rb @@ -157,8 +157,7 @@ RSpec.describe 'Users > Terms', :js, feature_category: :user_profile do it 'allows the user to sign out without a response' do visit terms_path - find('.header-user-dropdown-toggle').click - click_link('Sign out') + click_button('Decline and sign out') expect(page).to have_content('Sign in') expect(page).to have_content('Register') diff --git a/spec/frontend/sentry/init_sentry_spec.js b/spec/frontend/sentry/init_sentry_spec.js index 90693e70df0..fb0dba35759 100644 --- a/spec/frontend/sentry/init_sentry_spec.js +++ b/spec/frontend/sentry/init_sentry_spec.js @@ -7,7 +7,6 @@ import { // exports captureException, - captureMessage, SDK_VERSION, } from 'sentrybrowser'; import * as Sentry from 'sentrybrowser'; @@ -132,7 +131,6 @@ describe('SentryConfig', () => { // eslint-disable-next-line no-underscore-dangle expect(window._Sentry).toEqual({ captureException, - captureMessage, SDK_VERSION, }); }); diff --git a/spec/frontend/sentry/sentry_browser_wrapper_spec.js b/spec/frontend/sentry/sentry_browser_wrapper_spec.js index 674b1b73f5a..d98286e1371 100644 --- a/spec/frontend/sentry/sentry_browser_wrapper_spec.js +++ b/spec/frontend/sentry/sentry_browser_wrapper_spec.js @@ -1,7 +1,6 @@ import * as Sentry from '~/sentry/sentry_browser_wrapper'; const mockError = new Error('error!'); -const mockMsg = 'msg!'; describe('SentryBrowserWrapper', () => { afterEach(() => { @@ -13,23 +12,19 @@ describe('SentryBrowserWrapper', () => { it('methods fail silently', () => { expect(() => { Sentry.captureException(mockError); - Sentry.captureMessage(mockMsg); }).not.toThrow(); }); }); describe('when _Sentry is defined', () => { let mockCaptureException; - let mockCaptureMessage; beforeEach(() => { mockCaptureException = jest.fn(); - mockCaptureMessage = jest.fn(); // eslint-disable-next-line no-underscore-dangle window._Sentry = { captureException: mockCaptureException, - captureMessage: mockCaptureMessage, }; }); @@ -38,11 +33,5 @@ describe('SentryBrowserWrapper', () => { expect(mockCaptureException).toHaveBeenCalledWith(mockError); }); - - it('captureMessage is called', () => { - Sentry.captureMessage(mockMsg); - - expect(mockCaptureMessage).toHaveBeenCalledWith(mockMsg); - }); }); }); diff --git a/spec/lib/gitlab/database/migration_helpers_spec.rb b/spec/lib/gitlab/database/migration_helpers_spec.rb index 42fb28a2669..dd51cca688c 100644 --- a/spec/lib/gitlab/database/migration_helpers_spec.rb +++ b/spec/lib/gitlab/database/migration_helpers_spec.rb @@ -2355,6 +2355,7 @@ RSpec.describe Gitlab::Database::MigrationHelpers, feature_category: :database d end describe '#revert_initialize_conversion_of_integer_to_bigint' do + let(:setup_table) { true } let(:table) { :_test_table } before do @@ -2363,7 +2364,18 @@ RSpec.describe Gitlab::Database::MigrationHelpers, feature_category: :database d t.integer :other_id end - model.initialize_conversion_of_integer_to_bigint(table, columns) + model.initialize_conversion_of_integer_to_bigint(table, columns) if setup_table + end + + context 'when column and trigger do not exist' do + let(:setup_table) { false } + let(:columns) { :id } + + it 'does not raise an error' do + expect do + model.revert_initialize_conversion_of_integer_to_bigint(table, columns) + end.not_to raise_error + end end context 'when single column is given' do diff --git a/spec/models/ci/ref_spec.rb b/spec/models/ci/ref_spec.rb index dee330eda8b..75071a17fa9 100644 --- a/spec/models/ci/ref_spec.rb +++ b/spec/models/ci/ref_spec.rb @@ -10,11 +10,9 @@ RSpec.describe Ci::Ref, feature_category: :continuous_integration do describe 'state machine transitions' do context 'unlock artifacts transition' do let(:ci_ref) { create(:ci_ref) } - let(:pipeline_success_unlock_artifacts_worker_spy) { class_spy(::Ci::PipelineSuccessUnlockArtifactsWorker) } let(:unlock_previous_pipelines_worker_spy) { class_spy(::Ci::Refs::UnlockPreviousPipelinesWorker) } before do - stub_const('Ci::PipelineSuccessUnlockArtifactsWorker', pipeline_success_unlock_artifacts_worker_spy) stub_const('Ci::Refs::UnlockPreviousPipelinesWorker', unlock_previous_pipelines_worker_spy) end @@ -47,20 +45,6 @@ RSpec.describe Ci::Ref, feature_category: :continuous_integration do ci_ref.send(action) expect(unlock_previous_pipelines_worker_spy).to have_received(:perform_async).exactly(count).times - expect(pipeline_success_unlock_artifacts_worker_spy).not_to have_received(:perform_async) - end - - context 'when ci_unlock_pipelines_queue flag is disabled' do - before do - stub_feature_flags(ci_unlock_pipelines_queue: false) - end - - it 'calls pipeline success unlock artifacts service' do - ci_ref.send(action) - - expect(pipeline_success_unlock_artifacts_worker_spy).to have_received(:perform_async).exactly(count).times - expect(unlock_previous_pipelines_worker_spy).not_to have_received(:perform_async) - end end end end @@ -73,20 +57,6 @@ RSpec.describe Ci::Ref, feature_category: :continuous_integration do ci_ref.succeed! expect(unlock_previous_pipelines_worker_spy).not_to have_received(:perform_async) - expect(pipeline_success_unlock_artifacts_worker_spy).not_to have_received(:perform_async) - end - - context 'when ci_unlock_pipelines_queue flag is disabled' do - before do - stub_feature_flags(ci_unlock_pipelines_queue: false) - end - - it 'does not unlock pipelines' do - ci_ref.succeed! - - expect(unlock_previous_pipelines_worker_spy).not_to have_received(:perform_async) - expect(pipeline_success_unlock_artifacts_worker_spy).not_to have_received(:perform_async) - end end end end diff --git a/spec/views/layouts/terms.html.haml_spec.rb b/spec/views/layouts/terms.html.haml_spec.rb index 7bf97debbf9..a22eb8eff57 100644 --- a/spec/views/layouts/terms.html.haml_spec.rb +++ b/spec/views/layouts/terms.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'layouts/terms' do +RSpec.describe 'layouts/terms', feature_category: :user_profile do let_it_be(:user) { create(:user) } before do 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 e836bcafb61..dcdb96242c2 100644 --- a/spec/workers/ci/ref_delete_unlock_artifacts_worker_spec.rb +++ b/spec/workers/ci/ref_delete_unlock_artifacts_worker_spec.rb @@ -9,8 +9,6 @@ RSpec.describe Ci::RefDeleteUnlockArtifactsWorker, :unlock_pipelines, :clean_git let(:worker) { described_class.new } let(:ref) { 'refs/heads/master' } let(:project) { create(:project) } - let(:unlock_artifacts_service_class) { Ci::UnlockArtifactsService } - let(:unlock_artifacts_service_instance_spy) { instance_double(Ci::UnlockArtifactsService) } let(:enqueue_pipelines_to_unlock_service_class) { Ci::Refs::EnqueuePipelinesToUnlockService } let(:enqueue_pipelines_to_unlock_service_instance_spy) { instance_double(Ci::Refs::EnqueuePipelinesToUnlockService) } @@ -18,9 +16,6 @@ RSpec.describe Ci::RefDeleteUnlockArtifactsWorker, :unlock_pipelines, :clean_git let(:project_id) { project.id } before do - allow(unlock_artifacts_service_class) - .to receive(:new).and_return(unlock_artifacts_service_instance_spy) - allow(enqueue_pipelines_to_unlock_service_class) .to receive(:new).and_return(enqueue_pipelines_to_unlock_service_instance_spy) end @@ -40,29 +35,12 @@ RSpec.describe Ci::RefDeleteUnlockArtifactsWorker, :unlock_pipelines, :clean_git perform end - - context 'when ci_ref_delete_use_new_unlock_mechanism flag is disabled' do - before do - stub_feature_flags(ci_ref_delete_use_new_unlock_mechanism: false) - end - - it 'calls the unlock artifacts service' 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) - - expect(unlock_artifacts_service_instance_spy) - .to receive(:execute).with(ci_ref).and_return(unlocked_pipelines: 1, unlocked_job_artifacts: 2) - - perform - end - end end context 'when ci ref does not exist for the given project' do let!(:another_ci_ref) { create(:ci_ref, ref_path: ref) } it 'does not call the service' do - expect(unlock_artifacts_service_class).not_to receive(:new) expect(enqueue_pipelines_to_unlock_service_class).not_to receive(:new) perform @@ -79,19 +57,6 @@ RSpec.describe Ci::RefDeleteUnlockArtifactsWorker, :unlock_pipelines, :clean_git perform end - - context 'when ci_ref_delete_use_new_unlock_mechanism flag is disabled' do - before do - stub_feature_flags(ci_ref_delete_use_new_unlock_mechanism: false) - end - - it 'calls the unlock artifacts service with the correct ref' do - expect(unlock_artifacts_service_instance_spy) - .to receive(:execute).with(ci_ref).and_return(unlocked_pipelines: 1, unlocked_job_artifacts: 2) - - perform - end - end end end @@ -99,7 +64,6 @@ RSpec.describe Ci::RefDeleteUnlockArtifactsWorker, :unlock_pipelines, :clean_git let(:user_id) { non_existing_record_id } it 'does not call the service' do - expect(unlock_artifacts_service_class).not_to receive(:new) expect(enqueue_pipelines_to_unlock_service_class).not_to receive(:new) perform @@ -112,7 +76,6 @@ RSpec.describe Ci::RefDeleteUnlockArtifactsWorker, :unlock_pipelines, :clean_git let(:user_id) { project.creator.id } it 'does not call the service' do - expect(unlock_artifacts_service_class).not_to receive(:new) expect(enqueue_pipelines_to_unlock_service_class).not_to receive(:new) perform @@ -133,17 +96,6 @@ RSpec.describe Ci::RefDeleteUnlockArtifactsWorker, :unlock_pipelines, :clean_git expect(pipeline_ids_waiting_to_be_unlocked).to eq([pipeline.id]) end - - context 'when ci_ref_delete_use_new_unlock_mechanism flag is disabled' do - before do - stub_feature_flags(ci_ref_delete_use_new_unlock_mechanism: false) - end - - it 'unlocks the artifacts from older pipelines' do - expect { subject }.to change { pipeline.reload.locked }.from('artifacts_locked').to('unlocked') - expect(pipeline_ids_waiting_to_be_unlocked).to be_empty - end - end end end end |