diff options
16 files changed, 214 insertions, 13 deletions
diff --git a/.gitlab/ci/review.gitlab-ci.yml b/.gitlab/ci/review.gitlab-ci.yml index f1bd173ff6d..4422968ea4e 100644 --- a/.gitlab/ci/review.gitlab-ci.yml +++ b/.gitlab/ci/review.gitlab-ci.yml @@ -48,7 +48,7 @@ review-build-cng: HOST_SUFFIX: "${CI_ENVIRONMENT_SLUG}" REVIEW_APPS_DOMAIN: "temp.gitlab-review.app" # FIXME: using temporary domain DOMAIN: "-${CI_ENVIRONMENT_SLUG}.${REVIEW_APPS_DOMAIN}" - GITLAB_HELM_CHART_REF: "v4.3.0" + GITLAB_HELM_CHART_REF: "v4.6.3" environment: name: review/${CI_COMMIT_REF_SLUG}${FREQUENCY} url: https://gitlab-${CI_ENVIRONMENT_SLUG}.${REVIEW_APPS_DOMAIN} diff --git a/changelogs/unreleased/ak-fix-project-transfer-2.yml b/changelogs/unreleased/ak-fix-project-transfer-2.yml new file mode 100644 index 00000000000..f75e498bbc5 --- /dev/null +++ b/changelogs/unreleased/ak-fix-project-transfer-2.yml @@ -0,0 +1,5 @@ +--- +title: Fix project transfer corrupting shared runners state +merge_request: 47316 +author: +type: fixed diff --git a/changelogs/unreleased/upgrade-codequality-0-85-19.yml b/changelogs/unreleased/upgrade-codequality-0-85-19.yml new file mode 100644 index 00000000000..ff6e56d6615 --- /dev/null +++ b/changelogs/unreleased/upgrade-codequality-0-85-19.yml @@ -0,0 +1,5 @@ +--- +title: Upgrade CodeQuality version in CI template to 0.85.19 +merge_request: 50118 +author: +type: changed diff --git a/db/post_migrate/20201110161542_cleanup_transfered_projects_shared_runners.rb b/db/post_migrate/20201110161542_cleanup_transfered_projects_shared_runners.rb new file mode 100644 index 00000000000..5e907092e83 --- /dev/null +++ b/db/post_migrate/20201110161542_cleanup_transfered_projects_shared_runners.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +class CleanupTransferedProjectsSharedRunners < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + BATCH_SIZE = 25_000 + INTERVAL = 3.minutes + MIGRATION = 'ResetSharedRunnersForTransferredProjects' + + disable_ddl_transaction! + + class Namespace < ActiveRecord::Base + include EachBatch + + self.table_name = 'namespaces' + end + + def up + queue_background_migration_jobs_by_range_at_intervals(Namespace, + MIGRATION, + INTERVAL, + batch_size: BATCH_SIZE) + end + + def down + # This migration fixes an inconsistent database state resulting from https://gitlab.com/gitlab-org/gitlab/-/issues/271728 + # and as such does not require a down migration + end +end diff --git a/db/schema_migrations/20201110161542 b/db/schema_migrations/20201110161542 new file mode 100644 index 00000000000..1d4ca947738 --- /dev/null +++ b/db/schema_migrations/20201110161542 @@ -0,0 +1 @@ +ebc304867bab499da3f9fa69b32373a328948b5068b226df5166042d1c1c7604
\ No newline at end of file diff --git a/doc/.vale/gitlab/spelling-exceptions.txt b/doc/.vale/gitlab/spelling-exceptions.txt index fd3aff63bce..3d8e9b1ef72 100644 --- a/doc/.vale/gitlab/spelling-exceptions.txt +++ b/doc/.vale/gitlab/spelling-exceptions.txt @@ -404,6 +404,8 @@ reusability reverified reverifies reverify +roadmap +roadmaps rollout rollouts rsync diff --git a/doc/user/group/roadmap/img/roadmap_filters_v13_7.png b/doc/user/group/roadmap/img/roadmap_filters_v13_7.png Binary files differnew file mode 100644 index 00000000000..00505a7f34f --- /dev/null +++ b/doc/user/group/roadmap/img/roadmap_filters_v13_7.png diff --git a/doc/user/group/roadmap/index.md b/doc/user/group/roadmap/index.md index 32abc676352..6dfa7641dbb 100644 --- a/doc/user/group/roadmap/index.md +++ b/doc/user/group/roadmap/index.md @@ -15,7 +15,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w > - In [GitLab 13.2](https://gitlab.com/gitlab-org/gitlab/-/issues/214375) and later, the Roadmap also shows milestones in projects in a group. > - In [GitLab 13.2](https://gitlab.com/gitlab-org/gitlab/-/issues/212494) and later, milestone bars can be collapsed and expanded. -Epics and milestones within a group containing a start date or due date can be visualized in a form +Epics and milestones in a group containing a start date or due date can be visualized in a form of a timeline (that is, a Gantt chart). The Roadmap page shows the epics and milestones in a group, one of its subgroups, or a project in one of the groups. @@ -24,14 +24,31 @@ When you hover over an epic bar, a popover appears with the epic's title, start weight completed. You can expand epics that contain child epics to show their child epics in the roadmap. -You can click the chevron (**{chevron-down}**) next to the epic title to expand and collapse the child epics. +You can click the chevron (**{chevron-down}**) next to the epic title to expand and collapse the +child epics. -On top of the milestone bars, you can see their title. When you hover a milestone bar or title, a popover appears with its title, start date and due date. -You can also click the chevron (**{chevron-down}**) next to the **Milestones** heading to toggle the list of the milestone bars. +On top of the milestone bars, you can see their title. +When you hover over a milestone bar or title, a popover appears with its title, start date, and due +date. You can also click the chevron (**{chevron-down}**) next to the **Milestones** heading to +toggle the list of the milestone bars. ![roadmap view](img/roadmap_view_v13_2.png) -A dropdown menu allows you to show only open or closed epics. By default, all epics are shown. +## Sort and filter the Roadmap + +> - Filtering roadmaps by milestone [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/218621) in GitLab 13.7. +> - Filtering roadmaps by milestone is [deployed behind a feature flag](../../feature_flags.md), enabled by default. +> - Filtering roadmaps by milestone is enabled on GitLab.com. +> - Filtering roadmaps by milestone is recommended for production use. +> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-filtering-roadmaps-by-milestone). **(PREMIUM ONLY)** + +WARNING: +Filtering roadmaps by milestone might not be available to you. Check the **version history** note above for details. + +When you want to explore a roadmap, there are several ways to make it easier by sorting epics or +filtering them by what's important for you. + +A dropdown menu lets you show only open or closed epics. By default, all epics are shown. ![epics state dropdown](img/epics_state_dropdown_v12_10.png) @@ -45,8 +62,35 @@ You can sort epics in the Roadmap view by: Each option contains a button that toggles the sort order between **ascending** and **descending**. The sort option and order persist when browsing Epics, including the [epics list view](../epics/index.md). +You can also filter epics in the Roadmap view by: + +- Author +- Label +- Milestone + +![roadmap date range in weeks](img/roadmap_filters_v13_7.png) + Roadmaps can also be [visualized inside an epic](../epics/index.md#roadmap-in-epics). +### Enable or disable filtering roadmaps by milestone **(PREMIUM ONLY)** + +Filtering roadmaps by milestone is under development but ready for production use. +It is deployed behind a feature flag that is **enabled by default**. +[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md) +can opt to disable it. + +To enable it: + +```ruby +Feature.enable(:async_filtering) +``` + +To disable it: + +```ruby +Feature.disable(:async_filtering) +``` + ## Timeline duration > - Introduced in [GitLab Ultimate](https://about.gitlab.com/pricing/) 11.0. diff --git a/doc/user/project/labels.md b/doc/user/project/labels.md index 2f8603e1db0..7106c7c6aee 100644 --- a/doc/user/project/labels.md +++ b/doc/user/project/labels.md @@ -228,7 +228,7 @@ to label notifications for the project only, or the whole group. > - Priority sorting is based on the highest priority label only. [This discussion](https://gitlab.com/gitlab-org/gitlab/-/issues/14523) considers changing this. Labels can have relative priorities, which are used in the **Label priority** and -**Priority** sort orders of the epic, issue, and merge request list pages. Prioritization +**Priority** sort orders of issues and merge request list pages. Prioritization for both group and project labels happens at the project level, and cannot be done from the group label list. @@ -241,7 +241,7 @@ means higher priority. ![Drag to change label priority](img/labels_drag_priority_v12_1.gif) -On the epic, merge request, and issue list pages (for both groups and projects) you +On the merge request and issue list pages (for both groups and projects) you can sort by `Label priority` or `Priority`. If you sort by `Label priority`, GitLab uses this sort comparison order: diff --git a/doc/user/search/index.md b/doc/user/search/index.md index 8c3d941192c..106306356bb 100644 --- a/doc/user/search/index.md +++ b/doc/user/search/index.md @@ -118,6 +118,13 @@ the dropdown) **Approved-By** and select the user. ![Filter MRs by approved by](img/filter_approved_by_merge_requests_v13_0.png) +### Filtering merge requests by reviewer **(CORE)** + +> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/47605) in GitLab 13.7. + +To filter review requested merge requests for a specific individual, you can type (or select from +the dropdown) **Reviewer** and select the user. + ### Filtering merge requests by environment or deployment date **(CORE)** > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/44041) in GitLab 13.6. diff --git a/lib/gitlab/background_migration/reset_shared_runners_for_transferred_projects.rb b/lib/gitlab/background_migration/reset_shared_runners_for_transferred_projects.rb new file mode 100644 index 00000000000..0053cafb4ac --- /dev/null +++ b/lib/gitlab/background_migration/reset_shared_runners_for_transferred_projects.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Gitlab + module BackgroundMigration + # Resets inconsistent state of shared_runners_enabled for projects that have been transferred + class ResetSharedRunnersForTransferredProjects + # Model specifically used for migration. + class Namespace < ActiveRecord::Base + include EachBatch + + self.table_name = 'namespaces' + end + + # Model specifically used for migration. + class Project < ActiveRecord::Base + self.table_name = 'projects' + end + + def perform(start_id, stop_id) + Project.reset_column_information + + Namespace.where(id: start_id..stop_id).each_batch(of: 1_000) do |relation| + ids = relation.where(shared_runners_enabled: false, allow_descendants_override_disabled_shared_runners: false).select(:id) + + Project.where(namespace_id: ids).update_all(shared_runners_enabled: false) + end + end + end + end +end diff --git a/lib/gitlab/ci/templates/Jobs/Code-Quality.gitlab-ci.yml b/lib/gitlab/ci/templates/Jobs/Code-Quality.gitlab-ci.yml index 2ae9730ec1a..501d8737acd 100644 --- a/lib/gitlab/ci/templates/Jobs/Code-Quality.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Jobs/Code-Quality.gitlab-ci.yml @@ -7,7 +7,7 @@ code_quality: variables: DOCKER_DRIVER: overlay2 DOCKER_TLS_CERTDIR: "" - CODE_QUALITY_IMAGE: "registry.gitlab.com/gitlab-org/ci-cd/codequality:0.85.18-gitlab.1" + CODE_QUALITY_IMAGE: "registry.gitlab.com/gitlab-org/ci-cd/codequality:0.85.19" needs: [] script: - export SOURCE_CODE=$PWD diff --git a/spec/frontend/helpers/stub_transition.js b/spec/frontend/helpers/stub_transition.js new file mode 100644 index 00000000000..9cddb432a63 --- /dev/null +++ b/spec/frontend/helpers/stub_transition.js @@ -0,0 +1,8 @@ +export function stubTransition() { + return { + render() { + // eslint-disable-next-line no-underscore-dangle + return this.$options._renderChildren; + }, + }; +} diff --git a/spec/frontend/sidebar/components/time_tracking/time_tracker_spec.js b/spec/frontend/sidebar/components/time_tracking/time_tracker_spec.js index bcd2c14f2fa..28c268e87c8 100644 --- a/spec/frontend/sidebar/components/time_tracking/time_tracker_spec.js +++ b/spec/frontend/sidebar/components/time_tracking/time_tracker_spec.js @@ -1,5 +1,6 @@ import { createMockDirective } from 'helpers/vue_mock_directive'; import { mount } from '@vue/test-utils'; +import { stubTransition } from 'helpers/stub_transition'; import TimeTracker from '~/sidebar/components/time_tracking/time_tracker.vue'; describe('Issuable Time Tracker', () => { @@ -22,6 +23,9 @@ describe('Issuable Time Tracker', () => { mount(TimeTracker, { propsData: { ...defaultProps, ...props }, directives: { GlTooltip: createMockDirective() }, + stubs: { + transition: stubTransition(), + }, }); afterEach(() => { @@ -213,14 +217,12 @@ describe('Issuable Time Tracker', () => { findHelpButton().trigger('click'); await wrapper.vm.$nextTick(); - expect(findByTestId('helpPane').classes('help-state-toggle-enter')).toBe(true); - expect(findByTestId('helpPane').classes('help-state-toggle-leave')).toBe(false); + expect(findByTestId('helpPane').exists()).toBe(true); findCloseHelpButton().trigger('click'); await wrapper.vm.$nextTick(); - expect(findByTestId('helpPane').classes('help-state-toggle-leave')).toBe(true); - expect(findByTestId('helpPane').classes('help-state-toggle-enter')).toBe(false); + expect(findByTestId('helpPane').exists()).toBe(false); }); }); }); diff --git a/spec/lib/gitlab/background_migration/reset_shared_runners_for_transferred_projects_spec.rb b/spec/lib/gitlab/background_migration/reset_shared_runners_for_transferred_projects_spec.rb new file mode 100644 index 00000000000..68aa64a1c7d --- /dev/null +++ b/spec/lib/gitlab/background_migration/reset_shared_runners_for_transferred_projects_spec.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Gitlab::BackgroundMigration::ResetSharedRunnersForTransferredProjects, schema: 20201110161542 do + let(:namespaces) { table(:namespaces) } + let(:projects) { table(:projects) } + + let(:namespace_1) { namespaces.create!(name: 'foo', path: 'foo', shared_runners_enabled: true, allow_descendants_override_disabled_shared_runners: false ) } + let(:namespace_2) { namespaces.create!(name: 'foo', path: 'foo', shared_runners_enabled: false, allow_descendants_override_disabled_shared_runners: false ) } + let(:namespace_3) { namespaces.create!(name: 'bar', path: 'bar', shared_runners_enabled: false, allow_descendants_override_disabled_shared_runners: true ) } + let(:project_1_1) { projects.create!(namespace_id: namespace_1.id, shared_runners_enabled: true) } + let(:project_1_2) { projects.create!(namespace_id: namespace_1.id, shared_runners_enabled: false) } + let(:project_2_1) { projects.create!(namespace_id: namespace_2.id, shared_runners_enabled: true) } + let(:project_2_2) { projects.create!(namespace_id: namespace_2.id, shared_runners_enabled: false) } + let(:project_3_1) { projects.create!(namespace_id: namespace_3.id, shared_runners_enabled: true) } + let(:project_3_2) { projects.create!(namespace_id: namespace_3.id, shared_runners_enabled: false) } + + it 'corrects each project shared_runners_enabled column' do + expect do + described_class.new.perform(namespace_1.id, namespace_3.id) + project_1_1.reload + project_1_2.reload + project_2_1.reload + project_2_2.reload + project_3_1.reload + project_3_2.reload + end.to not_change(project_1_1, :shared_runners_enabled).from(true) + .and not_change(project_1_2, :shared_runners_enabled).from(false) + .and change(project_2_1, :shared_runners_enabled).from(true).to(false) + .and not_change(project_2_2, :shared_runners_enabled).from(false) + .and not_change(project_3_1, :shared_runners_enabled).from(true) + .and not_change(project_3_2, :shared_runners_enabled).from(false) + end +end diff --git a/spec/migrations/20201110161542_cleanup_transfered_projects_shared_runners_spec.rb b/spec/migrations/20201110161542_cleanup_transfered_projects_shared_runners_spec.rb new file mode 100644 index 00000000000..8563114c9f9 --- /dev/null +++ b/spec/migrations/20201110161542_cleanup_transfered_projects_shared_runners_spec.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +require 'spec_helper' +require Rails.root.join('db', 'post_migrate', '20201110161542_cleanup_transfered_projects_shared_runners.rb') + +RSpec.describe CleanupTransferedProjectsSharedRunners, :sidekiq, schema: 20201110161542 do + let(:namespaces) { table(:namespaces) } + let(:migration) { described_class.new } + let(:batch_interval) { described_class::INTERVAL } + + let!(:namespace_1) { namespaces.create!(name: 'foo', path: 'foo') } + let!(:namespace_2) { namespaces.create!(name: 'bar', path: 'bar') } + let!(:namespace_3) { namespaces.create!(name: 'baz', path: 'baz') } + + describe '#up' do + before do + stub_const("#{described_class}::BATCH_SIZE", 2) + end + + it 'schedules ResetSharedRunnersForTransferredProjects background jobs' do + Sidekiq::Testing.fake! do + freeze_time do + migration.up + + expect(BackgroundMigrationWorker.jobs.size).to eq(2) + expect(described_class::MIGRATION).to be_scheduled_delayed_migration(batch_interval, namespace_1.id, namespace_2.id) + expect(described_class::MIGRATION).to be_scheduled_delayed_migration(batch_interval * 2, namespace_3.id, namespace_3.id) + end + end + end + end +end |