Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2020-08-04 06:10:16 +00:00
parent 5da8649911
commit 10fb317361
17 changed files with 146 additions and 98 deletions

View file

@ -1,7 +1,12 @@
<script>
import { GlTooltipDirective, GlResizeObserverDirective } from '@gitlab/ui';
import { mapActions } from 'vuex';
export default {
directives: {
GlTooltip: GlTooltipDirective,
GlResizeObserverDirective,
},
props: {
issue: {
type: Object,
@ -13,19 +18,32 @@ export default {
required: true,
},
},
data: () => ({
tooltipTitle: '',
}),
mounted() {
this.updateTooltipTitle();
},
methods: {
...mapActions(['openModal']),
handleIssueClick() {
const { issue, status, openModal } = this;
openModal({ issue, status });
},
updateTooltipTitle() {
// Only show the tooltip if the text is truncated with an ellipsis.
this.tooltipTitle = this.$el.offsetWidth < this.$el.scrollWidth ? this.issue.title : '';
},
},
};
</script>
<template>
<button
type="button"
class="btn-link btn-blank text-left break-link vulnerability-name-button"
v-gl-tooltip="{ boundary: 'viewport' }"
v-gl-resize-observer-directive="updateTooltipTitle"
class="btn-link gl-text-truncate"
:aria-label="s__('Reports|Vulnerability Name')"
:title="tooltipTitle"
@click="handleIssueClick()"
>
{{ issue.title }}

View file

@ -338,10 +338,10 @@ In the example below, we list 50 [namespaces](namespaces.md) per page.
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/namespaces?per_page=50"
```
#### Pagination Link header
#### Pagination `Link` header
[Link headers](https://www.w3.org/wiki/LinkHeader) are sent back with each
response. They have `rel` set to prev/next/first/last and contain the relevant
[`Link` headers](https://www.w3.org/wiki/LinkHeader) are sent back with each
response. They have `rel` set to `prev`/`next`/`first`/`last` and contain the relevant
URL. Please use these links instead of generating your own URLs.
In the cURL example below, we limit the output to 3 items per page (`per_page=3`)
@ -424,12 +424,14 @@ Status: 200 OK
```
CAUTION: **Deprecation:**
The `Links` Header will be removed in GitLab 14.0 to be aligned with the [W3C `Link` specification](https://www.w3.org/wiki/LinkHeader)
The `Links` header will be removed in GitLab 14.0 to be aligned with the [W3C `Link` specification](https://www.w3.org/wiki/LinkHeader).
The `Link` header was [added in GitLab 13.1](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/33714)
and should be used instead.
The link to the next page contains an additional filter `id_after=42` which excludes records we have retrieved already.
Note the type of filter depends on the `order_by` option used and we may have more than one additional filter.
When the end of the collection has been reached and there are no additional records to retrieve, the `Links` header is absent and the resulting array is empty.
When the end of the collection has been reached and there are no additional records to retrieve, the `Link` header is absent and the resulting array is empty.
We recommend using only the given link to retrieve the next page instead of building your own URL. Apart from the headers shown,
we don't expose additional pagination headers.

View file

@ -1,3 +1,9 @@
---
stage: Verify
group: Continuous Integration
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
---
# Instance-level CI/CD variables API
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/14108) in GitLab 13.0

View file

@ -1,3 +1,9 @@
---
stage: Verify
group: Continuous Integration
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
---
# Jobs API
## List project jobs

View file

@ -1,3 +1,9 @@
---
stage: Verify
group: Continuous Integration
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
---
# Validate the `.gitlab-ci.yml` (API)
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/5953) in GitLab 8.12.

View file

@ -1,3 +1,9 @@
---
stage: Verify
group: Continuous Integration
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
---
# Pipeline schedules API
You can read more about [pipeline schedules](../ci/pipelines/schedules.md).

View file

@ -1,3 +1,9 @@
---
stage: Verify
group: Continuous Integration
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
---
# Pipeline triggers API
You can read more about [triggering pipelines through the API](../ci/triggers/README.md).

View file

@ -1,3 +1,9 @@
---
stage: Verify
group: Continuous Integration
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
---
# Pipelines API
## Single Pipeline Requests

View file

@ -1,7 +1,7 @@
---
stage: Create
group: Source Code
info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers"
stage: Verify
group: Continuous Integration
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
type: reference, api
---

View file

@ -1,4 +1,7 @@
---
stage: Verify
group: Continuous Integration
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
type: reference
---
@ -8,9 +11,9 @@ In GitLab, there is an API endpoint available to work with GitLab CI/CD YMLs. Fo
information on CI/CD pipeline configuration in GitLab, see the
[configuration reference documentation](../../ci/yaml/README.md).
## List GitLab CI YML templates
## List GitLab CI YAML templates
Get all GitLab CI/CD YML templates.
Get all GitLab CI/CD YAML templates.
```plaintext
GET /templates/gitlab_ci_ymls
@ -19,7 +22,7 @@ GET /templates/gitlab_ci_ymls
Example request:
```shell
curl https://gitlab.example.com/api/v4/templates/gitlab_ci_ymls
curl "https://gitlab.example.com/api/v4/templates/gitlab_ci_ymls"
```
Example response:
@ -109,9 +112,9 @@ Example response:
]
```
## Single GitLab CI YML template
## Single GitLab CI YAML template
Get a single GitLab CI/CD YML template.
Get a single GitLab CI/CD YAML template.
```plaintext
GET /templates/gitlab_ci_ymls/:key
@ -119,12 +122,12 @@ GET /templates/gitlab_ci_ymls/:key
| Attribute | Type | Required | Description |
| ---------- | ------ | -------- | ------------------------------------- |
| `key` | string | yes | The key of the GitLab CI/CD YML template |
| `key` | string | yes | The key of the GitLab CI/CD YAML template |
Example request:
```shell
curl https://gitlab.example.com/api/v4/templates/gitlab_ci_ymls/Ruby
curl "https://gitlab.example.com/api/v4/templates/gitlab_ci_ymls/Ruby"
```
Example response:

View file

@ -1,7 +1,7 @@
---
stage: Create
group: Source Code
info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers"
stage: Verify
group: Testing
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
type: reference, api
---

View file

@ -252,6 +252,7 @@ on that specific branch:
- Run manual pipelines (using the [Web UI](#run-a-pipeline-manually) or [pipelines API](#pipelines-api)).
- Run scheduled pipelines.
- Run pipelines using triggers.
- Run on-demand DAST scan.
- Trigger manual actions on existing pipelines.
- Retry or cancel existing jobs (using the Web UI or pipelines API).

View file

@ -693,11 +693,13 @@ To configure markdownlint within your editor, install one of the following as ap
- [Sublime Text](https://packagecontrol.io/packages/SublimeLinter-contrib-markdownlint)
- [Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint)
- [Atom](https://atom.io/packages/linter-node-markdownlint)
- [Vim](https://github.com/dense-analysis/ale)
To configure Vale within your editor, install one of the following as appropriate:
- The Sublime Text [`SublimeLinter-contrib-vale` plugin](https://packagecontrol.io/packages/SublimeLinter-contrib-vale)
- The Visual Studio Code [`testthedocs.vale` extension](https://marketplace.visualstudio.com/items?itemName=testthedocs.vale)
- [Vim](https://github.com/dense-analysis/ale)
We don't use [Vale Server](https://errata-ai.github.io/vale/#using-vale-with-a-text-editor-or-another-third-party-application).

View file

@ -20245,6 +20245,9 @@ msgstr ""
msgid "Reports|Vulnerability"
msgstr ""
msgid "Reports|Vulnerability Name"
msgstr ""
msgid "Reports|no changed test results"
msgstr ""

View file

@ -55,7 +55,7 @@ describe('Error message', () => {
'Upload skipped. Some of the designs you tried uploading did not change: 1.jpg, 2.jpg, 3.jpg, 4.jpg, 5.jpg, and 2 more.',
],
])('designUploadSkippedWarning', (uploadedFiles, skippedFiles, expected) => {
test('returns expected warning message', () => {
it('returns expected warning message', () => {
expect(designUploadSkippedWarning(uploadedFiles, skippedFiles)).toBe(expected);
});
});

View file

@ -2,6 +2,8 @@ import { shallowMount } from '@vue/test-utils';
import { createStore } from '~/monitoring/stores';
import * as types from '~/monitoring/stores/mutation_types';
import { GlDeprecatedDropdownItem, GlSearchBoxByType, GlLoadingIcon } from '@gitlab/ui';
import DateTimePicker from '~/vue_shared/components/date_time_picker/date_time_picker.vue';
import RefreshButton from '~/monitoring/components/refresh_button.vue';
import DashboardHeader from '~/monitoring/components/dashboard_header.vue';
import DashboardsDropdown from '~/monitoring/components/dashboards_dropdown.vue';
import DuplicateDashboardModal from '~/monitoring/components/duplicate_dashboard_modal.vue';
@ -35,6 +37,9 @@ describe('Dashboard header', () => {
const findEnvsDropdownSearchMsg = () => wrapper.find({ ref: 'monitorEnvironmentsDropdownMsg' });
const findEnvsDropdownLoadingIcon = () => findEnvsDropdown().find(GlLoadingIcon);
const findDateTimePicker = () => wrapper.find(DateTimePicker);
const findRefreshButton = () => wrapper.find(RefreshButton);
const findActionsMenu = () => wrapper.find('[data-testid="actions-menu"]');
const findCreateDashboardMenuItem = () =>
findActionsMenu().find('[data-testid="action-create-dashboard"]');
@ -205,6 +210,59 @@ describe('Dashboard header', () => {
});
});
describe('date time picker', () => {
beforeEach(() => {
createShallowWrapper();
});
it('is rendered', () => {
expect(findDateTimePicker().exists()).toBe(true);
});
describe('timezone setting', () => {
const setupWithTimezone = value => {
store = createStore({ dashboardTimezone: value });
createShallowWrapper();
};
describe('local timezone is enabled by default', () => {
it('shows the data time picker in local timezone', () => {
expect(findDateTimePicker().props('utc')).toBe(false);
});
});
describe('when LOCAL timezone is enabled', () => {
beforeEach(() => {
setupWithTimezone('LOCAL');
});
it('shows the data time picker in local timezone', () => {
expect(findDateTimePicker().props('utc')).toBe(false);
});
});
describe('when UTC timezone is enabled', () => {
beforeEach(() => {
setupWithTimezone('UTC');
});
it('shows the data time picker in UTC format', () => {
expect(findDateTimePicker().props('utc')).toBe(true);
});
});
});
});
describe('refresh button', () => {
beforeEach(() => {
createShallowWrapper();
});
it('is rendered', () => {
expect(findRefreshButton().exists()).toBe(true);
});
});
describe('when a dashboard has been duplicated in the duplicate dashboard modal', () => {
beforeEach(() => {
store.state.monitoringDashboard.projectPath = 'root/sandbox';

View file

@ -10,8 +10,6 @@ import { dashboardEmptyStates, metricStates } from '~/monitoring/constants';
import Dashboard from '~/monitoring/components/dashboard.vue';
import DashboardHeader from '~/monitoring/components/dashboard_header.vue';
import RefreshButton from '~/monitoring/components/refresh_button.vue';
import DateTimePicker from '~/vue_shared/components/date_time_picker/date_time_picker.vue';
import CustomMetricsFormFields from '~/custom_metrics/components/custom_metrics_form_fields.vue';
import EmptyState from '~/monitoring/components/empty_state.vue';
import GroupEmptyState from '~/monitoring/components/group_empty_state.vue';
@ -449,7 +447,7 @@ describe('Dashboard', () => {
});
describe('star dashboards', () => {
const findToggleStar = () => wrapper.find(DashboardHeader).find({ ref: 'toggleStarBtn' });
const findToggleStar = () => findDashboardHeader().find({ ref: 'toggleStarBtn' });
const findToggleStarIcon = () => findToggleStar().find(GlIcon);
beforeEach(() => {
@ -527,28 +525,6 @@ describe('Dashboard', () => {
});
});
it('renders the datetimepicker dropdown', () => {
createMountedWrapper({ hasMetrics: true });
setupStoreWithData(store);
return wrapper.vm.$nextTick().then(() => {
expect(wrapper.find(DateTimePicker).exists()).toBe(true);
});
});
it('renders the refresh dashboard button', () => {
createMountedWrapper({ hasMetrics: true });
setupStoreWithData(store);
return wrapper.vm.$nextTick().then(() => {
const refreshBtn = wrapper.find(DashboardHeader).find(RefreshButton);
expect(refreshBtn.exists()).toBe(true);
});
});
describe('variables section', () => {
beforeEach(() => {
createShallowWrapper({ hasMetrics: true });
@ -806,57 +782,6 @@ describe('Dashboard', () => {
});
});
describe('dashboard timezone', () => {
const setupWithTimezone = value => {
store = createStore({ dashboardTimezone: value });
setupStoreWithData(store);
createShallowWrapper({ hasMetrics: true });
return wrapper.vm.$nextTick;
};
describe('local timezone is enabled by default', () => {
beforeEach(() => {
return setupWithTimezone();
});
it('shows the data time picker in local timezone', () => {
expect(
findDashboardHeader()
.find(DateTimePicker)
.props('utc'),
).toBe(false);
});
});
describe('when LOCAL timezone is enabled', () => {
beforeEach(() => {
return setupWithTimezone('LOCAL');
});
it('shows the data time picker in local timezone', () => {
expect(
findDashboardHeader()
.find(DateTimePicker)
.props('utc'),
).toBe(false);
});
});
describe('when UTC timezone is enabled', () => {
beforeEach(() => {
return setupWithTimezone('UTC');
});
it('shows the data time picker in UTC format', () => {
expect(
findDashboardHeader()
.find(DateTimePicker)
.props('utc'),
).toBe(true);
});
});
});
describe('cluster health', () => {
beforeEach(() => {
createShallowWrapper({ hasMetrics: true, showHeader: false });
@ -1039,7 +964,7 @@ describe('Dashboard', () => {
});
describe('add custom metrics', () => {
const findAddMetricButton = () => wrapper.find(DashboardHeader).find({ ref: 'addMetricBtn' });
const findAddMetricButton = () => findDashboardHeader().find({ ref: 'addMetricBtn' });
describe('when not available', () => {
beforeEach(() => {