mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-07-25 16:03:48 +00:00
Update from merge request
This commit is contained in:
@ -180,6 +180,8 @@ module Projects
|
|||||||
end
|
end
|
||||||
|
|
||||||
def define_runners_variables
|
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
|
@project_runners = @project.runners.ordered.page(params[:project_page]).per(NUMBER_OF_RUNNERS_PER_PAGE).with_tags
|
||||||
|
|
||||||
@assignable_runners = current_user
|
@assignable_runners = current_user
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
---
|
---
|
||||||
migration_job_name: BackfillSnippetRepositoriesSnippetOrganizationId
|
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
|
feature_category: source_code_management
|
||||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/175410
|
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/175410
|
||||||
milestone: '17.10'
|
milestone: '17.10'
|
||||||
queued_migration_version: 20241211134715
|
queued_migration_version: 20241211134715
|
||||||
finalized_by: # version of the migration that finalized this BBM
|
finalized_by: '20250717232204'
|
||||||
|
@ -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
|
1
db/schema_migrations/20250717232204
Normal file
1
db/schema_migrations/20250717232204
Normal file
@ -0,0 +1 @@
|
|||||||
|
243d4617b21078c793fae163d28ab38a74cded2dde6a1c72cf83ecc0a2150600
|
@ -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) | |
|
| [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. |
|
| [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. |
|
| 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**:
|
**Footnotes**:
|
||||||
|
|
||||||
|
@ -39,77 +39,83 @@ RSpec.describe Projects::Settings::CiCdController, feature_category: :continuous
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with assignable project runners' do
|
context 'when vue_project_runners_settings is disabled' do
|
||||||
let(:project_runner) { create(:ci_runner, :project, projects: [other_project]) }
|
|
||||||
|
|
||||||
before do
|
before do
|
||||||
group.add_maintainer(user)
|
stub_feature_flags(vue_project_runners_settings: false)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'sets assignable project runners' do
|
context 'with assignable project runners' do
|
||||||
request
|
let(:project_runner) { create(:ci_runner, :project, projects: [other_project]) }
|
||||||
|
|
||||||
expect(assigns(:assignable_runners)).to contain_exactly(project_runner)
|
before do
|
||||||
end
|
group.add_maintainer(user)
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with project runners' do
|
it 'sets assignable project runners' do
|
||||||
let(:project_runner) { create(:ci_runner, :project, projects: [project]) }
|
request
|
||||||
|
|
||||||
it 'sets project runners' do
|
expect(assigns(:assignable_runners)).to contain_exactly(project_runner)
|
||||||
request
|
end
|
||||||
|
|
||||||
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 }
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'has the same number of queries with one tag or with many tags', :request_store do
|
context 'with project runners' do
|
||||||
group.add_maintainer(user)
|
let(:project_runner) { create(:ci_runner, :project, projects: [project]) }
|
||||||
|
|
||||||
show # warmup
|
it 'sets project runners' do
|
||||||
|
request
|
||||||
|
|
||||||
# with one tag
|
expect(assigns(:project_runners)).to contain_exactly(project_runner)
|
||||||
create(:ci_runner, :instance, tag_list: %w[shared_runner])
|
end
|
||||||
create(:ci_runner, :project, projects: [other_project], tag_list: %w[project_runner])
|
end
|
||||||
create(:ci_runner, :group, groups: [group], tag_list: %w[group_runner])
|
|
||||||
control = ActiveRecord::QueryRecorder.new { show }
|
|
||||||
|
|
||||||
# with several tags
|
context 'with group runners' do
|
||||||
create(:ci_runner, :instance, tag_list: %w[shared_runner tag2 tag3])
|
let(:project) { other_project }
|
||||||
create(:ci_runner, :project, projects: [other_project], tag_list: %w[project_runner tag2 tag3])
|
let!(:group_runner) { create(:ci_runner, :group, groups: [group]) }
|
||||||
create(:ci_runner, :group, groups: [group], tag_list: %w[group_runner tag2 tag3])
|
|
||||||
|
|
||||||
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user