Commit eace733d authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent c25c2a63
# 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') => { ...@@ -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 { ...@@ -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 { ...@@ -129,7 +134,8 @@ export default {
}, },
environmentsEndpoint: { environmentsEndpoint: {
type: String, type: String,
required: true, required: false,
default: '',
}, },
currentEnvironmentName: { currentEnvironmentName: {
type: String, type: String,
...@@ -356,86 +362,88 @@ export default { ...@@ -356,86 +362,88 @@ 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" label-for="monitor-dashboards-dropdown"
label-for="monitor-dashboards-dropdown" class="col-sm-12 col-md-6 col-lg-2"
class="col-sm-12 col-md-6 col-lg-2" >
> <dashboards-dropdown
<dashboards-dropdown id="monitor-dashboards-dropdown"
id="monitor-dashboards-dropdown" class="mb-0 d-flex"
class="mb-0 d-flex" toggle-class="dropdown-menu-toggle"
toggle-class="dropdown-menu-toggle" :default-branch="defaultBranch"
:default-branch="defaultBranch" :selected-dashboard="selectedDashboard"
:selected-dashboard="selectedDashboard" @selectDashboard="selectDashboard($event)"
@selectDashboard="selectDashboard($event)" />
/> </gl-form-group>
</gl-form-group>
<gl-form-group <gl-form-group
:label="s__('Metrics|Environment')" :label="s__('Metrics|Environment')"
label-size="sm" label-size="sm"
label-for="monitor-environments-dropdown" label-for="monitor-environments-dropdown"
class="col-sm-6 col-md-6 col-lg-2" class="col-sm-6 col-md-6 col-lg-2"
>
<gl-dropdown
id="monitor-environments-dropdown"
ref="monitorEnvironmentsDropdown"
data-qa-selector="environments_dropdown"
class="mb-0 d-flex"
toggle-class="dropdown-menu-toggle"
menu-class="monitor-environment-dropdown-menu"
:text="currentEnvironmentName"
:disabled="filteredEnvironments.length === 0"
> >
<gl-dropdown <div class="d-flex flex-column overflow-hidden">
id="monitor-environments-dropdown" <gl-search-box-by-type
ref="monitorEnvironmentsDropdown" v-if="shouldRenderSearchableEnvironmentsDropdown"
data-qa-selector="environments_dropdown" ref="monitorEnvironmentsDropdownSearch"
class="mb-0 d-flex" class="m-2"
toggle-class="dropdown-menu-toggle" @input="debouncedEnvironmentsSearch"
menu-class="monitor-environment-dropdown-menu" />
:text="currentEnvironmentName" <div class="flex-fill overflow-auto">
:disabled="filteredEnvironments.length === 0" <gl-dropdown-item
> v-for="environment in filteredEnvironments"
<div class="d-flex flex-column overflow-hidden"> :key="environment.id"
<gl-search-box-by-type :active="environment.name === currentEnvironmentName"
v-if="shouldRenderSearchableEnvironmentsDropdown" active-class="is-active"
ref="monitorEnvironmentsDropdownSearch" :href="environment.metrics_path"
class="m-2" >{{ environment.name }}</gl-dropdown-item
@input="debouncedEnvironmentsSearch"
/>
<div class="flex-fill overflow-auto">
<gl-dropdown-item
v-for="environment in filteredEnvironments"
:key="environment.id"
:active="environment.name === currentEnvironmentName"
active-class="is-active"
:href="environment.metrics_path"
>{{ environment.name }}</gl-dropdown-item
>
</div>
<div
v-if="shouldRenderSearchableEnvironmentsDropdown"
v-show="filteredEnvironments.length === 0"
ref="monitorEnvironmentsDropdownMsg"
class="text-secondary no-matches-message"
> >
{{ s__('No matching results') }}
</div>
</div> </div>
</gl-dropdown> <div
</gl-form-group> v-if="shouldRenderSearchableEnvironmentsDropdown"
v-show="filteredEnvironments.length === 0"
ref="monitorEnvironmentsDropdownMsg"
class="text-secondary no-matches-message"
>
{{ s__('No matching results') }}
</div>
</div>
</gl-dropdown>
</gl-form-group>
<gl-form-group <gl-form-group
:label="s__('Metrics|Show last')" :label="s__('Metrics|Show last')"
label-size="sm" label-size="sm"
label-for="monitor-time-window-dropdown" label-for="monitor-time-window-dropdown"
class="col-sm-6 col-md-6 col-lg-4" class="col-sm-6 col-md-6 col-lg-4"
> >
<date-time-picker <date-time-picker
ref="dateTimePicker" ref="dateTimePicker"
:start="startDate" :start="startDate"
:end="endDate" :end="endDate"
:time-windows="datePickerTimeWindows" :time-windows="datePickerTimeWindows"
@apply="onDateTimePickerApply" @apply="onDateTimePickerApply"
@invalid="onDateTimePickerInvalid" @invalid="onDateTimePickerInvalid"
/> />
</gl-form-group> </gl-form-group>
</template>
<gl-form-group <gl-form-group
v-if="hasHeaderButtons" v-if="hasHeaderButtons"
......
---
title: Fix Pipeline failed notification email not being delivered if the failed job
is a bridge job
merge_request: 23668
author:
type: fixed
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 ...@@ -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 ...@@ -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', () => { ...@@ -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 ...@@ -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,35 +24,51 @@ describe 'notify/pipeline_failed_email.html.haml' do ...@@ -24,35 +24,51 @@ describe 'notify/pipeline_failed_email.html.haml' do
assign(:merge_request, merge_request) assign(:merge_request, merge_request)
end end
context 'pipeline with user' do shared_examples_for 'renders the pipeline failed email correctly' do
it 'renders the email correctly' do context 'pipeline with user' do
render it 'renders the email correctly' do
render
expect(rendered).to have_content "Your pipeline has failed" expect(rendered).to have_content "Your pipeline has failed"
expect(rendered).to have_content pipeline.project.name expect(rendered).to have_content pipeline.project.name
expect(rendered).to have_content pipeline.git_commit_message.truncate(50).gsub(/\s+/, ' ') expect(rendered).to have_content pipeline.git_commit_message.truncate(50).gsub(/\s+/, ' ')
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
it_behaves_like 'correct pipeline information for pipelines for merge requests'
end end
it_behaves_like 'correct pipeline information for pipelines for merge requests' context 'pipeline without user' do
end before do
pipeline.update_attribute(:user, nil)
end
context 'pipeline without user' do it 'renders the email correctly' do
before do render
pipeline.update_attribute(:user, nil)
expect(rendered).to have_content "Your pipeline has failed"
expect(rendered).to have_content pipeline.project.name
expect(rendered).to have_content pipeline.git_commit_message.truncate(50).gsub(/\s+/, ' ')
expect(rendered).to have_content pipeline.commit.author_name
expect(rendered).to have_content "##{pipeline.id}"
expect(rendered).to have_content "by API"
expect(rendered).to have_content build.name
end
end end
end
it 'renders the email correctly' do context 'when the pipeline contains a failed job' do
render let!(:build) { create(:ci_build, :failed, pipeline: pipeline, project: pipeline.project) }
expect(rendered).to have_content "Your pipeline has failed" it_behaves_like 'renders the pipeline failed email correctly'
expect(rendered).to have_content pipeline.project.name end
expect(rendered).to have_content pipeline.git_commit_message.truncate(50).gsub(/\s+/, ' ')
expect(rendered).to have_content pipeline.commit.author_name context 'when the latest failed job is a bridge job' do
expect(rendered).to have_content "##{pipeline.id}" let!(:build) { create(:ci_bridge, status: :failed, pipeline: pipeline, project: pipeline.project) }
expect(rendered).to have_content "by API"
end it_behaves_like 'renders the pipeline failed email correctly'
end end
end end
...@@ -23,19 +23,31 @@ describe 'notify/pipeline_failed_email.text.erb' do ...@@ -23,19 +23,31 @@ describe 'notify/pipeline_failed_email.text.erb' do
assign(:merge_request, merge_request) assign(:merge_request, merge_request)
end end
it 'renders the email correctly' do shared_examples_for 'renders the pipeline failed email correctly' do
job = create(:ci_build, :failed, pipeline: pipeline, project: pipeline.project) it 'renders the email correctly' do
render
render
expect(rendered).to have_content('Your pipeline has failed')
expect(rendered).to have_content('Your pipeline has failed') expect(rendered).to have_content(pipeline.project.name)
expect(rendered).to have_content(pipeline.project.name) expect(rendered).to have_content(pipeline.git_commit_message.truncate(50).gsub(/\s+/, ' '))
expect(rendered).to have_content(pipeline.git_commit_message.truncate(50).gsub(/\s+/, ' ')) 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.id)
expect(rendered).to have_content("/-/jobs/#{job.id}/raw") end
it_behaves_like 'correct pipeline information for pipelines for merge requests'
end end
it_behaves_like 'correct pipeline information for pipelines for merge requests' 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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment