Skip to content
Snippets Groups Projects
Verified Commit 9c48eb00 authored by Auto-quarantining bot's avatar Auto-quarantining bot Committed by GitLab
Browse files

Mark 20240517092224 as obsolete

This migration marks the 20240517092224 AddRoutingToIssues Advanced search migration as obsolete.

[Search for references to `add_routing_to_issues` in code](https://gitlab.com/search?project_id=278964&scope=blobs&search=add_routing_to_issues&regex=false))

At the moment, the `gitlab-housekeeper` is not always capable of removing all references so
you must check the diff and pipeline failures to confirm if there are any issues.
It is the responsibility of the assignee (picked from ~"group::global search") to push those changes to this branch.

[Read more](https://docs.gitlab.com/ee/development/search/advanced_search_migration_styleguide.html#cleaning-up-advanced-search-migrations)
about the process for marking Advanced search migrations as obsolete.

All Advanced search migrations must have had at least one
[required stop](https : // docs.gitlab.com / ee / development / database / required_stops.html)
to process the migration. Therefore we mark any Advanced search migrations added before the
last required stop as obsolete.

This change was generated by
[gitlab-housekeeper](https://gitlab.com/gitlab-org/gitlab/-/tree/master/gems/gitlab-housekeeper)
using the Keeps::MarkOldAdvancedSearchMigrationsAsObsolete keep.

To provide feedback on your experience with `gitlab-housekeeper` please create an issue with the
label ~"GitLab Housekeeper" and consider pinging the author of this keep.

Changelog: other
EE: true
parent 9f741d43
No related branches found
No related tags found
2 merge requests!173823Draft: Resolve "Add GraphQL mutation to enqueue the background job to enable SPP for all projects in group",!172937Mark 20240517092224 as obsolete
......@@ -5,6 +5,6 @@ description: Adds routing to the document source for consistency when using upse
group: group::global search
milestone: '17.1'
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/153394
obsolete: false
marked_obsolete_by_url:
marked_obsolete_in_milestone:
obsolete: true
marked_obsolete_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/172937
marked_obsolete_in_milestone: '17.7'
......@@ -11,3 +11,5 @@ def new_mappings
{ routing: { type: 'keyword' } }
end
end
AddRoutingToIssues.prepend ::Elastic::MigrationObsolete
......@@ -37,7 +37,7 @@ def as_indexed_json(options = {})
data['archived'] = target.project.archived?
data['work_item_type_id'] = target.work_item_type_id
data['routing'] = es_parent if ::Elastic::DataMigrationService.migration_has_finished?(:add_routing_to_issues)
data['routing'] = es_parent
data.merge(generic_attributes)
end
......
......@@ -144,14 +144,10 @@ def klass_proxy
private
def index_operation
return :upsert if klass == Issue && issue_upsert?
return :upsert if klass == Issue
:index
end
def issue_upsert?
::Elastic::DataMigrationService.migration_has_finished?(:add_routing_to_issues)
end
end
end
end
......@@ -4,9 +4,5 @@
require File.expand_path('ee/elastic/migrate/20240517092224_add_routing_to_issues.rb')
RSpec.describe AddRoutingToIssues, feature_category: :global_search do
let(:version) { 20240517092224 }
describe 'migration', :elastic, :sidekiq_inline do
include_examples 'migration adds mapping'
end
it_behaves_like 'a deprecated Advanced Search migration', 20240517092224
end
......@@ -227,22 +227,10 @@
describe '#operation' do
context 'for issue' do
before do
allow(::Elastic::DataMigrationService)
.to receive(:migration_has_finished?).with(:add_routing_to_issues).and_return(true)
end
it 'is upsert' do
expect(issue_as_ref.operation).to eq(:upsert)
end
it 'is index if routing is not added to the issues index' do
allow(::Elastic::DataMigrationService)
.to receive(:migration_has_finished?).with(:add_routing_to_issues).and_return(false)
expect(issue_as_ref.operation).to eq(:index)
end
it 'is delete if the database record does not exist' do
allow(issue_as_ref).to receive(:database_record).and_return(nil)
......
......@@ -121,13 +121,6 @@
expect(keys).to match_array(expected_keys)
end
context 'when add_routing_to_issues migration is not finished' do
it 'does not include routing' do
set_elasticsearch_migration_to :add_routing_to_issues, including: false
expect(issue.__elasticsearch__.as_indexed_json).not_to include('routing')
end
end
it 'handles a project missing project_feature', :aggregate_failures do
allow(issue.project).to receive(:project_feature).and_return(nil)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment