diff --git a/ee/elastic/docs/20230719211400_add_archived_to_wikis.yml b/ee/elastic/docs/20230719211400_add_archived_to_wikis.yml index efe2676fece36ec29f3082ce616a15042b7b5295..2e5b8d9a30a8c87f1d6088417e017e8287e27e18 100644 --- a/ee/elastic/docs/20230719211400_add_archived_to_wikis.yml +++ b/ee/elastic/docs/20230719211400_add_archived_to_wikis.yml @@ -5,6 +5,6 @@ description: Adds the boolean archived field on wikis index group: group::global search milestone: '16.3' introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/126157 -obsolete: false -marked_obsolete_by_url: -marked_obsolete_in_milestone: +obsolete: true +marked_obsolete_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/159448 +marked_obsolete_in_milestone: '17.3' diff --git a/ee/elastic/migrate/20230719211400_add_archived_to_wikis.rb b/ee/elastic/migrate/20230719211400_add_archived_to_wikis.rb index 4b576100cfd95308d439620801db24d19f16b65d..3b96ed542ae04d8a4652d4e4495dee05a7d08e3f 100644 --- a/ee/elastic/migrate/20230719211400_add_archived_to_wikis.rb +++ b/ee/elastic/migrate/20230719211400_add_archived_to_wikis.rb @@ -13,3 +13,5 @@ def new_mappings { archived: { type: 'boolean' } } end end + +AddArchivedToWikis.prepend ::Elastic::MigrationObsolete diff --git a/ee/lib/gitlab/elastic/indexer.rb b/ee/lib/gitlab/elastic/indexer.rb index 1837d0bc8fc009fb768d5841bec2828443234152..070744479576fc123296ded438bd2c497a71a615 100644 --- a/ee/lib/gitlab/elastic/indexer.rb +++ b/ee/lib/gitlab/elastic/indexer.rb @@ -186,7 +186,7 @@ def build_command(base_sha, to_sha) def build_wiki_specific_flags %W[--blob-type=wiki_blob --skip-commits --wiki-access-level=#{container.wiki_access_level}].tap do |c| - c << "--archived=#{project.archived}" if project && migration_finished?(:add_archived_to_wikis) + c << "--archived=#{project.archived}" if project c << "--schema-version-wiki=#{WIKI_SCHEMA_VERSION}" end end diff --git a/ee/spec/elastic/migrate/20230719211400_add_archived_to_wikis_spec.rb b/ee/spec/elastic/migrate/20230719211400_add_archived_to_wikis_spec.rb index 90802f08c5bef288af90a6b6d946123802aa08f1..398d9f28e8cad511c9a1f5e832c9d1dea3783cfb 100644 --- a/ee/spec/elastic/migrate/20230719211400_add_archived_to_wikis_spec.rb +++ b/ee/spec/elastic/migrate/20230719211400_add_archived_to_wikis_spec.rb @@ -3,8 +3,6 @@ require 'spec_helper' require File.expand_path('ee/elastic/migrate/20230719211400_add_archived_to_wikis.rb') -RSpec.describe AddArchivedToWikis, :elastic, :sidekiq_inline, feature_category: :global_search do - let(:version) { 20230719211400 } - - include_examples 'migration adds mapping' +RSpec.describe AddArchivedToWikis, feature_category: :global_search do + it_behaves_like 'a deprecated Advanced Search migration', 20230719211400 end diff --git a/ee/spec/lib/gitlab/elastic/indexer_spec.rb b/ee/spec/lib/gitlab/elastic/indexer_spec.rb index 86c31b3cf30f46530f0f5d253e60968011f24c73..5280051b944a7852d846169643ebc94715ce2f74 100644 --- a/ee/spec/lib/gitlab/elastic/indexer_spec.rb +++ b/ee/spec/lib/gitlab/elastic/indexer_spec.rb @@ -405,46 +405,6 @@ def indexed_commits_for(term) expect(indexed_wiki_paths_for('23')).not_to include('23.md') end end - - context 'when add_archived_to_wikis migration is not completed' do - before do - set_elasticsearch_migration_to(:add_archived_to_wikis, including: false) - end - - it 'runs the indexer without --archived flag' do - gitaly_connection_data = { - storage: project.repository_storage, - limit_file_size: Gitlab::CurrentSettings.elasticsearch_indexed_file_size_limit_kb.kilobytes - }.merge(Gitlab::GitalyClient.connection_data(project.repository_storage)) - expect_popen.with( - [ - TestEnv.indexer_bin_path, - "--timeout=#{described_class::TIMEOUT}s", - "--visibility-level=#{project.visibility_level}", - "--project-id=#{project.id}", - '--search-curation', - "--from-sha=#{expected_from_sha}", - "--to-sha=#{to_sha}", - "--full-path=#{project.full_path}", - '--blob-type=wiki_blob', - '--skip-commits', - "--wiki-access-level=#{project.wiki_access_level}", - "--schema-version-wiki=#{described_class::WIKI_SCHEMA_VERSION}", - "--traversal-ids=#{project.namespace_ancestry}", - "#{project.wiki.repository.disk_path}.git" - ], - nil, - hash_including( - 'GITALY_CONNECTION_INFO' => gitaly_connection_data.to_json, - 'ELASTIC_CONNECTION_INFO' => elasticsearch_config.to_json, - 'RAILS_ENV' => Rails.env, - 'CORRELATION_ID' => Labkit::Correlation::CorrelationId.current_id - ) - ).and_return(popen_success) - - indexer.run - end - end end end