diff options
-rw-r--r-- | app/models/members/member_role.rb | 3 | ||||
-rw-r--r-- | db/migrate/20221206222032_add_read_code_to_member_roles.rb | 7 | ||||
-rw-r--r-- | db/schema_migrations/20221206222032 | 1 | ||||
-rw-r--r-- | db/structure.sql | 3 | ||||
-rw-r--r-- | spec/requests/projects/ml/experiments_controller_spec.rb | 5 |
5 files changed, 15 insertions, 4 deletions
diff --git a/app/models/members/member_role.rb b/app/models/members/member_role.rb index 0661082dced..e9d7b1d3f80 100644 --- a/app/models/members/member_role.rb +++ b/app/models/members/member_role.rb @@ -1,6 +1,9 @@ # frozen_string_literal: true class MemberRole < ApplicationRecord # rubocop:disable Gitlab/NamespacedClass + include IgnorableColumns + ignore_column :download_code, remove_with: '15.9', remove_after: '2023-01-22' + has_many :members belongs_to :namespace diff --git a/db/migrate/20221206222032_add_read_code_to_member_roles.rb b/db/migrate/20221206222032_add_read_code_to_member_roles.rb new file mode 100644 index 00000000000..dc62672ccd0 --- /dev/null +++ b/db/migrate/20221206222032_add_read_code_to_member_roles.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddReadCodeToMemberRoles < Gitlab::Database::Migration[2.1] + def change + add_column :member_roles, :read_code, :boolean, default: false + end +end diff --git a/db/schema_migrations/20221206222032 b/db/schema_migrations/20221206222032 new file mode 100644 index 00000000000..16c8b6ea72b --- /dev/null +++ b/db/schema_migrations/20221206222032 @@ -0,0 +1 @@ +9e3f3c09100e3c26de7280bf30dc836a66d9fefb0894c86c80a3c5ee8e36235b
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 74c2a23ce4d..ce34161947f 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -17383,7 +17383,8 @@ CREATE TABLE member_roles ( created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, base_access_level integer NOT NULL, - download_code boolean DEFAULT false + download_code boolean DEFAULT false, + read_code boolean DEFAULT false ); CREATE SEQUENCE member_roles_id_seq diff --git a/spec/requests/projects/ml/experiments_controller_spec.rb b/spec/requests/projects/ml/experiments_controller_spec.rb index 414748c0804..f35f93b1e6c 100644 --- a/spec/requests/projects/ml/experiments_controller_spec.rb +++ b/spec/requests/projects/ml/experiments_controller_spec.rb @@ -17,7 +17,6 @@ RSpec.describe Projects::Ml::ExperimentsController, feature_category: :mlops do let(:params) { basic_params } let(:ff_value) { true } - let(:threshold) { 5 } let(:project) { project_with_feature } let(:basic_params) { { namespace_id: project.namespace.to_param, project_id: project } } @@ -48,11 +47,11 @@ RSpec.describe Projects::Ml::ExperimentsController, feature_category: :mlops do end it 'does not perform N+1 sql queries' do - control_count = ActiveRecord::QueryRecorder.new { list_experiments } + control_count = ActiveRecord::QueryRecorder.new(skip_cached: false) { list_experiments } create_list(:ml_experiments, 2, project: project, user: user) - expect { list_experiments }.not_to exceed_all_query_limit(control_count).with_threshold(threshold) + expect { list_experiments }.not_to exceed_all_query_limit(control_count) end context 'when :ml_experiment_tracking is disabled for the project' do |