Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2020-12-17 15:10:41 +00:00
parent 4e8387dc14
commit ef73ee020e
16 changed files with 214 additions and 13 deletions

View File

@ -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}

View File

@ -0,0 +1,5 @@
---
title: Fix project transfer corrupting shared runners state
merge_request: 47316
author:
type: fixed

View File

@ -0,0 +1,5 @@
---
title: Upgrade CodeQuality version in CI template to 0.85.19
merge_request: 50118
author:
type: changed

View File

@ -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

View File

@ -0,0 +1 @@
ebc304867bab499da3f9fa69b32373a328948b5068b226df5166042d1c1c7604

View File

@ -404,6 +404,8 @@ reusability
reverified
reverifies
reverify
roadmap
roadmaps
rollout
rollouts
rsync

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@ -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.

View File

@ -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:

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,8 @@
export function stubTransition() {
return {
render() {
// eslint-disable-next-line no-underscore-dangle
return this.$options._renderChildren;
},
};
}

View File

@ -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);
});
});
});

View File

@ -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

View File

@ -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