summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-13 09:09:51 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-13 09:09:51 +0000
commite79918ce90dc31527be1ef0140a99cfe450d931e (patch)
treeea700e26de7809e58b7cff6bc58d8b8d89f29201
parent01ff651394ec2df7df5ed0282c96fb8133980cb9 (diff)
downloadgitlab-ce-e79918ce90dc31527be1ef0140a99cfe450d931e.tar.gz
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--app/assets/javascripts/pages/projects/services/edit/index.js6
-rw-r--r--doc/api/pipelines.md2
-rw-r--r--doc/api/vulnerability_issue_links.md217
-rw-r--r--locale/gitlab.pot3
-rw-r--r--spec/frontend/prometheus_metrics/custom_metrics_spec.js96
5 files changed, 55 insertions, 269 deletions
diff --git a/app/assets/javascripts/pages/projects/services/edit/index.js b/app/assets/javascripts/pages/projects/services/edit/index.js
index 5249709a2a3..04f3877ab48 100644
--- a/app/assets/javascripts/pages/projects/services/edit/index.js
+++ b/app/assets/javascripts/pages/projects/services/edit/index.js
@@ -1,5 +1,5 @@
import IntegrationSettingsForm from '~/integrations/integration_settings_form';
-import PrometheusMetrics from '~/prometheus_metrics/custom_metrics';
+import CustomMetrics from '~/prometheus_metrics/custom_metrics';
import PrometheusAlerts from '~/prometheus_alerts';
import initAlertsSettings from '~/alerts_service_settings';
@@ -10,8 +10,8 @@ document.addEventListener('DOMContentLoaded', () => {
const prometheusSettingsSelector = '.js-prometheus-metrics-monitoring';
const prometheusSettingsWrapper = document.querySelector(prometheusSettingsSelector);
if (prometheusSettingsWrapper) {
- const prometheusMetrics = new PrometheusMetrics(prometheusSettingsSelector);
- prometheusMetrics.init();
+ const customMetrics = new CustomMetrics(prometheusSettingsSelector);
+ customMetrics.init();
}
PrometheusAlerts();
diff --git a/doc/api/pipelines.md b/doc/api/pipelines.md
index 490f1304130..5b67df14ace 100644
--- a/doc/api/pipelines.md
+++ b/doc/api/pipelines.md
@@ -12,7 +12,7 @@ GET /projects/:id/pipelines
|-----------|---------|----------|---------------------|
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
| `scope` | string | no | The scope of pipelines, one of: `running`, `pending`, `finished`, `branches`, `tags` |
-| `status` | string | no | The status of pipelines, one of: `running`, `pending`, `success`, `failed`, `canceled`, `skipped`, `created` |
+| `status` | string | no | The status of pipelines, one of: `running`, `pending`, `success`, `failed`, `canceled`, `skipped`, `created`, `manual` |
| `ref` | string | no | The ref of pipelines |
| `sha` | string | no | The SHA of pipelines |
| `yaml_errors`| boolean | no | Returns pipelines with invalid configurations |
diff --git a/doc/api/vulnerability_issue_links.md b/doc/api/vulnerability_issue_links.md
deleted file mode 100644
index 05213e788c4..00000000000
--- a/doc/api/vulnerability_issue_links.md
+++ /dev/null
@@ -1,217 +0,0 @@
-# Vulnerability Issue links API **(ULTIMATE)**
-
-CAUTION: **Caution:**
-This API is in an alpha stage and considered unstable.
-The response payload may be subject to change or breakage
-across GitLab releases.
-
-## List related issues
-
-Get a list of related issues of a given issue, sorted by the relationship creation datetime (ascending).
-Issues will be filtered according to the user authorizations.
-
-```plaintext
-GET /projects/:id/issues/:issue_iid/links
-```
-
-Parameters:
-
-| Attribute | Type | Required | Description |
-|-------------|---------|----------|--------------------------------------|
-| `id` | integer or string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
-| `issue_iid` | integer | yes | The internal ID of a project's issue |
-
-```json
-[
- {
- "id" : 84,
- "iid" : 14,
- "issue_link_id": 1
- "project_id" : 4,
- "created_at" : "2016-01-07T12:44:33.959Z",
- "title" : "Issues with auth",
- "state" : "opened",
- "assignees" : [],
- "assignee" : null,
- "labels" : [
- "bug"
- ],
- "author" : {
- "name" : "Alexandra Bashirian",
- "avatar_url" : null,
- "state" : "active",
- "web_url" : "https://gitlab.example.com/eileen.lowe",
- "id" : 18,
- "username" : "eileen.lowe"
- },
- "description" : null,
- "updated_at" : "2016-01-07T12:44:33.959Z",
- "milestone" : null,
- "subscribed" : true,
- "user_notes_count": 0,
- "due_date": null,
- "web_url": "http://example.com/example/example/issues/14",
- "confidential": false,
- "weight": null,
- }
-]
-```
-
-## Create an issue link
-
-Creates a two-way relation between two issues. User must be allowed to update both issues in order to succeed.
-
-```plaintext
-POST /projects/:id/issues/:issue_iid/links
-```
-
-| Attribute | Type | Required | Description |
-|-------------|---------|----------|--------------------------------------|
-| `id` | integer or string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
-| `issue_iid` | integer | yes | The internal ID of a project's issue |
-| `target_project_id` | integer or string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) of a target project |
-| `target_issue_iid` | integer or string | yes | The internal ID of a target project's issue |
-
-```json
-{
- "source_issue" : {
- "id" : 83,
- "iid" : 11,
- "project_id" : 4,
- "created_at" : "2016-01-07T12:44:33.959Z",
- "title" : "Issues with auth",
- "state" : "opened",
- "assignees" : [],
- "assignee" : null,
- "labels" : [
- "bug"
- ],
- "author" : {
- "name" : "Alexandra Bashirian",
- "avatar_url" : null,
- "state" : "active",
- "web_url" : "https://gitlab.example.com/eileen.lowe",
- "id" : 18,
- "username" : "eileen.lowe"
- },
- "description" : null,
- "updated_at" : "2016-01-07T12:44:33.959Z",
- "milestone" : null,
- "subscribed" : true,
- "user_notes_count": 0,
- "due_date": null,
- "web_url": "http://example.com/example/example/issues/11",
- "confidential": false,
- "weight": null,
- },
- "target_issue" : {
- "id" : 84,
- "iid" : 14,
- "project_id" : 4,
- "created_at" : "2016-01-07T12:44:33.959Z",
- "title" : "Issues with auth",
- "state" : "opened",
- "assignees" : [],
- "assignee" : null,
- "labels" : [
- "bug"
- ],
- "author" : {
- "name" : "Alexandra Bashirian",
- "avatar_url" : null,
- "state" : "active",
- "web_url" : "https://gitlab.example.com/eileen.lowe",
- "id" : 18,
- "username" : "eileen.lowe"
- },
- "description" : null,
- "updated_at" : "2016-01-07T12:44:33.959Z",
- "milestone" : null,
- "subscribed" : true,
- "user_notes_count": 0,
- "due_date": null,
- "web_url": "http://example.com/example/example/issues/14",
- "confidential": false,
- "weight": null,
- }
-}
-```
-
-## Delete an issue link
-
-Deletes an issue link, removing the two-way relationship.
-
-```plaintext
-DELETE /projects/:id/issues/:issue_iid/links/:issue_link_id
-```
-
-| Attribute | Type | Required | Description |
-|-------------|---------|----------|--------------------------------------|
-| `id` | integer or string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
-| `issue_iid` | integer | yes | The internal ID of a project's issue |
-| `issue_link_id` | integer or string | yes | The ID of an issue relationship |
-
-```json
-{
- "source_issue" : {
- "id" : 83,
- "iid" : 11,
- "project_id" : 4,
- "created_at" : "2016-01-07T12:44:33.959Z",
- "title" : "Issues with auth",
- "state" : "opened",
- "assignees" : [],
- "assignee" : null,
- "labels" : [
- "bug"
- ],
- "author" : {
- "name" : "Alexandra Bashirian",
- "avatar_url" : null,
- "state" : "active",
- "web_url" : "https://gitlab.example.com/eileen.lowe",
- "id" : 18,
- "username" : "eileen.lowe"
- },
- "description" : null,
- "updated_at" : "2016-01-07T12:44:33.959Z",
- "milestone" : null,
- "subscribed" : true,
- "user_notes_count": 0,
- "due_date": null,
- "web_url": "http://example.com/example/example/issues/11",
- "confidential": false,
- "weight": null,
- },
- "target_issue" : {
- "id" : 84,
- "iid" : 14,
- "project_id" : 4,
- "created_at" : "2016-01-07T12:44:33.959Z",
- "title" : "Issues with auth",
- "state" : "opened",
- "assignees" : [],
- "assignee" : null,
- "labels" : [
- "bug"
- ],
- "author" : {
- "name" : "Alexandra Bashirian",
- "avatar_url" : null,
- "state" : "active",
- "web_url" : "https://gitlab.example.com/eileen.lowe",
- "id" : 18,
- "username" : "eileen.lowe"
- },
- "description" : null,
- "updated_at" : "2016-01-07T12:44:33.959Z",
- "milestone" : null,
- "subscribed" : true,
- "user_notes_count": 0,
- "due_date": null,
- "web_url": "http://example.com/example/example/issues/14",
- "confidential": false,
- "weight": null,
- }
-}
-```
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 52446d172f5..0c35c77f8cf 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -17941,6 +17941,9 @@ msgstr ""
msgid "SecurityDashboard|More information"
msgstr ""
+msgid "SecurityDashboard|No vulnerabilities found for dashboard"
+msgstr ""
+
msgid "SecurityDashboard|Pipeline %{pipelineLink} triggered %{timeago} by %{user}"
msgstr ""
diff --git a/spec/frontend/prometheus_metrics/custom_metrics_spec.js b/spec/frontend/prometheus_metrics/custom_metrics_spec.js
index 3396b3694c0..97b8f7bd913 100644
--- a/spec/frontend/prometheus_metrics/custom_metrics_spec.js
+++ b/spec/frontend/prometheus_metrics/custom_metrics_spec.js
@@ -1,5 +1,5 @@
import MockAdapter from 'axios-mock-adapter';
-import PrometheusMetrics from '~/prometheus_metrics/custom_metrics';
+import CustomMetrics from '~/prometheus_metrics/custom_metrics';
import axios from '~/lib/utils/axios_utils';
import PANEL_STATE from '~/prometheus_metrics/constants';
import metrics from './mock_data';
@@ -24,99 +24,99 @@ describe('PrometheusMetrics', () => {
});
describe('Custom Metrics', () => {
- let prometheusMetrics;
+ let customMetrics;
beforeEach(() => {
- prometheusMetrics = new PrometheusMetrics('.js-prometheus-metrics-monitoring');
+ customMetrics = new CustomMetrics('.js-prometheus-metrics-monitoring');
});
it('should initialize wrapper element refs on the class object', () => {
- expect(prometheusMetrics.$wrapperCustomMetrics).not.toBeNull();
- expect(prometheusMetrics.$monitoredCustomMetricsPanel).not.toBeNull();
- expect(prometheusMetrics.$monitoredCustomMetricsCount).not.toBeNull();
- expect(prometheusMetrics.$monitoredCustomMetricsLoading).not.toBeNull();
- expect(prometheusMetrics.$monitoredCustomMetricsEmpty).not.toBeNull();
- expect(prometheusMetrics.$monitoredCustomMetricsList).not.toBeNull();
- expect(prometheusMetrics.$newCustomMetricButton).not.toBeNull();
- expect(prometheusMetrics.$flashCustomMetricsContainer).not.toBeNull();
+ expect(customMetrics.$wrapperCustomMetrics).not.toBeNull();
+ expect(customMetrics.$monitoredCustomMetricsPanel).not.toBeNull();
+ expect(customMetrics.$monitoredCustomMetricsCount).not.toBeNull();
+ expect(customMetrics.$monitoredCustomMetricsLoading).not.toBeNull();
+ expect(customMetrics.$monitoredCustomMetricsEmpty).not.toBeNull();
+ expect(customMetrics.$monitoredCustomMetricsList).not.toBeNull();
+ expect(customMetrics.$newCustomMetricButton).not.toBeNull();
+ expect(customMetrics.$flashCustomMetricsContainer).not.toBeNull();
});
it('should contain api endpoints', () => {
- expect(prometheusMetrics.activeCustomMetricsEndpoint).toEqual(customMetricsEndpoint);
+ expect(customMetrics.activeCustomMetricsEndpoint).toEqual(customMetricsEndpoint);
});
it('should show loading state when called with `loading`', () => {
- prometheusMetrics.showMonitoringCustomMetricsPanelState(PANEL_STATE.LOADING);
+ customMetrics.showMonitoringCustomMetricsPanelState(PANEL_STATE.LOADING);
- expect(prometheusMetrics.$monitoredCustomMetricsLoading.hasClass('hidden')).toEqual(false);
- expect(prometheusMetrics.$monitoredCustomMetricsEmpty.hasClass('hidden')).toBeTruthy();
- expect(prometheusMetrics.$monitoredCustomMetricsList.hasClass('hidden')).toBeTruthy();
+ expect(customMetrics.$monitoredCustomMetricsLoading.hasClass('hidden')).toEqual(false);
+ expect(customMetrics.$monitoredCustomMetricsEmpty.hasClass('hidden')).toBeTruthy();
+ expect(customMetrics.$monitoredCustomMetricsList.hasClass('hidden')).toBeTruthy();
expect(
- prometheusMetrics.$monitoredCustomMetricsNoIntegrationText.hasClass('hidden'),
+ customMetrics.$monitoredCustomMetricsNoIntegrationText.hasClass('hidden'),
).toBeTruthy();
- expect(prometheusMetrics.$newCustomMetricButton.hasClass('hidden')).toBeTruthy();
- expect(prometheusMetrics.$newCustomMetricText.hasClass('hidden')).toBeTruthy();
+ expect(customMetrics.$newCustomMetricButton.hasClass('hidden')).toBeTruthy();
+ expect(customMetrics.$newCustomMetricText.hasClass('hidden')).toBeTruthy();
});
it('should show metrics list when called with `list`', () => {
- prometheusMetrics.showMonitoringCustomMetricsPanelState(PANEL_STATE.LIST);
+ customMetrics.showMonitoringCustomMetricsPanelState(PANEL_STATE.LIST);
- expect(prometheusMetrics.$monitoredCustomMetricsLoading.hasClass('hidden')).toBeTruthy();
- expect(prometheusMetrics.$monitoredCustomMetricsEmpty.hasClass('hidden')).toBeTruthy();
- expect(prometheusMetrics.$monitoredCustomMetricsList.hasClass('hidden')).toEqual(false);
+ expect(customMetrics.$monitoredCustomMetricsLoading.hasClass('hidden')).toBeTruthy();
+ expect(customMetrics.$monitoredCustomMetricsEmpty.hasClass('hidden')).toBeTruthy();
+ expect(customMetrics.$monitoredCustomMetricsList.hasClass('hidden')).toEqual(false);
expect(
- prometheusMetrics.$monitoredCustomMetricsNoIntegrationText.hasClass('hidden'),
+ customMetrics.$monitoredCustomMetricsNoIntegrationText.hasClass('hidden'),
).toBeTruthy();
- expect(prometheusMetrics.$newCustomMetricButton.hasClass('hidden')).toEqual(false);
- expect(prometheusMetrics.$newCustomMetricText.hasClass('hidden')).toBeTruthy();
+ expect(customMetrics.$newCustomMetricButton.hasClass('hidden')).toEqual(false);
+ expect(customMetrics.$newCustomMetricText.hasClass('hidden')).toBeTruthy();
});
it('should show empty state when called with `empty`', () => {
- prometheusMetrics.showMonitoringCustomMetricsPanelState(PANEL_STATE.EMPTY);
+ customMetrics.showMonitoringCustomMetricsPanelState(PANEL_STATE.EMPTY);
- expect(prometheusMetrics.$monitoredCustomMetricsLoading.hasClass('hidden')).toBeTruthy();
- expect(prometheusMetrics.$monitoredCustomMetricsEmpty.hasClass('hidden')).toEqual(false);
- expect(prometheusMetrics.$monitoredCustomMetricsList.hasClass('hidden')).toBeTruthy();
+ expect(customMetrics.$monitoredCustomMetricsLoading.hasClass('hidden')).toBeTruthy();
+ expect(customMetrics.$monitoredCustomMetricsEmpty.hasClass('hidden')).toEqual(false);
+ expect(customMetrics.$monitoredCustomMetricsList.hasClass('hidden')).toBeTruthy();
expect(
- prometheusMetrics.$monitoredCustomMetricsNoIntegrationText.hasClass('hidden'),
+ customMetrics.$monitoredCustomMetricsNoIntegrationText.hasClass('hidden'),
).toBeTruthy();
- expect(prometheusMetrics.$newCustomMetricButton.hasClass('hidden')).toEqual(false);
- expect(prometheusMetrics.$newCustomMetricText.hasClass('hidden')).toEqual(false);
+ expect(customMetrics.$newCustomMetricButton.hasClass('hidden')).toEqual(false);
+ expect(customMetrics.$newCustomMetricText.hasClass('hidden')).toEqual(false);
});
it('should show monitored metrics list', () => {
- prometheusMetrics.customMetrics = metrics;
- prometheusMetrics.populateCustomMetrics();
+ customMetrics.customMetrics = metrics;
+ customMetrics.populateCustomMetrics();
- const $metricsListLi = prometheusMetrics.$monitoredCustomMetricsList.find('li');
+ const $metricsListLi = customMetrics.$monitoredCustomMetricsList.find('li');
- expect(prometheusMetrics.$monitoredCustomMetricsLoading.hasClass('hidden')).toBeTruthy();
- expect(prometheusMetrics.$monitoredCustomMetricsList.hasClass('hidden')).toEqual(false);
+ expect(customMetrics.$monitoredCustomMetricsLoading.hasClass('hidden')).toBeTruthy();
+ expect(customMetrics.$monitoredCustomMetricsList.hasClass('hidden')).toEqual(false);
expect(
- prometheusMetrics.$monitoredCustomMetricsNoIntegrationText.hasClass('hidden'),
+ customMetrics.$monitoredCustomMetricsNoIntegrationText.hasClass('hidden'),
).toBeTruthy();
- expect(prometheusMetrics.$newCustomMetricButton.hasClass('hidden')).toEqual(false);
- expect(prometheusMetrics.$newCustomMetricText.hasClass('hidden')).toBeTruthy();
+ expect(customMetrics.$newCustomMetricButton.hasClass('hidden')).toEqual(false);
+ expect(customMetrics.$newCustomMetricText.hasClass('hidden')).toBeTruthy();
expect($metricsListLi.length).toEqual(metrics.length);
});
it('should show the NO-INTEGRATION empty state', () => {
- prometheusMetrics.setNoIntegrationActiveState();
+ customMetrics.setNoIntegrationActiveState();
- expect(prometheusMetrics.$monitoredCustomMetricsEmpty.hasClass('hidden')).toEqual(false);
- expect(prometheusMetrics.$monitoredCustomMetricsNoIntegrationText.hasClass('hidden')).toEqual(
+ expect(customMetrics.$monitoredCustomMetricsEmpty.hasClass('hidden')).toEqual(false);
+ expect(customMetrics.$monitoredCustomMetricsNoIntegrationText.hasClass('hidden')).toEqual(
false,
);
- expect(prometheusMetrics.$monitoredCustomMetricsLoading.hasClass('hidden')).toBeTruthy();
- expect(prometheusMetrics.$monitoredCustomMetricsList.hasClass('hidden')).toBeTruthy();
- expect(prometheusMetrics.$newCustomMetricButton.hasClass('hidden')).toBeTruthy();
- expect(prometheusMetrics.$newCustomMetricText.hasClass('hidden')).toBeTruthy();
+ expect(customMetrics.$monitoredCustomMetricsLoading.hasClass('hidden')).toBeTruthy();
+ expect(customMetrics.$monitoredCustomMetricsList.hasClass('hidden')).toBeTruthy();
+ expect(customMetrics.$newCustomMetricButton.hasClass('hidden')).toBeTruthy();
+ expect(customMetrics.$newCustomMetricText.hasClass('hidden')).toBeTruthy();
});
});
});