提交 c7bdf253 编写于 作者: G GitLab Bot

Add latest changes from gitlab-org/gitlab@master

上级 3e71ce5c
......@@ -405,7 +405,7 @@ export default {
<compare-versions
:merge-request-diffs="mergeRequestDiffs"
:is-limited-container="isLimitedContainer"
:diff-files-length="diffFilesLength"
:diff-files-count-text="numTotalFiles"
/>
<hidden-files-warning
......
......@@ -32,9 +32,10 @@ export default {
required: false,
default: false,
},
diffFilesLength: {
type: Number,
required: true,
diffFilesCountText: {
type: String,
required: false,
default: null,
},
},
computed: {
......@@ -119,7 +120,7 @@ export default {
</div>
<div class="inline-parallel-buttons d-none d-md-flex ml-auto">
<diff-stats
:diff-files-length="diffFilesLength"
:diff-files-count-text="diffFilesCountText"
:added-lines="addedLines"
:removed-lines="removedLines"
/>
......
......@@ -14,18 +14,21 @@ export default {
type: Number,
required: true,
},
diffFilesLength: {
type: Number,
diffFilesCountText: {
type: String,
required: false,
default: null,
},
},
computed: {
diffFilesLength() {
return parseInt(this.diffFilesCountText, 10);
},
filesText() {
return n__('file', 'files', this.diffFilesLength);
},
isCompareVersionsHeader() {
return Boolean(this.diffFilesLength);
return Boolean(this.diffFilesCountText);
},
hasDiffFiles() {
return isNumber(this.diffFilesLength) && this.diffFilesLength >= 0;
......@@ -44,7 +47,7 @@ export default {
>
<div v-if="hasDiffFiles" class="diff-stats-group">
<icon name="doc-code" class="diff-stats-icon text-secondary" />
<span class="text-secondary bold">{{ diffFilesLength }} {{ filesText }}</span>
<span class="text-secondary bold">{{ diffFilesCountText }} {{ filesText }}</span>
</div>
<div
class="diff-stats-group cgreen d-flex align-items-center"
......
......@@ -86,7 +86,7 @@ export default {
:img-css-classes="imgCssClasses"
:img-src="avatarUrl(assignee)"
:img-size="iconSize"
class="js-no-trigger"
class="js-no-trigger author-link"
tooltip-placement="bottom"
data-qa-selector="assignee_link"
>
......
---
title: Display files in tab counter same as diff stats
merge_request: 37390
author:
type: fixed
......@@ -589,6 +589,9 @@ Gitlab.ee do
Settings.cron_jobs['vulnerability_statistics_schedule_worker'] ||= Settingslogic.new({})
Settings.cron_jobs['vulnerability_statistics_schedule_worker']['cron'] ||= '15 1 * * *'
Settings.cron_jobs['vulnerability_statistics_schedule_worker']['job_class'] = 'Vulnerabilities::Statistics::ScheduleWorker'
Settings.cron_jobs['vulnerability_historical_statistics_deletion_worker'] ||= Settingslogic.new({})
Settings.cron_jobs['vulnerability_historical_statistics_deletion_worker']['cron'] ||= '15 3 * * *'
Settings.cron_jobs['vulnerability_historical_statistics_deletion_worker']['job_class'] = 'Vulnerabilities::HistoricalStatistics::DeletionWorker'
end
#
......
# frozen_string_literal: true
class AddIndexOnVulnerabilityHistoricalStatisticsDate < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :vulnerability_historical_statistics, [:date, :id]
end
def down
remove_concurrent_index :vulnerability_historical_statistics, [:date, :id]
end
end
f55dccae8909110396882bd2c28be993eb32f33e880ed4a520d14071f70c9019
\ No newline at end of file
......@@ -20802,6 +20802,8 @@ CREATE INDEX index_vulnerability_feedback_on_merge_request_id ON public.vulnerab
CREATE INDEX index_vulnerability_feedback_on_pipeline_id ON public.vulnerability_feedback USING btree (pipeline_id);
CREATE INDEX index_vulnerability_historical_statistics_on_date_and_id ON public.vulnerability_historical_statistics USING btree (date, id);
CREATE UNIQUE INDEX index_vulnerability_identifiers_on_project_id_and_fingerprint ON public.vulnerability_identifiers USING btree (project_id, fingerprint);
CREATE INDEX index_vulnerability_issue_links_on_issue_id ON public.vulnerability_issue_links USING btree (issue_id);
......
......@@ -7,6 +7,10 @@ in production.
Troubleshooting and debugging your GitLab instance often requires a
[Rails console](https://guides.rubyonrails.org/command_line.html#rails-console).
See also:
- [GitLab Rails Console Cheat Sheet](gitlab_rails_cheat_sheet.md).
- [Navigating GitLab via Rails console](navigating_gitlab_via_rails_console.md).
**For Omnibus installations**
......
......@@ -3695,7 +3695,7 @@ Once an uninterruptible job is running, the pipeline will never be canceled, reg
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/15536) in GitLab 12.7.
Sometimes running multiples jobs or pipelines at the same time in an environment
Sometimes running multiple jobs or pipelines at the same time in an environment
can lead to errors during the deployment.
To avoid these errors, the `resource_group` attribute can be used to ensure that
......
......@@ -13,10 +13,38 @@ as much as possible.
## Overview
### Pipeline types
Pipelines for the GitLab project are created using the [`workflow:rules` keyword](../ci/yaml/README.md#workflowrules)
feature of the GitLab CI/CD.
Since we use the [`rules:`](../ci/yaml/README.md#rules) and [`needs:`](../ci/yaml/README.md#needs) keywords extensively,
we have four main pipeline types which are described below. Note that an MR that includes multiple types of changes would
Pipelines are always created for the following scenarios:
- `master` branch, including on schedules, pushes, merges, and so on.
- Merge requests.
- Tags.
- Stable, `auto-deploy`, and security branches.
Pipeline creation is also affected by the following CI variables:
- If `$FORCE_GITLAB_CI` is set, pipelines are created.
- If `$GITLAB_INTERNAL` is not set, pipelines are not created.
No pipeline is created in any other cases (for example, when pushing a branch with no
MR for it).
The source of truth for these workflow rules is defined in <https://gitlab.com/gitlab-org/gitlab/blob/master/.gitlab-ci.yml>.
### Pipelines for Merge Requests
In general, pipelines for an MR fall into one or more of the following types,
depending on the changes made in the MR:
- [Docs-only MR pipeline](#docs-only-mr-pipeline): This is typically created for an MR that only changes documentation.
- [Code-only MR pipeline](#code-only-mr-pipeline): This is typically created for an MR that only changes code, either backend or frontend.
- [Frontend-only MR pipeline](#frontend-only-mr-pipeline): This is typically created for an MR that only changes frontend code.
- [QA-only MR pipeline](#qa-only-mr-pipeline): This is typically created for an MR that only changes end to end tests related code.
We use the [`rules:`](../ci/yaml/README.md#rules) and [`needs:`](../ci/yaml/README.md#needs) keywords extensively
to determine the jobs that need to be run in a pipeline. Note that an MR that includes multiple types of changes would
have a pipelines that include jobs from multiple types (e.g. a combination of docs-only and code-only pipelines).
#### Docs-only MR pipeline
......@@ -345,22 +373,6 @@ graph RL;
end
```
### `workflow:rules`
We're using the [`workflow:rules` keyword](../ci/yaml/README.md#workflowrules) to
define default rules to determine whether or not a pipeline is created.
These rules are defined in <https://gitlab.com/gitlab-org/gitlab/blob/master/.gitlab-ci.yml>
and are as follows:
1. If `$FORCE_GITLAB_CI` is set, create a pipeline.
1. For merge requests, create a pipeline.
1. For `master` branch, create a pipeline (this includes on schedules, pushes, merges, etc.).
1. For tags, create a pipeline.
1. If `$GITLAB_INTERNAL` isn't set, don't create a pipeline.
1. For stable, auto-deploy, and security branches, create a pipeline.
1. For any other cases (e.g. when pushing a branch with no MR for it), no pipeline is created.
### PostgreSQL versions testing
#### Current versions testing
......
......@@ -15615,12 +15615,30 @@ msgstr ""
msgid "Network"
msgstr ""
msgid "Network Policy|New rule"
msgstr ""
msgid "NetworkPolicies|.yaml mode"
msgstr ""
msgid "NetworkPolicies|Actions"
msgstr ""
msgid "NetworkPolicies|Choose whether to enforce this policy."
msgstr ""
msgid "NetworkPolicies|Create policy"
msgstr ""
msgid "NetworkPolicies|Define this policy's location, conditions and actions."
msgstr ""
msgid "NetworkPolicies|Description"
msgstr ""
msgid "NetworkPolicies|Editor mode"
msgstr ""
msgid "NetworkPolicies|Enforcement status"
msgstr ""
......@@ -15642,6 +15660,9 @@ msgstr ""
msgid "NetworkPolicies|Name"
msgstr ""
msgid "NetworkPolicies|Network Policy"
msgstr ""
msgid "NetworkPolicies|New policy"
msgstr ""
......@@ -15663,6 +15684,21 @@ msgstr ""
msgid "NetworkPolicies|Policy editor"
msgstr ""
msgid "NetworkPolicies|Policy preview"
msgstr ""
msgid "NetworkPolicies|Policy status"
msgstr ""
msgid "NetworkPolicies|Policy type"
msgstr ""
msgid "NetworkPolicies|Rule mode"
msgstr ""
msgid "NetworkPolicies|Rules"
msgstr ""
msgid "NetworkPolicies|Something went wrong, failed to update policy"
msgstr ""
......@@ -15672,6 +15708,9 @@ msgstr ""
msgid "NetworkPolicies|Status"
msgstr ""
msgid "NetworkPolicies|YAML editor"
msgstr ""
msgid "Never"
msgstr ""
......
......@@ -8,7 +8,6 @@ RSpec.describe 'Multiple issue updating from issues#index', :js do
let!(:user) { create(:user)}
before do
stub_feature_flags(vue_issuables_list: false)
project.add_maintainer(user)
sign_in(user)
end
......@@ -52,7 +51,7 @@ RSpec.describe 'Multiple issue updating from issues#index', :js do
click_update_issues_button
page.within('.issue .controls') do
expect(find('.author-link')["title"]).to have_content(user.name)
expect(find('.author-link')['href']).to have_content(user.website_url)
end
end
......@@ -83,13 +82,15 @@ RSpec.describe 'Multiple issue updating from issues#index', :js do
find('.dropdown-menu-milestone a', text: milestone.title).click
click_update_issues_button
expect(find('.issue')).to have_content milestone.title
expect(page.find('.issue')).to have_content milestone.title
end
it 'sets to no milestone' do
create_with_milestone
visit project_issues_path(project)
wait_for_requests
expect(first('.issue')).to have_content milestone.title
click_button 'Edit issues'
......
......@@ -30,7 +30,7 @@ describe('CompareVersions', () => {
store,
propsData: {
mergeRequestDiffs: diffsMockData,
diffFilesLength: 0,
diffFilesCountText: null,
...props,
},
});
......
......@@ -4,7 +4,8 @@ import Icon from '~/vue_shared/components/icon.vue';
const TEST_ADDED_LINES = 100;
const TEST_REMOVED_LINES = 200;
const DIFF_FILES_LENGTH = 300;
const DIFF_FILES_COUNT = '300';
const DIFF_FILES_COUNT_TRUNCATED = '300+';
describe('diff_stats', () => {
let wrapper;
......@@ -22,45 +23,76 @@ describe('diff_stats', () => {
describe('diff stats group', () => {
const findDiffStatsGroup = () => wrapper.findAll('.diff-stats-group');
it('is not rendered if diffFileLengths is empty', () => {
it('is not rendered if diffFilesCountText is empty', () => {
createComponent();
expect(findDiffStatsGroup().length).toBe(2);
});
it('is not rendered if diffFileLengths is not a number', () => {
it('is not rendered if diffFilesCountText is not a number', () => {
createComponent({
diffFilesLength: Number.NaN,
diffFilesCountText: null,
});
expect(findDiffStatsGroup().length).toBe(2);
});
});
describe('amount displayed', () => {
beforeEach(() => {
createComponent({
diffFilesLength: DIFF_FILES_LENGTH,
});
describe('line changes', () => {
const findFileLine = name => wrapper.find(name);
it('shows the amount of lines added', () => {
expect(findFileLine('.js-file-addition-line').text()).toBe(TEST_ADDED_LINES.toString());
});
const findFileLine = name => wrapper.find(name);
it('shows the amount of lines removed', () => {
expect(findFileLine('.js-file-deletion-line').text()).toBe(TEST_REMOVED_LINES.toString());
});
});
describe('files changes', () => {
const findIcon = name =>
wrapper
.findAll(Icon)
.filter(c => c.attributes('name') === name)
.at(0).element.parentNode;
it('shows the amount of lines added', () => {
expect(findFileLine('.js-file-addition-line').text()).toBe(TEST_ADDED_LINES.toString());
it('shows amount of file changed with plural "files" when 0 files has changed', () => {
const oneFileChanged = '0';
createComponent({
diffFilesCountText: oneFileChanged,
});
expect(findIcon('doc-code').textContent.trim()).toBe(`${oneFileChanged} files`);
});
it('shows the amount of lines removed', () => {
expect(findFileLine('.js-file-deletion-line').text()).toBe(TEST_REMOVED_LINES.toString());
it('shows amount of file changed with singular "file" when 1 file is changed', () => {
const oneFileChanged = '1';
createComponent({
diffFilesCountText: oneFileChanged,
});
expect(findIcon('doc-code').textContent.trim()).toBe(`${oneFileChanged} file`);
});
it('shows the amount of files changed', () => {
expect(findIcon('doc-code').textContent).toContain(DIFF_FILES_LENGTH);
it('shows amount of files change with plural "files" when multiple files are changed', () => {
createComponent({
diffFilesCountText: DIFF_FILES_COUNT,
});
expect(findIcon('doc-code').textContent.trim()).toContain(`${DIFF_FILES_COUNT} files`);
});
it('shows amount of files change with plural "files" when files changed is truncated', () => {
createComponent({
diffFilesCountText: DIFF_FILES_COUNT_TRUNCATED,
});
expect(findIcon('doc-code').textContent.trim()).toContain(
`${DIFF_FILES_COUNT_TRUNCATED} files`,
);
});
});
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册