summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Gemfile5
-rw-r--r--Gemfile.lock25
-rw-r--r--app/assets/javascripts/issuable_form.js17
-rw-r--r--app/assets/javascripts/pipelines/components/graph/graph_component.vue34
-rw-r--r--app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue49
-rw-r--r--app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue14
-rw-r--r--app/assets/stylesheets/pages/pipelines.scss4
-rw-r--r--changelogs/unreleased/194764-fix-resolve-thread-in-new-issue.yml5
-rw-r--r--changelogs/unreleased/195137-update-webpack-to-4-41-5.yml5
-rw-r--r--changelogs/unreleased/parent-child-upstream-downstream-labels.yml5
-rw-r--r--doc/ci/junit_test_reports.md2
-rw-r--r--doc/development/fe_guide/style/vue.md12
-rw-r--r--doc/user/project/integrations/prometheus_library/nginx.md2
-rw-r--r--locale/gitlab.pot15
-rw-r--r--package.json2
-rw-r--r--spec/frontend/pipelines/graph/linked_pipeline_spec.js63
-rw-r--r--spec/frontend/pipelines/graph/linked_pipelines_mock_data.js4
-rw-r--r--spec/javascripts/pipelines/graph/graph_component_spec.js1
-rw-r--r--spec/javascripts/pipelines/graph/linked_pipelines_column_spec.js1
-rw-r--r--spec/javascripts/pipelines/linked_pipelines_mock.json3
-rw-r--r--yarn.lock25
21 files changed, 227 insertions, 66 deletions
diff --git a/Gemfile b/Gemfile
index 83cfb7bbf14..dc1e3762a8b 100644
--- a/Gemfile
+++ b/Gemfile
@@ -132,8 +132,9 @@ gem 'seed-fu', '~> 2.3.7'
gem 'elasticsearch-model', '~> 6.1'
gem 'elasticsearch-rails', '~> 6.1', require: 'elasticsearch/rails/instrumentation'
gem 'elasticsearch-api', '~> 6.8'
-gem 'aws-sdk'
-gem 'faraday_middleware-aws-signers-v4'
+gem 'aws-sdk-core', '~> 3'
+gem 'aws-sdk-cloudformation', '~> 1'
+gem 'faraday_middleware-aws-sigv4'
# Markdown and HTML processing
gem 'html-pipeline', '~> 2.12'
diff --git a/Gemfile.lock b/Gemfile.lock
index 2a94b907417..2c24085a34c 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -81,13 +81,15 @@ GEM
attr_required (1.0.1)
awesome_print (1.8.0)
aws-eventstream (1.0.3)
- aws-sdk (2.11.374)
- aws-sdk-resources (= 2.11.374)
- aws-sdk-core (2.11.374)
- aws-sigv4 (~> 1.0)
+ aws-partitions (1.263.0)
+ aws-sdk-cloudformation (1.29.0)
+ aws-sdk-core (~> 3, >= 3.71.0)
+ aws-sigv4 (~> 1.1)
+ aws-sdk-core (3.88.0)
+ aws-eventstream (~> 1.0, >= 1.0.2)
+ aws-partitions (~> 1, >= 1.239.0)
+ aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
- aws-sdk-resources (2.11.374)
- aws-sdk-core (= 2.11.374)
aws-sigv4 (1.1.0)
aws-eventstream (~> 1.0, >= 1.0.2)
axiom-types (0.1.1)
@@ -276,9 +278,9 @@ GEM
faraday (~> 0.8)
faraday_middleware (0.12.2)
faraday (>= 0.7.4, < 1.0)
- faraday_middleware-aws-signers-v4 (0.1.7)
- aws-sdk-resources (~> 2)
- faraday (~> 0.9)
+ faraday_middleware-aws-sigv4 (0.3.0)
+ aws-sigv4 (~> 1.0)
+ faraday (>= 0.15)
faraday_middleware-multi_json (0.0.6)
faraday_middleware
multi_json
@@ -1141,7 +1143,8 @@ DEPENDENCIES
atlassian-jwt (~> 0.2.0)
attr_encrypted (~> 3.1.0)
awesome_print
- aws-sdk
+ aws-sdk-cloudformation (~> 1)
+ aws-sdk-core (~> 3)
babosa (~> 1.0.2)
base32 (~> 0.3.0)
batch-loader (~> 1.4.0)
@@ -1187,7 +1190,7 @@ DEPENDENCIES
escape_utils (~> 1.1)
factory_bot_rails (~> 5.1.0)
faraday (~> 0.12)
- faraday_middleware-aws-signers-v4
+ faraday_middleware-aws-sigv4
fast_blank
ffaker (~> 2.10)
flipper (~> 0.17.1)
diff --git a/app/assets/javascripts/issuable_form.js b/app/assets/javascripts/issuable_form.js
index 1d0807dc15d..cf780556c8d 100644
--- a/app/assets/javascripts/issuable_form.js
+++ b/app/assets/javascripts/issuable_form.js
@@ -8,19 +8,23 @@ import AutoWidthDropdownSelect from './issuable/auto_width_dropdown_select';
import { parsePikadayDate, pikadayToString } from './lib/utils/datetime_utility';
import { queryToObject, objectToQuery } from './lib/utils/url_utility';
+const MR_SOURCE_BRANCH = 'merge_request[source_branch]';
+const MR_TARGET_BRANCH = 'merge_request[target_branch]';
+
function organizeQuery(obj, isFallbackKey = false) {
- const sourceBranch = 'merge_request[source_branch]';
- const targetBranch = 'merge_request[target_branch]';
+ if (!obj[MR_SOURCE_BRANCH] && !obj[MR_TARGET_BRANCH]) {
+ return obj;
+ }
if (isFallbackKey) {
return {
- [sourceBranch]: obj[sourceBranch],
+ [MR_SOURCE_BRANCH]: obj[MR_SOURCE_BRANCH],
};
}
return {
- [sourceBranch]: obj[sourceBranch],
- [targetBranch]: obj[targetBranch],
+ [MR_SOURCE_BRANCH]: obj[MR_SOURCE_BRANCH],
+ [MR_TARGET_BRANCH]: obj[MR_TARGET_BRANCH],
};
}
@@ -87,7 +91,8 @@ export default class IssuableForm {
}
initAutosave() {
- const searchTerm = format(document.location.search);
+ const { search } = document.location;
+ const searchTerm = format(search);
const fallbackKey = getFallbackKey();
this.autosave = new Autosave(
diff --git a/app/assets/javascripts/pipelines/components/graph/graph_component.vue b/app/assets/javascripts/pipelines/components/graph/graph_component.vue
index 429122c8083..4dc6e51d2fc 100644
--- a/app/assets/javascripts/pipelines/components/graph/graph_component.vue
+++ b/app/assets/javascripts/pipelines/components/graph/graph_component.vue
@@ -43,7 +43,7 @@ export default {
downstream: 'downstream',
data() {
return {
- triggeredTopIndex: 1,
+ downstreamMarginTop: null,
};
},
computed: {
@@ -77,26 +77,34 @@ export default {
expandedTriggered() {
return this.pipeline.triggered && this.pipeline.triggered.find(el => el.isExpanded);
},
-
- /**
- * Calculates the margin top of the clicked downstream pipeline by
- * adding the height of each linked pipeline and the margin
- */
- marginTop() {
- return `${this.triggeredTopIndex * 52}px`;
- },
pipelineTypeUpstream() {
return this.type !== this.$options.downstream && this.expandedTriggeredBy;
},
pipelineTypeDownstream() {
return this.type !== this.$options.upstream && this.expandedTriggered;
},
+ pipelineProjectId() {
+ return this.pipeline.project.id;
+ },
},
methods: {
- handleClickedDownstream(pipeline, clickedIndex) {
- this.triggeredTopIndex = clickedIndex;
+ handleClickedDownstream(pipeline, clickedIndex, downstreamNode) {
+ /**
+ * Calculates the margin top of the clicked downstream pipeline by
+ * subtracting the clicked downstream pipelines offsetTop by it's parent's
+ * offsetTop and then subtracting either 15 (if child) or 30 (if not a child)
+ * due to the height of node and stage name margin bottom.
+ */
+ this.downstreamMarginTop = this.calculateMarginTop(
+ downstreamNode,
+ downstreamNode.classList.contains('child-pipeline') ? 15 : 30,
+ );
+
this.$emit('onClickTriggered', this.pipeline, pipeline);
},
+ calculateMarginTop(downstreamNode, pixelDiff) {
+ return `${downstreamNode.offsetTop - downstreamNode.offsetParent.offsetTop - pixelDiff}px`;
+ },
hasOnlyOneJob(stage) {
return stage.groups.length === 1;
},
@@ -139,6 +147,7 @@ export default {
v-if="hasTriggeredBy"
:linked-pipelines="triggeredByPipelines"
:column-title="__('Upstream')"
+ :project-id="pipelineProjectId"
graph-position="left"
@linkedPipelineClick="
linkedPipeline => $emit('onClickTriggeredBy', pipeline, linkedPipeline)
@@ -174,6 +183,7 @@ export default {
v-if="hasTriggered"
:linked-pipelines="triggeredPipelines"
:column-title="__('Downstream')"
+ :project-id="pipelineProjectId"
graph-position="right"
@linkedPipelineClick="handleClickedDownstream"
/>
@@ -186,7 +196,7 @@ export default {
:is-loading="false"
:pipeline="expandedTriggered"
:is-linked-pipeline="true"
- :style="{ 'margin-top': marginTop }"
+ :style="{ 'margin-top': downstreamMarginTop }"
:mediator="mediator"
@onClickTriggered="
(parentPipeline, pipeline) => clickTriggeredPipeline(parentPipeline, pipeline)
diff --git a/app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue b/app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue
index 82335e71403..d929398b6dc 100644
--- a/app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue
+++ b/app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue
@@ -1,6 +1,7 @@
<script>
import { GlLoadingIcon, GlTooltipDirective, GlButton } from '@gitlab/ui';
import CiStatus from '~/vue_shared/components/ci_icon.vue';
+import { __ } from '~/locale';
export default {
directives: {
@@ -16,6 +17,14 @@ export default {
type: Object,
required: true,
},
+ projectId: {
+ type: Number,
+ required: true,
+ },
+ columnTitle: {
+ type: String,
+ required: true,
+ },
},
computed: {
tooltipText() {
@@ -30,18 +39,45 @@ export default {
projectName() {
return this.pipeline.project.name;
},
+ parentPipeline() {
+ // Refactor string match when BE returns Upstream/Downstream indicators
+ return this.projectId === this.pipeline.project.id && this.columnTitle === __('Upstream');
+ },
+ childPipeline() {
+ // Refactor string match when BE returns Upstream/Downstream indicators
+ return this.projectId === this.pipeline.project.id && this.columnTitle === __('Downstream');
+ },
+ label() {
+ return this.parentPipeline ? __('Parent') : __('Child');
+ },
+ childTooltipText() {
+ return __('This pipeline was triggered by a parent pipeline');
+ },
+ parentTooltipText() {
+ return __('This pipeline triggered a child pipeline');
+ },
+ labelToolTipText() {
+ return this.label === __('Parent') ? this.parentTooltipText : this.childTooltipText;
+ },
},
methods: {
onClickLinkedPipeline() {
this.$root.$emit('bv::hide::tooltip', this.buttonId);
- this.$emit('pipelineClicked');
+ this.$emit('pipelineClicked', this.$refs.linkedPipeline);
+ },
+ hideTooltips() {
+ this.$root.$emit('bv::hide::tooltip');
},
},
};
</script>
<template>
- <li class="linked-pipeline build">
+ <li
+ ref="linkedPipeline"
+ class="linked-pipeline build"
+ :class="{ 'child-pipeline': childPipeline }"
+ >
<gl-button
:id="buttonId"
v-gl-tooltip
@@ -59,6 +95,15 @@ export default {
class="js-linked-pipeline-status"
/>
<span class="str-truncated align-bottom"> {{ projectName }} &#8226; #{{ pipeline.id }} </span>
+ <div v-if="parentPipeline || childPipeline" class="parent-child-label-container">
+ <span
+ v-gl-tooltip.bottom
+ :title="labelToolTipText"
+ class="badge badge-primary"
+ @mouseover="hideTooltips"
+ >{{ label }}</span
+ >
+ </div>
</gl-button>
</li>
</template>
diff --git a/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue b/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue
index 998519f9df1..e3429184c05 100644
--- a/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue
+++ b/app/assets/javascripts/pipelines/components/graph/linked_pipelines_column.vue
@@ -19,6 +19,10 @@ export default {
type: String,
required: true,
},
+ projectId: {
+ type: Number,
+ required: true,
+ },
},
computed: {
columnClass() {
@@ -28,10 +32,16 @@ export default {
};
return `graph-position-${this.graphPosition} ${positionValues[this.graphPosition]}`;
},
+ // Refactor string match when BE returns Upstream/Downstream indicators
isUpstream() {
return this.columnTitle === __('Upstream');
},
},
+ methods: {
+ onPipelineClick(downstreamNode, pipeline, index) {
+ this.$emit('linkedPipelineClick', pipeline, index, downstreamNode);
+ },
+ },
};
</script>
@@ -48,7 +58,9 @@ export default {
'left-connector': pipeline.isExpanded && graphPosition === 'left',
}"
:pipeline="pipeline"
- @pipelineClicked="$emit('linkedPipelineClick', pipeline, index)"
+ :column-title="columnTitle"
+ :project-id="projectId"
+ @pipelineClicked="onPipelineClick($event, pipeline, index)"
/>
</ul>
</div>
diff --git a/app/assets/stylesheets/pages/pipelines.scss b/app/assets/stylesheets/pages/pipelines.scss
index 72657a64794..82bef91230e 100644
--- a/app/assets/stylesheets/pages/pipelines.scss
+++ b/app/assets/stylesheets/pages/pipelines.scss
@@ -1093,3 +1093,7 @@ button.mini-pipeline-graph-dropdown-toggle {
.progress-bar.bg-primary {
background-color: $blue-500 !important;
}
+
+.parent-child-label-container {
+ padding-top: $gl-padding-4;
+}
diff --git a/changelogs/unreleased/194764-fix-resolve-thread-in-new-issue.yml b/changelogs/unreleased/194764-fix-resolve-thread-in-new-issue.yml
new file mode 100644
index 00000000000..360bf31b3be
--- /dev/null
+++ b/changelogs/unreleased/194764-fix-resolve-thread-in-new-issue.yml
@@ -0,0 +1,5 @@
+---
+title: Avoid pre-populating form for MR resolve issues
+merge_request: 22593
+author:
+type: fixed
diff --git a/changelogs/unreleased/195137-update-webpack-to-4-41-5.yml b/changelogs/unreleased/195137-update-webpack-to-4-41-5.yml
new file mode 100644
index 00000000000..3f997f185e2
--- /dev/null
+++ b/changelogs/unreleased/195137-update-webpack-to-4-41-5.yml
@@ -0,0 +1,5 @@
+---
+title: Update webpack from 4.40.2 to 4.41.5
+merge_request: 22452
+author: Takuya Noguchi
+type: security
diff --git a/changelogs/unreleased/parent-child-upstream-downstream-labels.yml b/changelogs/unreleased/parent-child-upstream-downstream-labels.yml
new file mode 100644
index 00000000000..b7fa45f7f61
--- /dev/null
+++ b/changelogs/unreleased/parent-child-upstream-downstream-labels.yml
@@ -0,0 +1,5 @@
+---
+title: Add child and parent labels to pipelines
+merge_request: 21332
+author:
+type: added
diff --git a/doc/ci/junit_test_reports.md b/doc/ci/junit_test_reports.md
index f0c3da4358a..8773f712110 100644
--- a/doc/ci/junit_test_reports.md
+++ b/doc/ci/junit_test_reports.md
@@ -25,7 +25,7 @@ Consider the following workflow:
1. Your `master` branch is rock solid, your project is using GitLab CI/CD and
your pipelines indicate that there isn't anything broken.
-1. Someone from you team submits a merge request, a test fails and the pipeline
+1. Someone from your team submits a merge request, a test fails and the pipeline
gets the known red icon. To investigate more, you have to go through the job
logs to figure out the cause of the failed test, which usually contain
thousands of lines.
diff --git a/doc/development/fe_guide/style/vue.md b/doc/development/fe_guide/style/vue.md
index 2499623e66a..8f69792287b 100644
--- a/doc/development/fe_guide/style/vue.md
+++ b/doc/development/fe_guide/style/vue.md
@@ -7,8 +7,8 @@ Please check this [rules](https://github.com/vuejs/eslint-plugin-vue#bulb-rules)
## Basic Rules
-1. The service has it's own file
-1. The store has it's own file
+1. The service has its own file
+1. The store has its own file
1. Use a function in the bundle file to instantiate the Vue component:
```javascript
@@ -268,7 +268,7 @@ Please check this [rules](https://github.com/vuejs/eslint-plugin-vue#bulb-rules)
## Closing tags
-1. Prefer self closing component tags
+1. Prefer self-closing component tags
```javascript
// bad
@@ -411,8 +411,8 @@ The goal of this accord is to make sure we are all on the same page.
1. You may use a jQuery dependency in Vue.js following [this example from the docs](https://vuejs.org/v2/examples/select2.html).
1. If an outside jQuery Event needs to be listen to inside the Vue application, you may use jQuery event listeners.
1. We will avoid adding new jQuery events when they are not required. Instead of adding new jQuery events take a look at [different methods to do the same task](https://vuejs.org/v2/api/#vm-emit).
-1. You may query the `window` object 1 time, while bootstrapping your application for application specific data (e.g. `scrollTo` is ok to access anytime). Do this access during the bootstrapping of your application.
-1. You may have a temporary but immediate need to create technical debt by writing code that does not follow our standards, to be refactored later. Maintainers need to be ok with the tech debt in the first place. An issue should be created for that tech debt to evaluate it further and discuss. In the coming months you should fix that tech debt, with it's priority to be determined by maintainers.
+1. You may query the `window` object one time, while bootstrapping your application for application specific data (e.g. `scrollTo` is ok to access anytime). Do this access during the bootstrapping of your application.
+1. You may have a temporary but immediate need to create technical debt by writing code that does not follow our standards, to be refactored later. Maintainers need to be ok with the tech debt in the first place. An issue should be created for that tech debt to evaluate it further and discuss. In the coming months you should fix that tech debt, with its priority to be determined by maintainers.
1. When creating tech debt you must write the tests for that code before hand and those tests may not be rewritten. e.g. jQuery tests rewritten to Vue tests.
1. You may choose to use VueX as a centralized state management. If you choose not to use VueX, you must use the *store pattern* which can be found in the [Vue.js documentation](https://vuejs.org/v2/guide/state-management.html#Simple-State-Management-from-Scratch).
-1. Once you have chosen a centralized state management solution you must use it for your entire application. i.e. Don't mix and match your state management solutions.
+1. Once you have chosen a centralized state-management solution you must use it for your entire application. i.e. Don't mix and match your state-management solutions.
diff --git a/doc/user/project/integrations/prometheus_library/nginx.md b/doc/user/project/integrations/prometheus_library/nginx.md
index cf46456ca42..eda8cf35091 100644
--- a/doc/user/project/integrations/prometheus_library/nginx.md
+++ b/doc/user/project/integrations/prometheus_library/nginx.md
@@ -20,7 +20,7 @@ NGINX server metrics are detected, which tracks the pages and content directly s
## Configuring Prometheus to monitor for NGINX metrics
-To get started with NGINX monitoring, you should first enable the [VTS statistics](https://github.com/vozlt/nginx-module-vts)) module for your NGINX server. This will capture and display statistics in an HTML readable form. Next, you should install and configure the [NGINX VTS exporter](https://github.com/hnlq715/nginx-vts-exporter) which parses these statistics and translates them into a Prometheus monitoring endpoint.
+To get started with NGINX monitoring, you should first enable the [VTS statistics](https://github.com/vozlt/nginx-module-vts) module for your NGINX server. This will capture and display statistics in an HTML readable form. Next, you should install and configure the [NGINX VTS exporter](https://github.com/hnlq715/nginx-vts-exporter) which parses these statistics and translates them into a Prometheus monitoring endpoint.
If you are using NGINX as your Kubernetes Ingress, GitLab will [automatically detect](nginx_ingress.md) the metrics once enabled in 0.9.0 and later releases.
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index a7185b3c68f..890e925c238 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -3344,6 +3344,9 @@ msgstr ""
msgid "Cherry-pick this merge request"
msgstr ""
+msgid "Child"
+msgstr ""
+
msgid "Child epic does not exist."
msgstr ""
@@ -11370,6 +11373,9 @@ msgstr ""
msgid "Merge Requests created"
msgstr ""
+msgid "Merge Requests in Review"
+msgstr ""
+
msgid "Merge commit message"
msgstr ""
@@ -12876,6 +12882,9 @@ msgstr ""
msgid "Parameter \"job_id\" cannot exceed length of %{job_id_max_size}"
msgstr ""
+msgid "Parent"
+msgstr ""
+
msgid "Parent epic doesn't exist."
msgstr ""
@@ -18875,6 +18884,12 @@ msgstr ""
msgid "This pipeline makes use of a predefined CI/CD configuration enabled by <b>Auto DevOps.</b>"
msgstr ""
+msgid "This pipeline triggered a child pipeline"
+msgstr ""
+
+msgid "This pipeline was triggered by a parent pipeline"
+msgstr ""
+
msgid "This project"
msgstr ""
diff --git a/package.json b/package.json
index d658b8ff2ec..113b3de59ee 100644
--- a/package.json
+++ b/package.json
@@ -135,7 +135,7 @@
"vue-virtual-scroll-list": "^1.4.4",
"vuedraggable": "^2.23.0",
"vuex": "^3.1.0",
- "webpack": "^4.40.2",
+ "webpack": "^4.41.5",
"webpack-bundle-analyzer": "^3.5.1",
"webpack-cli": "^3.3.9",
"webpack-stats-plugin": "^0.3.0",
diff --git a/spec/frontend/pipelines/graph/linked_pipeline_spec.js b/spec/frontend/pipelines/graph/linked_pipeline_spec.js
index 8cd9cb7e95d..de1f9142001 100644
--- a/spec/frontend/pipelines/graph/linked_pipeline_spec.js
+++ b/spec/frontend/pipelines/graph/linked_pipeline_spec.js
@@ -8,6 +8,13 @@ const mockPipeline = mockData.triggered[0];
describe('Linked pipeline', () => {
let wrapper;
+ const createWrapper = propsData => {
+ wrapper = mount(LinkedPipelineComponent, {
+ attachToDocument: true,
+ propsData,
+ });
+ };
+
afterEach(() => {
wrapper.destroy();
});
@@ -15,13 +22,12 @@ describe('Linked pipeline', () => {
describe('rendered output', () => {
const props = {
pipeline: mockPipeline,
+ projectId: 20,
+ columnTitle: 'Downstream',
};
beforeEach(() => {
- wrapper = mount(LinkedPipelineComponent, {
- attachToDocument: true,
- propsData: props,
- });
+ createWrapper(props);
});
it('should render a list item as the containing element', () => {
@@ -73,18 +79,50 @@ describe('Linked pipeline', () => {
it('does not render the loading icon when isLoading is false', () => {
expect(wrapper.find('.js-linked-pipeline-loading').exists()).toBe(false);
});
+
+ it('should not display child label when pipeline project id is not the same as triggered pipeline project id', () => {
+ const labelContainer = wrapper.find('.parent-child-label-container');
+ expect(labelContainer.exists()).toBe(false);
+ });
+ });
+
+ describe('parent/child', () => {
+ const downstreamProps = {
+ pipeline: mockPipeline,
+ projectId: 19,
+ columnTitle: 'Downstream',
+ };
+
+ const upstreamProps = {
+ ...downstreamProps,
+ columnTitle: 'Upstream',
+ };
+
+ it('parent/child label container should exist', () => {
+ createWrapper(downstreamProps);
+ expect(wrapper.find('.parent-child-label-container').exists()).toBe(true);
+ });
+
+ it('should display child label when pipeline project id is the same as triggered pipeline project id', () => {
+ createWrapper(downstreamProps);
+ expect(wrapper.find('.parent-child-label-container').text()).toContain('Child');
+ });
+
+ it('should display parent label when pipeline project id is the same as triggered_by pipeline project id', () => {
+ createWrapper(upstreamProps);
+ expect(wrapper.find('.parent-child-label-container').text()).toContain('Parent');
+ });
});
describe('when isLoading is true', () => {
const props = {
pipeline: { ...mockPipeline, isLoading: true },
+ projectId: 19,
+ columnTitle: 'Downstream',
};
beforeEach(() => {
- wrapper = mount(LinkedPipelineComponent, {
- attachToDocument: true,
- propsData: props,
- });
+ createWrapper(props);
});
it('renders a loading icon', () => {
@@ -95,20 +133,19 @@ describe('Linked pipeline', () => {
describe('on click', () => {
const props = {
pipeline: mockPipeline,
+ projectId: 19,
+ columnTitle: 'Downstream',
};
beforeEach(() => {
- wrapper = mount(LinkedPipelineComponent, {
- attachToDocument: true,
- propsData: props,
- });
+ createWrapper(props);
});
it('emits `pipelineClicked` event', () => {
jest.spyOn(wrapper.vm, '$emit');
wrapper.find('button').trigger('click');
- expect(wrapper.vm.$emit).toHaveBeenCalledWith('pipelineClicked');
+ expect(wrapper.emitted().pipelineClicked).toBeTruthy();
});
it('should emit `bv::hide::tooltip` to close the tooltip', () => {
diff --git a/spec/frontend/pipelines/graph/linked_pipelines_mock_data.js b/spec/frontend/pipelines/graph/linked_pipelines_mock_data.js
index f794b8484a7..c9a94b3101f 100644
--- a/spec/frontend/pipelines/graph/linked_pipelines_mock_data.js
+++ b/spec/frontend/pipelines/graph/linked_pipelines_mock_data.js
@@ -1,4 +1,7 @@
export default {
+ project: {
+ id: 19,
+ },
triggered_by: {
id: 129,
active: true,
@@ -63,6 +66,7 @@ export default {
path: '/gitlab-org/gitlab-foss/pipelines/132',
project: {
name: 'GitLabCE',
+ id: 19,
},
details: {
status: {
diff --git a/spec/javascripts/pipelines/graph/graph_component_spec.js b/spec/javascripts/pipelines/graph/graph_component_spec.js
index 5effbaabcd1..fa6a5f57410 100644
--- a/spec/javascripts/pipelines/graph/graph_component_spec.js
+++ b/spec/javascripts/pipelines/graph/graph_component_spec.js
@@ -190,6 +190,7 @@ describe('graph component', () => {
describe('on click', () => {
it('should emit `onClickTriggered`', () => {
spyOn(component, '$emit');
+ spyOn(component, 'calculateMarginTop').and.callFake(() => '16px');
component.$el.querySelector('#js-linked-pipeline-34993051').click();
diff --git a/spec/javascripts/pipelines/graph/linked_pipelines_column_spec.js b/spec/javascripts/pipelines/graph/linked_pipelines_column_spec.js
index fe7039da9e4..613ab2a906f 100644
--- a/spec/javascripts/pipelines/graph/linked_pipelines_column_spec.js
+++ b/spec/javascripts/pipelines/graph/linked_pipelines_column_spec.js
@@ -9,6 +9,7 @@ describe('Linked Pipelines Column', () => {
columnTitle: 'Upstream',
linkedPipelines: mockData.triggered,
graphPosition: 'right',
+ projectId: 19,
};
let vm;
diff --git a/spec/javascripts/pipelines/linked_pipelines_mock.json b/spec/javascripts/pipelines/linked_pipelines_mock.json
index b498903f804..60e214ddc32 100644
--- a/spec/javascripts/pipelines/linked_pipelines_mock.json
+++ b/spec/javascripts/pipelines/linked_pipelines_mock.json
@@ -341,6 +341,9 @@
"commit_url": "https://gitlab.com/gitlab-org/gitlab-runner/commit/8083eb0a920572214d0dccedd7981f05d535ad46",
"commit_path": "/gitlab-org/gitlab-runner/commit/8083eb0a920572214d0dccedd7981f05d535ad46"
},
+ "project": {
+ "id": 1794617
+ },
"triggered_by": {
"id": 12,
"user": {
diff --git a/yarn.lock b/yarn.lock
index aa18e5d0096..599da5eecd1 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -10002,6 +10002,11 @@ serialize-javascript@^1.4.0, serialize-javascript@^1.7.0:
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.7.0.tgz#d6e0dfb2a3832a8c94468e6eb1db97e55a192a65"
integrity sha512-ke8UG8ulpFOxO8f8gRYabHQe/ZntKlcig2Mp+8+URDP1D8vJZ0KUt7LYo07q25Z/+JVSgpr/cui9PIp5H6/+nA==
+serialize-javascript@^2.1.2:
+ version "2.1.2"
+ resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-2.1.2.tgz#ecec53b0e0317bdc95ef76ab7074b7384785fa61"
+ integrity sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==
+
serve-index@^1.9.1:
version "1.9.1"
resolved "https://registry.yarnpkg.com/serve-index/-/serve-index-1.9.1.tgz#d3768d69b1e7d82e5ce050fff5b453bea12a9239"
@@ -10816,16 +10821,16 @@ term-size@^1.2.0:
dependencies:
execa "^0.7.0"
-terser-webpack-plugin@^1.4.1:
- version "1.4.1"
- resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.4.1.tgz#61b18e40eaee5be97e771cdbb10ed1280888c2b4"
- integrity sha512-ZXmmfiwtCLfz8WKZyYUuuHf3dMYEjg8NrjHMb0JqHVHVOSkzp3cW2/XG1fP3tRhqEqSzMwzzRQGtAPbs4Cncxg==
+terser-webpack-plugin@^1.4.3:
+ version "1.4.3"
+ resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.4.3.tgz#5ecaf2dbdc5fb99745fd06791f46fc9ddb1c9a7c"
+ integrity sha512-QMxecFz/gHQwteWwSo5nTc6UaICqN1bMedC5sMtUc7y3Ha3Q8y6ZO0iCR8pq4RJC8Hjf0FEPEHZqcMB/+DFCrA==
dependencies:
cacache "^12.0.2"
find-cache-dir "^2.1.0"
is-wsl "^1.1.0"
schema-utils "^1.0.0"
- serialize-javascript "^1.7.0"
+ serialize-javascript "^2.1.2"
source-map "^0.6.1"
terser "^4.1.2"
webpack-sources "^1.4.0"
@@ -11846,10 +11851,10 @@ webpack-stats-plugin@^0.3.0:
resolved "https://registry.yarnpkg.com/webpack-stats-plugin/-/webpack-stats-plugin-0.3.0.tgz#6952f63feb9a5393a328d774fb3eccac78d2f51b"
integrity sha512-4a6mEl9HLtMukVjEPY8QPCSmtX2EDFJNhDTX5ZE2CLch2adKAZf53nUrpG6m7NattwigS0AodNcwNxlu9kMSDQ==
-webpack@^4.40.2:
- version "4.40.2"
- resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.40.2.tgz#d21433d250f900bf0facbabe8f50d585b2dc30a7"
- integrity sha512-5nIvteTDCUws2DVvP9Qe+JPla7kWPPIDFZv55To7IycHWZ+Z5qBdaBYPyuXWdhggTufZkQwfIK+5rKQTVovm2A==
+webpack@^4.41.5:
+ version "4.41.5"
+ resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.41.5.tgz#3210f1886bce5310e62bb97204d18c263341b77c"
+ integrity sha512-wp0Co4vpyumnp3KlkmpM5LWuzvZYayDwM2n17EHFr4qxBBbRokC7DJawPJC7TfSFZ9HZ6GsdH40EBj4UV0nmpw==
dependencies:
"@webassemblyjs/ast" "1.8.5"
"@webassemblyjs/helper-module-context" "1.8.5"
@@ -11871,7 +11876,7 @@ webpack@^4.40.2:
node-libs-browser "^2.2.1"
schema-utils "^1.0.0"
tapable "^1.1.3"
- terser-webpack-plugin "^1.4.1"
+ terser-webpack-plugin "^1.4.3"
watchpack "^1.6.0"
webpack-sources "^1.4.1"