Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
c25c2a635b
commit
eace733dca
11 changed files with 233 additions and 111 deletions
49
.vale.ini
Normal file
49
.vale.ini
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
# Vale configuration file, taken from https://errata-ai.github.io/vale/config/
|
||||||
|
|
||||||
|
# The relative path to the folder containing linting rules (styles)
|
||||||
|
# -----------------------------------------------------------------
|
||||||
|
StylesPath = doc/.linting/vale/styles
|
||||||
|
|
||||||
|
# Minimum alert level
|
||||||
|
# -------------------
|
||||||
|
# The minimum alert level to display (suggestion, warning, or error).
|
||||||
|
# If integrated into CI, builds fail by default on error-level alerts,
|
||||||
|
# unless you execute Vale with the --no-exit flag
|
||||||
|
MinAlertLevel = suggestion
|
||||||
|
|
||||||
|
# Should Vale parse any file formats other than .md files as Markdown?
|
||||||
|
# --------------------------------------------------------------------
|
||||||
|
[formats]
|
||||||
|
mdx = md
|
||||||
|
|
||||||
|
# What file types should Vale test?
|
||||||
|
# ----------------------------------
|
||||||
|
[*.md]
|
||||||
|
|
||||||
|
# Styles to load
|
||||||
|
# --------------
|
||||||
|
# What styles, located in the StylesPath folder, should Vale load?
|
||||||
|
# Vale also currently includes write-good, proselint, joblint, and vale
|
||||||
|
BasedOnStyles = gitlab
|
||||||
|
|
||||||
|
# Enabling or disabling specific rules in a style
|
||||||
|
# -----------------------------------------------
|
||||||
|
# To disable a rule in an enabled style, use the following format:
|
||||||
|
# {style}.{filename} = NO
|
||||||
|
# To enable a single rule in a disabled style, use the following format:
|
||||||
|
# vale.Editorializing = YES
|
||||||
|
|
||||||
|
# Altering the severity of a rule in a style
|
||||||
|
# ------------------------------------------
|
||||||
|
# To change the reporting level (suggestion, warning, error) of a rule,
|
||||||
|
# use the following format: {style}.{filename} = {level}
|
||||||
|
# vale.Hedging = error
|
||||||
|
|
||||||
|
# Syntax-specific settings
|
||||||
|
# ------------------------
|
||||||
|
# You can configure specific tests to be enabled, disabled, or report at a
|
||||||
|
# different level for specific file types. File-type-specific settings added
|
||||||
|
# here will overwrite any conflicting global settings.
|
||||||
|
[*.{md,txt}]
|
||||||
|
# vale.Editorializing = NO
|
||||||
|
|
|
@ -29,6 +29,7 @@ const initManualOrdering = (draggableSelector = 'li.issue') => {
|
||||||
issueList,
|
issueList,
|
||||||
getBoardSortableDefaultOptions({
|
getBoardSortableDefaultOptions({
|
||||||
scroll: true,
|
scroll: true,
|
||||||
|
fallbackTolerance: 1,
|
||||||
dataIdAttr: 'data-id',
|
dataIdAttr: 'data-id',
|
||||||
fallbackOnBody: false,
|
fallbackOnBody: false,
|
||||||
group: {
|
group: {
|
||||||
|
|
|
@ -69,6 +69,11 @@ export default {
|
||||||
required: false,
|
required: false,
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
|
showHeader: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
showPanels: {
|
showPanels: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: false,
|
required: false,
|
||||||
|
@ -129,7 +134,8 @@ export default {
|
||||||
},
|
},
|
||||||
environmentsEndpoint: {
|
environmentsEndpoint: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: false,
|
||||||
|
default: '',
|
||||||
},
|
},
|
||||||
currentEnvironmentName: {
|
currentEnvironmentName: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -356,9 +362,12 @@ export default {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="prometheus-graphs">
|
<div class="prometheus-graphs">
|
||||||
<div class="prometheus-graphs-header gl-p-3 pb-0 border-bottom bg-gray-light">
|
<div
|
||||||
|
v-if="showHeader"
|
||||||
|
ref="prometheusGraphsHeader"
|
||||||
|
class="prometheus-graphs-header gl-p-3 pb-0 border-bottom bg-gray-light"
|
||||||
|
>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<template v-if="environmentsEndpoint">
|
|
||||||
<gl-form-group
|
<gl-form-group
|
||||||
:label="__('Dashboard')"
|
:label="__('Dashboard')"
|
||||||
label-size="sm"
|
label-size="sm"
|
||||||
|
@ -435,7 +444,6 @@ export default {
|
||||||
@invalid="onDateTimePickerInvalid"
|
@invalid="onDateTimePickerInvalid"
|
||||||
/>
|
/>
|
||||||
</gl-form-group>
|
</gl-form-group>
|
||||||
</template>
|
|
||||||
|
|
||||||
<gl-form-group
|
<gl-form-group
|
||||||
v-if="hasHeaderButtons"
|
v-if="hasHeaderButtons"
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
= build.name
|
|
@ -0,0 +1 @@
|
||||||
|
Job #<%= build.id %>
|
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
title: Fix Pipeline failed notification email not being delivered if the failed job
|
||||||
|
is a bridge job
|
||||||
|
merge_request: 23668
|
||||||
|
author:
|
||||||
|
type: fixed
|
6
doc/.linting/vale/styles/gitlab/OxfordComma.yml
Normal file
6
doc/.linting/vale/styles/gitlab/OxfordComma.yml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
extends: existence
|
||||||
|
message: Use a comma before the last "and" in a list of three or more items.
|
||||||
|
link: https://docs.gitlab.com/ee/development/documentation/styleguide.html#punctuation
|
||||||
|
level: warning
|
||||||
|
tokens:
|
||||||
|
- '(?:[^,]+,){1,}\s\w+\sand'
|
|
@ -420,6 +420,7 @@ The following are some suggested linters you can install locally and sample conf
|
||||||
|
|
||||||
- [`proselint`](#proselint)
|
- [`proselint`](#proselint)
|
||||||
- [markdownlint](#markdownlint), which is the same as the test run in [`docs-lint`](#testing)
|
- [markdownlint](#markdownlint), which is the same as the test run in [`docs-lint`](#testing)
|
||||||
|
- [Vale](#vale), for English language grammar and syntax suggestions
|
||||||
|
|
||||||
NOTE: **Note:**
|
NOTE: **Note:**
|
||||||
This list does not limit what other linters you can add to your local documentation writing toolchain.
|
This list does not limit what other linters you can add to your local documentation writing toolchain.
|
||||||
|
@ -519,6 +520,23 @@ also check [the issue](https://gitlab.com/gitlab-org/gitlab-foss/issues/64352) t
|
||||||
tracked the changes required to implement these rules, and details which rules were
|
tracked the changes required to implement these rules, and details which rules were
|
||||||
on or off when markdownlint was enabled on the docs.
|
on or off when markdownlint was enabled on the docs.
|
||||||
|
|
||||||
|
#### `Vale`
|
||||||
|
|
||||||
|
[Vale](https://errata-ai.github.io/vale/) is a grammar, style, and word usage linter
|
||||||
|
for the English language. Vale's configuration is stored in the
|
||||||
|
[`.vale.ini`](https://gitlab.com/gitlab-org/gitlab/blob/master/.vale.ini) file
|
||||||
|
located in the root directory of the [GitLab repository](https://gitlab.com/gitlab-org/gitlab).
|
||||||
|
|
||||||
|
Vale supports creating [custom tests](https://errata-ai.github.io/vale/styles/),
|
||||||
|
stored in the `doc/.linting/vale/styles/gitlab` directory, that extend any of
|
||||||
|
several types of checks.
|
||||||
|
|
||||||
|
To view linting suggestions locally, you must install Vale on your own machine, and
|
||||||
|
[configure the text editor of your choice](https://errata-ai.github.io/vale/#local-use-by-a-single-writer)
|
||||||
|
to display the results.
|
||||||
|
|
||||||
|
Vale's test results are not currently displayed in CI, but may be displayed in the future.
|
||||||
|
|
||||||
## Danger Bot
|
## Danger Bot
|
||||||
|
|
||||||
GitLab uses [Danger](https://github.com/danger/danger) for some elements in
|
GitLab uses [Danger](https://github.com/danger/danger) for some elements in
|
||||||
|
|
|
@ -412,13 +412,17 @@ describe('Dashboard', () => {
|
||||||
describe('cluster health', () => {
|
describe('cluster health', () => {
|
||||||
beforeEach(done => {
|
beforeEach(done => {
|
||||||
mock.onGet(propsData.metricsEndpoint).reply(statusCodes.OK, JSON.stringify({}));
|
mock.onGet(propsData.metricsEndpoint).reply(statusCodes.OK, JSON.stringify({}));
|
||||||
createShallowWrapper({ hasMetrics: true });
|
createShallowWrapper({ hasMetrics: true, showHeader: false });
|
||||||
|
|
||||||
// all_dashboards is not defined in health dashboards
|
// all_dashboards is not defined in health dashboards
|
||||||
wrapper.vm.$store.commit(`monitoringDashboard/${types.SET_ALL_DASHBOARDS}`, undefined);
|
wrapper.vm.$store.commit(`monitoringDashboard/${types.SET_ALL_DASHBOARDS}`, undefined);
|
||||||
wrapper.vm.$nextTick(done);
|
wrapper.vm.$nextTick(done);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('hides dashboard header by default', () => {
|
||||||
|
expect(wrapper.find({ ref: 'prometheusGraphsHeader' }).exists()).toEqual(false);
|
||||||
|
});
|
||||||
|
|
||||||
it('renders correctly', () => {
|
it('renders correctly', () => {
|
||||||
expect(wrapper.isVueInstance()).toBe(true);
|
expect(wrapper.isVueInstance()).toBe(true);
|
||||||
expect(wrapper.exists()).toBe(true);
|
expect(wrapper.exists()).toBe(true);
|
||||||
|
|
|
@ -15,7 +15,7 @@ describe 'notify/pipeline_failed_email.html.haml' do
|
||||||
user: user,
|
user: user,
|
||||||
ref: project.default_branch,
|
ref: project.default_branch,
|
||||||
sha: project.commit.sha,
|
sha: project.commit.sha,
|
||||||
status: :success)
|
status: :failed)
|
||||||
end
|
end
|
||||||
|
|
||||||
before do
|
before do
|
||||||
|
@ -24,6 +24,7 @@ describe 'notify/pipeline_failed_email.html.haml' do
|
||||||
assign(:merge_request, merge_request)
|
assign(:merge_request, merge_request)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
shared_examples_for 'renders the pipeline failed email correctly' do
|
||||||
context 'pipeline with user' do
|
context 'pipeline with user' do
|
||||||
it 'renders the email correctly' do
|
it 'renders the email correctly' do
|
||||||
render
|
render
|
||||||
|
@ -34,6 +35,7 @@ describe 'notify/pipeline_failed_email.html.haml' do
|
||||||
expect(rendered).to have_content pipeline.commit.author_name
|
expect(rendered).to have_content pipeline.commit.author_name
|
||||||
expect(rendered).to have_content "##{pipeline.id}"
|
expect(rendered).to have_content "##{pipeline.id}"
|
||||||
expect(rendered).to have_content pipeline.user.name
|
expect(rendered).to have_content pipeline.user.name
|
||||||
|
expect(rendered).to have_content build.name
|
||||||
end
|
end
|
||||||
|
|
||||||
it_behaves_like 'correct pipeline information for pipelines for merge requests'
|
it_behaves_like 'correct pipeline information for pipelines for merge requests'
|
||||||
|
@ -53,6 +55,20 @@ describe 'notify/pipeline_failed_email.html.haml' do
|
||||||
expect(rendered).to have_content pipeline.commit.author_name
|
expect(rendered).to have_content pipeline.commit.author_name
|
||||||
expect(rendered).to have_content "##{pipeline.id}"
|
expect(rendered).to have_content "##{pipeline.id}"
|
||||||
expect(rendered).to have_content "by API"
|
expect(rendered).to have_content "by API"
|
||||||
|
expect(rendered).to have_content build.name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when the pipeline contains a failed job' do
|
||||||
|
let!(:build) { create(:ci_build, :failed, pipeline: pipeline, project: pipeline.project) }
|
||||||
|
|
||||||
|
it_behaves_like 'renders the pipeline failed email correctly'
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when the latest failed job is a bridge job' do
|
||||||
|
let!(:build) { create(:ci_bridge, status: :failed, pipeline: pipeline, project: pipeline.project) }
|
||||||
|
|
||||||
|
it_behaves_like 'renders the pipeline failed email correctly'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -23,9 +23,8 @@ describe 'notify/pipeline_failed_email.text.erb' do
|
||||||
assign(:merge_request, merge_request)
|
assign(:merge_request, merge_request)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
shared_examples_for 'renders the pipeline failed email correctly' do
|
||||||
it 'renders the email correctly' do
|
it 'renders the email correctly' do
|
||||||
job = create(:ci_build, :failed, pipeline: pipeline, project: pipeline.project)
|
|
||||||
|
|
||||||
render
|
render
|
||||||
|
|
||||||
expect(rendered).to have_content('Your pipeline has failed')
|
expect(rendered).to have_content('Your pipeline has failed')
|
||||||
|
@ -34,8 +33,21 @@ describe 'notify/pipeline_failed_email.text.erb' do
|
||||||
expect(rendered).to have_content(pipeline.commit.author_name)
|
expect(rendered).to have_content(pipeline.commit.author_name)
|
||||||
expect(rendered).to have_content("##{pipeline.id}")
|
expect(rendered).to have_content("##{pipeline.id}")
|
||||||
expect(rendered).to have_content(pipeline.user.name)
|
expect(rendered).to have_content(pipeline.user.name)
|
||||||
expect(rendered).to have_content("/-/jobs/#{job.id}/raw")
|
expect(rendered).to have_content(build.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
it_behaves_like 'correct pipeline information for pipelines for merge requests'
|
it_behaves_like 'correct pipeline information for pipelines for merge requests'
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when the pipeline contains a failed job' do
|
||||||
|
let!(:build) { create(:ci_build, :failed, pipeline: pipeline, project: pipeline.project) }
|
||||||
|
|
||||||
|
it_behaves_like 'renders the pipeline failed email correctly'
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when the latest failed job is a bridge job' do
|
||||||
|
let!(:build) { create(:ci_bridge, status: :failed, pipeline: pipeline, project: pipeline.project) }
|
||||||
|
|
||||||
|
it_behaves_like 'renders the pipeline failed email correctly'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue