Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
1b6c8b34c1
commit
fc8a3b9422
11 changed files with 134 additions and 24 deletions
|
@ -11,3 +11,15 @@ lint-yaml:
|
|||
LINT_PATHS: .gitlab-ci.yml .gitlab/ci lib/gitlab/ci/templates data/deprecations data/removals data/whats_new
|
||||
script:
|
||||
- yamllint --strict -f colored $LINT_PATHS
|
||||
|
||||
lint-metrics-yaml:
|
||||
extends:
|
||||
- .default-retry
|
||||
- .yaml-lint:rules
|
||||
image: pipelinecomponents/yamllint:latest
|
||||
stage: lint
|
||||
needs: []
|
||||
variables:
|
||||
LINT_PATHS: config/metrics
|
||||
script:
|
||||
- 'yamllint --strict -f colored -d "{extends: default, rules: {line-length: disable, document-start: disable, indentation: {spaces: 2, indent-sequences: whatever}}}" $LINT_PATHS'
|
||||
|
|
|
@ -37,16 +37,15 @@
|
|||
.scrolling-tabs-container.inner-page-scroll-tabs
|
||||
.fade-left= sprite_icon('chevron-lg-left', size: 12)
|
||||
.fade-right= sprite_icon('chevron-lg-right', size: 12)
|
||||
%ul.nav-links.scrolling-tabs.mobile-separator.nav.nav-tabs
|
||||
%li.js-subgroups_and_projects-tab
|
||||
= link_to group_path, data: { target: 'div#subgroups_and_projects', action: 'subgroups_and_projects', toggle: 'tab'} do
|
||||
= _("Subgroups and projects")
|
||||
%li.js-shared-tab
|
||||
= link_to group_shared_path, data: { target: 'div#shared', action: 'shared', toggle: 'tab'} do
|
||||
= _("Shared projects")
|
||||
%li.js-archived-tab
|
||||
= link_to group_archived_path, data: { target: 'div#archived', action: 'archived', toggle: 'tab'} do
|
||||
= _("Archived projects")
|
||||
-# `item_active` is set to `false` as the active state is set by `app/assets/javascripts/pages/groups/shared/group_details.js`
|
||||
-# TODO: Replace this approach in https://gitlab.com/gitlab-org/gitlab/-/issues/23466
|
||||
= gl_tabs_nav({ class: 'nav-links scrolling-tabs gl-display-flex gl-flex-grow-1 gl-flex-nowrap gl-border-0' }) do
|
||||
= gl_tab_link_to group_path, item_active: false, tab_class: 'js-subgroups_and_projects-tab', data: { target: 'div#subgroups_and_projects', action: 'subgroups_and_projects', toggle: 'tab' } do
|
||||
= _("Subgroups and projects")
|
||||
= gl_tab_link_to group_shared_path, item_active: false, tab_class: 'js-shared-tab', data: { target: 'div#shared', action: 'shared', toggle: 'tab' } do
|
||||
= _("Shared projects")
|
||||
= gl_tab_link_to group_archived_path, item_active: false, tab_class: 'js-archived-tab', data: { target: 'div#archived', action: 'archived', toggle: 'tab' } do
|
||||
= _("Archived projects")
|
||||
|
||||
.nav-controls.d-block.d-md-flex
|
||||
.group-search
|
||||
|
|
|
@ -9,5 +9,5 @@
|
|||
.text-content
|
||||
%h4= s_('Milestones|Use milestones to track issues and merge requests over a fixed period of time')
|
||||
%p.state-description
|
||||
= s_('Milestones|Organize issues and merge requests into a cohesive group, and set an optional start and due dates. %{learn_more_link}').html_safe % { learn_more_link: learn_more_link }
|
||||
= s_('Milestones|Organize issues and merge requests into a cohesive group, and set optional start and due dates. %{learn_more_link}').html_safe % { learn_more_link: learn_more_link }
|
||||
= yield
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# This migration acts as a gate-keeper for other migrations related to project namespace back-filling
|
||||
# so that other migrations that depend on project namespace back-filling cannot be run unless project namespace
|
||||
# back-filling has finalized successfully.
|
||||
class FinalizeProjectNamespacesBackfill < Gitlab::Database::Migration[1.0]
|
||||
MIGRATION = 'ProjectNamespaces::BackfillProjectNamespaces'
|
||||
|
||||
def up
|
||||
ensure_batched_background_migration_is_finished(
|
||||
job_class_name: MIGRATION,
|
||||
table_name: :projects,
|
||||
column_name: :id,
|
||||
job_arguments: [nil, 'up']
|
||||
)
|
||||
end
|
||||
|
||||
def down
|
||||
# noop
|
||||
end
|
||||
end
|
1
db/schema_migrations/20220322071127
Normal file
1
db/schema_migrations/20220322071127
Normal file
|
@ -0,0 +1 @@
|
|||
c7d84b6d92566d66f69732071fe7fc6c4e5ce32475e0d2c42413c9f005aed5b0
|
|
@ -31,11 +31,7 @@ on those issues. Please select someone with relevant experience from the
|
|||
If there is nobody mentioned with that expertise, look in the commit history for
|
||||
the affected files to find someone.
|
||||
|
||||
We also use [GitLab Triage](https://gitlab.com/gitlab-org/gitlab-triage) to automate
|
||||
some triaging policies. This is currently set up as a scheduled pipeline
|
||||
(`https://gitlab.com/gitlab-org/quality/triage-ops/-/pipeline_schedules/10512/edit`,
|
||||
must have at least the Developer role in the project) running on [quality/triage-ops](https://gitlab.com/gitlab-org/quality/triage-ops)
|
||||
project.
|
||||
We also have triage automation in place, described [in our handbook](https://about.gitlab.com/handbook/engineering/quality/triage-operations/).
|
||||
|
||||
## Labels
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ module Gitlab
|
|||
|
||||
begin
|
||||
update_batch(sub_batch, base_type_id)
|
||||
rescue ActiveRecord::StatementTimeout => e
|
||||
rescue ActiveRecord::StatementTimeout, ActiveRecord::QueryCanceled => e
|
||||
update_attempt += 1
|
||||
|
||||
if update_attempt <= MAX_UPDATE_RETRIES
|
||||
|
|
|
@ -101,7 +101,11 @@ flawfinder-sast:
|
|||
- if: $CI_COMMIT_BRANCH
|
||||
exists:
|
||||
- '**/*.c'
|
||||
- '**/*.cc'
|
||||
- '**/*.cpp'
|
||||
- '**/*.c++'
|
||||
- '**/*.cp'
|
||||
- '**/*.cxx'
|
||||
|
||||
kubesec-sast:
|
||||
extends: .sast-analyzer
|
||||
|
|
|
@ -24166,7 +24166,7 @@ msgstr ""
|
|||
msgid "Milestones|Ongoing Issues (open and assigned)"
|
||||
msgstr ""
|
||||
|
||||
msgid "Milestones|Organize issues and merge requests into a cohesive group, and set an optional start and due dates. %{learn_more_link}"
|
||||
msgid "Milestones|Organize issues and merge requests into a cohesive group, and set optional start and due dates. %{learn_more_link}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Milestones|Project Milestone"
|
||||
|
|
|
@ -48,12 +48,20 @@ RSpec.describe Gitlab::BackgroundMigration::BackfillWorkItemTypeIdForIssues do
|
|||
expect { migrate }.to change { migration.batch_metrics.timings }
|
||||
end
|
||||
|
||||
it 'retries on ActiveRecord::StatementTimeout' do
|
||||
expect(migration).to receive(:update_batch).exactly(3).times.and_raise(ActiveRecord::StatementTimeout)
|
||||
expect(migration).to receive(:sleep).with(30).twice
|
||||
context 'when database timeouts' do
|
||||
using RSpec::Parameterized::TableSyntax
|
||||
|
||||
expect do
|
||||
migrate
|
||||
end.to raise_error(ActiveRecord::StatementTimeout)
|
||||
where(error_class: [ActiveRecord::StatementTimeout, ActiveRecord::QueryCanceled])
|
||||
|
||||
with_them do
|
||||
it 'retries on timeout error' do
|
||||
expect(migration).to receive(:update_batch).exactly(3).times.and_raise(error_class)
|
||||
expect(migration).to receive(:sleep).with(30).twice
|
||||
|
||||
expect do
|
||||
migrate
|
||||
end.to raise_error(error_class)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
69
spec/migrations/finalize_project_namespaces_backfill_spec.rb
Normal file
69
spec/migrations/finalize_project_namespaces_backfill_spec.rb
Normal file
|
@ -0,0 +1,69 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
require_migration!
|
||||
|
||||
RSpec.describe FinalizeProjectNamespacesBackfill, :migration do
|
||||
let(:batched_migrations) { table(:batched_background_migrations) }
|
||||
|
||||
let_it_be(:migration) { described_class::MIGRATION }
|
||||
|
||||
describe '#up' do
|
||||
shared_examples 'raises migration not finished exception' do
|
||||
it 'raises exception' do
|
||||
expect { migrate! }.to raise_error(/Expected batched background migration for the given configuration to be marked as 'finished'/)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when project namespace backfilling migration is missing' do
|
||||
it 'warns migration not found' do
|
||||
expect(Gitlab::AppLogger)
|
||||
.to receive(:warn).with(/Could not find batched background migration for the given configuration:/)
|
||||
|
||||
migrate!
|
||||
end
|
||||
end
|
||||
|
||||
context 'with backfilling migration present' do
|
||||
let!(:project_namespace_backfill) do
|
||||
batched_migrations.create!(
|
||||
job_class_name: 'ProjectNamespaces::BackfillProjectNamespaces',
|
||||
table_name: :projects,
|
||||
column_name: :id,
|
||||
job_arguments: [nil, 'up'],
|
||||
interval: 2.minutes,
|
||||
min_value: 1,
|
||||
max_value: 2,
|
||||
batch_size: 1000,
|
||||
sub_batch_size: 200,
|
||||
status: 3 # finished
|
||||
)
|
||||
end
|
||||
|
||||
context 'when project namespace backfilling migration finished successfully' do
|
||||
it 'does not raise exception' do
|
||||
expect { migrate! }.not_to raise_error(/Expected batched background migration for the given configuration to be marked as 'finished'/)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when project namespace backfilling migration is paused' do
|
||||
using RSpec::Parameterized::TableSyntax
|
||||
|
||||
where(:status, :description) do
|
||||
0 | 'paused'
|
||||
1 | 'active'
|
||||
4 | 'failed'
|
||||
5 | 'finalizing'
|
||||
end
|
||||
|
||||
with_them do
|
||||
before do
|
||||
project_namespace_backfill.update!(status: status)
|
||||
end
|
||||
|
||||
it_behaves_like 'raises migration not finished exception'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue