Update from merge request

This commit is contained in:
root
2025-07-18 12:32:38 +00:00
parent ce2b1f9fcc
commit 7ac2df9f1c
6 changed files with 93 additions and 61 deletions

View File

@ -180,6 +180,8 @@ module Projects
end
def define_runners_variables
return if Feature.enabled?(:vue_project_runners_settings, @project)
@project_runners = @project.runners.ordered.page(params[:project_page]).per(NUMBER_OF_RUNNERS_PER_PAGE).with_tags
@assignable_runners = current_user

View File

@ -1,8 +1,9 @@
---
migration_job_name: BackfillSnippetRepositoriesSnippetOrganizationId
description: Backfills sharding key `snippet_repositories.snippet_organization_id` from `snippets`.
description: Backfills sharding key `snippet_repositories.snippet_organization_id`
from `snippets`.
feature_category: source_code_management
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/175410
milestone: '17.10'
queued_migration_version: 20241211134715
finalized_by: # version of the migration that finalized this BBM
finalized_by: '20250717232204'

View File

@ -0,0 +1,21 @@
# frozen_string_literal: true
class FinalizeHkBackfillSnippetRepositoriesSnippetOrganizationId < Gitlab::Database::Migration[2.3]
milestone '18.3'
disable_ddl_transaction!
restrict_gitlab_migration gitlab_schema: :gitlab_main_cell
def up
ensure_batched_background_migration_is_finished(
job_class_name: 'BackfillSnippetRepositoriesSnippetOrganizationId',
table_name: :snippet_repositories,
column_name: :snippet_id,
job_arguments: [:snippet_organization_id, :snippets, :organization_id, :snippet_id],
finalize: true
)
end
def down; end
end

View File

@ -0,0 +1 @@
243d4617b21078c793fae163d28ab38a74cded2dde6a1c72cf83ecc0a2150600

View File

@ -235,6 +235,7 @@ successfully, you must replicate their data using some other means.
| [Dependency Proxy Images](../../../user/packages/dependency_proxy/_index.md) | [**Yes** (15.7)](https://gitlab.com/groups/gitlab-org/-/epics/8833) | [**Yes** (15.7)](https://gitlab.com/groups/gitlab-org/-/epics/8833) | [**Yes** (15.7)](https://gitlab.com/groups/gitlab-org/-/epics/8833) | [**Yes** (16.4)<sup>3</sup>](https://gitlab.com/groups/gitlab-org/-/epics/8056) | |
| [Vulnerability Export](../../../user/application_security/vulnerability_report/_index.md#exporting) | [Not planned](https://gitlab.com/groups/gitlab-org/-/epics/3111) | No | No | No | Not planned because they are ephemeral and sensitive information. They can be regenerated on demand. |
| Packages NPM metadata cache | [Not planned](https://gitlab.com/gitlab-org/gitlab/-/issues/408278) | No | No | No | Not planned because it would not notably improve disaster recovery capabilities nor response times at secondary sites. |
| SBOM Vulnerability Scan Data | [Not planned](https://gitlab.com/gitlab-org/gitlab/-/issues/398199) | No | No | No | Not planned because data is temporary and has a short lifespan with limited impact on disaster recovery capabilities at secondary sites. |
**Footnotes**:

View File

@ -39,77 +39,83 @@ RSpec.describe Projects::Settings::CiCdController, feature_category: :continuous
end
end
context 'with assignable project runners' do
let(:project_runner) { create(:ci_runner, :project, projects: [other_project]) }
context 'when vue_project_runners_settings is disabled' do
before do
group.add_maintainer(user)
stub_feature_flags(vue_project_runners_settings: false)
end
it 'sets assignable project runners' do
request
context 'with assignable project runners' do
let(:project_runner) { create(:ci_runner, :project, projects: [other_project]) }
expect(assigns(:assignable_runners)).to contain_exactly(project_runner)
end
end
before do
group.add_maintainer(user)
end
context 'with project runners' do
let(:project_runner) { create(:ci_runner, :project, projects: [project]) }
it 'sets assignable project runners' do
request
it 'sets project runners' do
request
expect(assigns(:project_runners)).to contain_exactly(project_runner)
end
end
context 'with group runners' do
let(:project) { other_project }
let!(:group_runner) { create(:ci_runner, :group, groups: [group]) }
it 'sets group runners' do
request
expect(assigns(:group_runners_count)).to be(1)
expect(assigns(:group_runners)).to contain_exactly(group_runner)
end
end
context 'with instance runners' do
let_it_be(:shared_runner) { create(:ci_runner, :instance) }
it 'sets shared runners' do
request
expect(assigns(:shared_runners_count)).to be(1)
expect(assigns(:shared_runners)).to contain_exactly(shared_runner)
end
end
context 'prevents N+1 queries for tags' do
render_views
def show
get :show, params: { namespace_id: project.namespace, project_id: project }
expect(assigns(:assignable_runners)).to contain_exactly(project_runner)
end
end
it 'has the same number of queries with one tag or with many tags', :request_store do
group.add_maintainer(user)
context 'with project runners' do
let(:project_runner) { create(:ci_runner, :project, projects: [project]) }
show # warmup
it 'sets project runners' do
request
# with one tag
create(:ci_runner, :instance, tag_list: %w[shared_runner])
create(:ci_runner, :project, projects: [other_project], tag_list: %w[project_runner])
create(:ci_runner, :group, groups: [group], tag_list: %w[group_runner])
control = ActiveRecord::QueryRecorder.new { show }
expect(assigns(:project_runners)).to contain_exactly(project_runner)
end
end
# with several tags
create(:ci_runner, :instance, tag_list: %w[shared_runner tag2 tag3])
create(:ci_runner, :project, projects: [other_project], tag_list: %w[project_runner tag2 tag3])
create(:ci_runner, :group, groups: [group], tag_list: %w[group_runner tag2 tag3])
context 'with group runners' do
let(:project) { other_project }
let!(:group_runner) { create(:ci_runner, :group, groups: [group]) }
expect { show }.not_to exceed_query_limit(control)
it 'sets group runners' do
request
expect(assigns(:group_runners_count)).to be(1)
expect(assigns(:group_runners)).to contain_exactly(group_runner)
end
end
context 'with instance runners' do
let_it_be(:shared_runner) { create(:ci_runner, :instance) }
it 'sets shared runners' do
request
expect(assigns(:shared_runners_count)).to be(1)
expect(assigns(:shared_runners)).to contain_exactly(shared_runner)
end
end
context 'prevents N+1 queries for tags' do
render_views
def show
get :show, params: { namespace_id: project.namespace, project_id: project }
end
it 'has the same number of queries with one tag or with many tags', :request_store do
group.add_maintainer(user)
show # warmup
# with one tag
create(:ci_runner, :instance, tag_list: %w[shared_runner])
create(:ci_runner, :project, projects: [other_project], tag_list: %w[project_runner])
create(:ci_runner, :group, groups: [group], tag_list: %w[group_runner])
control = ActiveRecord::QueryRecorder.new { show }
# with several tags
create(:ci_runner, :instance, tag_list: %w[shared_runner tag2 tag3])
create(:ci_runner, :project, projects: [other_project], tag_list: %w[project_runner tag2 tag3])
create(:ci_runner, :group, groups: [group], tag_list: %w[group_runner tag2 tag3])
expect { show }.not_to exceed_query_limit(control)
end
end
end