diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-30 03:09:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-30 03:09:36 +0300 |
commit | 0b54e3118075c2fc5f1f01b434b4694720597211 (patch) | |
tree | 9bbd415b8b99c54088533629f578550c6034a181 | |
parent | b5eff9f970d14c07742d3bbc60344cd738d4a9d2 (diff) |
Add latest changes from gitlab-org/gitlab@master
-rw-r--r-- | GITLAB_SHELL_VERSION | 2 | ||||
-rw-r--r-- | app/models/bulk_imports/entity.rb | 1 | ||||
-rw-r--r-- | db/migrate/20231126192652_remove_unique_url_indices_from_zoekt_nodes.rb | 19 | ||||
-rw-r--r-- | db/schema_migrations/20231126192652 | 1 | ||||
-rw-r--r-- | db/structure.sql | 4 | ||||
-rw-r--r-- | qa/Gemfile | 2 | ||||
-rw-r--r-- | qa/Gemfile.lock | 4 | ||||
-rwxr-xr-x | scripts/decomposition/generate-loose-foreign-key | 3 | ||||
-rw-r--r-- | spec/models/bulk_imports/entity_spec.rb | 7 |
9 files changed, 34 insertions, 9 deletions
diff --git a/GITLAB_SHELL_VERSION b/GITLAB_SHELL_VERSION index a742d263162..68acbd0debb 100644 --- a/GITLAB_SHELL_VERSION +++ b/GITLAB_SHELL_VERSION @@ -1 +1 @@ -14.30.1 +14.31.0 diff --git a/app/models/bulk_imports/entity.rb b/app/models/bulk_imports/entity.rb index d7ccd33d19d..7521cb7c27c 100644 --- a/app/models/bulk_imports/entity.rb +++ b/app/models/bulk_imports/entity.rb @@ -198,6 +198,7 @@ class BulkImports::Entity < ApplicationRecord return unless failures.any? update!(has_failures: true) + bulk_import.update!(has_failures: true) end def source_version diff --git a/db/migrate/20231126192652_remove_unique_url_indices_from_zoekt_nodes.rb b/db/migrate/20231126192652_remove_unique_url_indices_from_zoekt_nodes.rb new file mode 100644 index 00000000000..e193a83e24a --- /dev/null +++ b/db/migrate/20231126192652_remove_unique_url_indices_from_zoekt_nodes.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class RemoveUniqueUrlIndicesFromZoektNodes < Gitlab::Database::Migration[2.2] + milestone '16.7' + disable_ddl_transaction! + + INDEX_NAME_INDEX_URL = 'index_zoekt_nodes_on_index_base_url' + INDEX_NAME_SEARCH_URL = 'index_zoekt_nodes_on_search_base_url' + + def up + remove_concurrent_index :zoekt_nodes, :index_base_url, name: INDEX_NAME_INDEX_URL + remove_concurrent_index :zoekt_nodes, :search_base_url, name: INDEX_NAME_SEARCH_URL + end + + def down + add_concurrent_index :zoekt_nodes, :index_base_url, unique: true, name: INDEX_NAME_INDEX_URL + add_concurrent_index :zoekt_nodes, :search_base_url, unique: true, name: INDEX_NAME_SEARCH_URL + end +end diff --git a/db/schema_migrations/20231126192652 b/db/schema_migrations/20231126192652 new file mode 100644 index 00000000000..f7f3fc5f39e --- /dev/null +++ b/db/schema_migrations/20231126192652 @@ -0,0 +1 @@ +ba178548623ac51a403771d95b892506bd3c01337a5650a50df3060afa0c5f93
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index f08c94377a3..fb31618cd7b 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -35201,12 +35201,8 @@ CREATE INDEX index_zoekt_indexed_namespaces_on_namespace_id ON zoekt_indexed_nam CREATE UNIQUE INDEX index_zoekt_node_and_namespace ON zoekt_indexed_namespaces USING btree (zoekt_node_id, namespace_id); -CREATE UNIQUE INDEX index_zoekt_nodes_on_index_base_url ON zoekt_nodes USING btree (index_base_url); - CREATE INDEX index_zoekt_nodes_on_last_seen_at ON zoekt_nodes USING btree (last_seen_at); -CREATE UNIQUE INDEX index_zoekt_nodes_on_search_base_url ON zoekt_nodes USING btree (search_base_url); - CREATE UNIQUE INDEX index_zoekt_nodes_on_uuid ON zoekt_nodes USING btree (uuid); CREATE UNIQUE INDEX index_zoekt_shard_and_namespace ON zoekt_indexed_namespaces USING btree (zoekt_shard_id, namespace_id); diff --git a/qa/Gemfile b/qa/Gemfile index fd3fda424d9..57cdbbae18b 100644 --- a/qa/Gemfile +++ b/qa/Gemfile @@ -3,7 +3,7 @@ source 'https://rubygems.org' gem 'gitlab-qa', '~> 12', '>= 12.5.0', require: 'gitlab/qa' -gem 'gitlab_quality-test_tooling', '~> 1.5.4', require: false +gem 'gitlab_quality-test_tooling', '~> 1.7.0', require: false gem 'gitlab-utils', path: '../gems/gitlab-utils' gem 'activesupport', '~> 7.0.8' # This should stay in sync with the root's Gemfile gem 'allure-rspec', '~> 2.23.0' diff --git a/qa/Gemfile.lock b/qa/Gemfile.lock index 115ed2f065c..8b3a13c9d9e 100644 --- a/qa/Gemfile.lock +++ b/qa/Gemfile.lock @@ -132,7 +132,7 @@ GEM rainbow (>= 3, < 4) table_print (= 1.5.7) zeitwerk (>= 2, < 3) - gitlab_quality-test_tooling (1.5.4) + gitlab_quality-test_tooling (1.7.0) activesupport (>= 6.1, < 7.2) amatch (~> 0.4.1) gitlab (~> 4.19) @@ -365,7 +365,7 @@ DEPENDENCIES fog-google (~> 1.19) gitlab-qa (~> 12, >= 12.5.0) gitlab-utils! - gitlab_quality-test_tooling (~> 1.5.4) + gitlab_quality-test_tooling (~> 1.7.0) influxdb-client (~> 2.9) knapsack (~> 4.0) nokogiri (~> 1.15, >= 1.15.5) diff --git a/scripts/decomposition/generate-loose-foreign-key b/scripts/decomposition/generate-loose-foreign-key index d52fa2b4f3f..56d19cb3aa1 100755 --- a/scripts/decomposition/generate-loose-foreign-key +++ b/scripts/decomposition/generate-loose-foreign-key @@ -161,7 +161,8 @@ def generate_migration(definition) content = <<-EOF.strip_heredoc # frozen_string_literal: true - class Remove#{definition.to_table.camelcase}#{definition.from_table.camelcase}#{definition.column.camelcase}Fk < Gitlab::Database::Migration[2.1] + class Remove#{definition.to_table.camelcase}#{definition.from_table.camelcase}#{definition.column.camelcase}Fk < Gitlab::Database::Migration[#{Gitlab::Database::Migration.current_version}] + milestone '#{Gitlab.current_milestone}' disable_ddl_transaction! FOREIGN_KEY_NAME = "#{definition.name}" diff --git a/spec/models/bulk_imports/entity_spec.rb b/spec/models/bulk_imports/entity_spec.rb index b822786579b..b31afe30003 100644 --- a/spec/models/bulk_imports/entity_spec.rb +++ b/spec/models/bulk_imports/entity_spec.rb @@ -444,6 +444,13 @@ RSpec.describe BulkImports::Entity, type: :model, feature_category: :importers d expect(entity.has_failures).to eq(true) end + + it 'sets the has_failures flag on the parent import' do + create(:bulk_import_failure, entity: entity) + + expect { entity.update_has_failures } + .to change { entity.bulk_import.has_failures? }.from(false).to(true) + end end context 'when entity does not have failures' do |