Commit 3a50fc5d authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch '57414-show-pipeline-iid-in-pipelines-page' into 'master'

Show Pipeline IID everywhere Pipeline ID is shown.

Closes #57414

See merge request gitlab-org/gitlab-ce!26853
parents 847fd2a5 852738a4
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import _ from 'underscore'; import _ from 'underscore';
import { GlLink } from '@gitlab/ui'; import { GlLink } from '@gitlab/ui';
import CiIcon from '~/vue_shared/components/ci_icon.vue'; import CiIcon from '~/vue_shared/components/ci_icon.vue';
import PipelineLink from '~/vue_shared/components/ci_pipeline_link.vue';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
export default { export default {
...@@ -9,6 +10,7 @@ export default { ...@@ -9,6 +10,7 @@ export default {
CiIcon, CiIcon,
Icon, Icon,
GlLink, GlLink,
PipelineLink,
}, },
props: { props: {
pipeline: { pipeline: {
...@@ -48,9 +50,12 @@ export default { ...@@ -48,9 +50,12 @@ export default {
<ci-icon :status="pipeline.details.status" class="vertical-align-middle" /> <ci-icon :status="pipeline.details.status" class="vertical-align-middle" />
<span class="font-weight-bold">{{ s__('Job|Pipeline') }}</span> <span class="font-weight-bold">{{ s__('Job|Pipeline') }}</span>
<gl-link :href="pipeline.path" class="js-pipeline-path link-commit qa-pipeline-path" <pipeline-link
>#{{ pipeline.id }}</gl-link :href="pipeline.path"
> :pipeline-id="pipeline.id"
:pipeline-iid="pipeline.iid"
class="js-pipeline-path link-commit qa-pipeline-path"
/>
<template v-if="hasRef"> <template v-if="hasRef">
{{ s__('Job|for') }} {{ s__('Job|for') }}
......
...@@ -83,6 +83,8 @@ export default { ...@@ -83,6 +83,8 @@ export default {
v-if="shouldRenderContent" v-if="shouldRenderContent"
:status="status" :status="status"
:item-id="pipeline.id" :item-id="pipeline.id"
:item-iid="pipeline.iid"
:item-id-tooltip="__('Pipeline ID (IID)')"
:time="pipeline.created_at" :time="pipeline.created_at"
:user="pipeline.user" :user="pipeline.user"
:actions="actions" :actions="actions"
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import { GlLink, GlTooltipDirective } from '@gitlab/ui'; import { GlLink, GlTooltipDirective } from '@gitlab/ui';
import _ from 'underscore'; import _ from 'underscore';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import PipelineLink from '~/vue_shared/components/ci_pipeline_link.vue';
import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue'; import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue';
import popover from '~/vue_shared/directives/popover'; import popover from '~/vue_shared/directives/popover';
...@@ -19,6 +20,7 @@ export default { ...@@ -19,6 +20,7 @@ export default {
components: { components: {
UserAvatarLink, UserAvatarLink,
GlLink, GlLink,
PipelineLink,
}, },
directives: { directives: {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
...@@ -59,10 +61,13 @@ export default { ...@@ -59,10 +61,13 @@ export default {
}; };
</script> </script>
<template> <template>
<div class="table-section section-10 d-none d-sm-none d-md-block pipeline-tags"> <div class="table-section section-10 d-none d-sm-none d-md-block pipeline-tags section-wrap">
<gl-link :href="pipeline.path" class="js-pipeline-url-link"> <pipeline-link
<span class="pipeline-id">#{{ pipeline.id }}</span> :href="pipeline.path"
</gl-link> :pipeline-id="pipeline.id"
:pipeline-iid="pipeline.iid"
class="js-pipeline-url-link"
/>
<div class="label-container"> <div class="label-container">
<span <span
v-if="pipeline.flags.latest" v-if="pipeline.flags.latest"
......
...@@ -5,6 +5,7 @@ import { sprintf, __ } from '~/locale'; ...@@ -5,6 +5,7 @@ import { sprintf, __ } from '~/locale';
import PipelineStage from '~/pipelines/components/stage.vue'; import PipelineStage from '~/pipelines/components/stage.vue';
import CiIcon from '~/vue_shared/components/ci_icon.vue'; import CiIcon from '~/vue_shared/components/ci_icon.vue';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import PipelineLink from '~/vue_shared/components/ci_pipeline_link.vue';
import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate.vue'; import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate.vue';
import mrWidgetPipelineMixin from 'ee_else_ce/vue_merge_request_widget/mixins/mr_widget_pipeline'; import mrWidgetPipelineMixin from 'ee_else_ce/vue_merge_request_widget/mixins/mr_widget_pipeline';
...@@ -16,6 +17,7 @@ export default { ...@@ -16,6 +17,7 @@ export default {
Icon, Icon,
TooltipOnTruncate, TooltipOnTruncate,
GlLink, GlLink,
PipelineLink,
LinkedPipelinesMiniList: () => LinkedPipelinesMiniList: () =>
import('ee_component/vue_shared/components/linked_pipelines_mini_list.vue'), import('ee_component/vue_shared/components/linked_pipelines_mini_list.vue'),
}, },
...@@ -112,9 +114,12 @@ export default { ...@@ -112,9 +114,12 @@ export default {
<div class="media-body"> <div class="media-body">
<div class="font-weight-bold js-pipeline-info-container"> <div class="font-weight-bold js-pipeline-info-container">
{{ s__('Pipeline|Pipeline') }} {{ s__('Pipeline|Pipeline') }}
<gl-link :href="pipeline.path" class="pipeline-id font-weight-normal pipeline-number" <pipeline-link
>#{{ pipeline.id }}</gl-link :href="pipeline.path"
> :pipeline-id="pipeline.id"
:pipeline-iid="pipeline.iid"
class="pipeline-id pipeline-iid font-weight-normal"
/>
{{ pipeline.details.status.label }} {{ pipeline.details.status.label }}
<template v-if="hasCommitInfo"> <template v-if="hasCommitInfo">
{{ s__('Pipeline|for') }} {{ s__('Pipeline|for') }}
......
<script>
import { GlLink, GlTooltipDirective } from '@gitlab/ui';
export default {
components: {
GlLink,
},
directives: {
GlTooltip: GlTooltipDirective,
},
props: {
href: {
type: String,
required: true,
},
pipelineId: {
type: Number,
required: true,
},
pipelineIid: {
type: Number,
required: true,
},
},
};
</script>
<template>
<gl-link v-gl-tooltip :href="href" :title="__('Pipeline ID (IID)')">
<span class="pipeline-id">#{{ pipelineId }}</span>
<span class="pipeline-iid">(#{{ pipelineIid }})</span>
</gl-link>
</template>
...@@ -37,6 +37,16 @@ export default { ...@@ -37,6 +37,16 @@ export default {
type: Number, type: Number,
required: true, required: true,
}, },
itemIid: {
type: Number,
required: false,
default: null,
},
itemIdTooltip: {
type: String,
required: false,
default: '',
},
time: { time: {
type: String, type: String,
required: true, required: true,
...@@ -85,7 +95,12 @@ export default { ...@@ -85,7 +95,12 @@ export default {
<section class="header-main-content"> <section class="header-main-content">
<ci-icon-badge :status="status" /> <ci-icon-badge :status="status" />
<strong> {{ itemName }} #{{ itemId }} </strong> <strong v-gl-tooltip :title="itemIdTooltip">
{{ itemName }} #{{ itemId }}
<template v-if="itemIid"
>(#{{ itemIid }})</template
>
</strong>
<template v-if="shouldRenderTriggeredLabel"> <template v-if="shouldRenderTriggeredLabel">
triggered triggered
...@@ -96,9 +111,8 @@ export default { ...@@ -96,9 +111,8 @@ export default {
<timeago-tooltip :time="time" /> <timeago-tooltip :time="time" />
by
<template v-if="user"> <template v-if="user">
by
<gl-link <gl-link
v-gl-tooltip v-gl-tooltip
:href="user.path" :href="user.path"
......
...@@ -4,6 +4,7 @@ class PipelineEntity < Grape::Entity ...@@ -4,6 +4,7 @@ class PipelineEntity < Grape::Entity
include RequestAwareEntity include RequestAwareEntity
expose :id expose :id
expose :iid
expose :user, using: UserEntity expose :user, using: UserEntity
expose :active?, as: :active expose :active?, as: :active
......
...@@ -53,9 +53,10 @@ ...@@ -53,9 +53,10 @@
%span.badge.badge-info= _('manual') %span.badge.badge-info= _('manual')
- if pipeline_link - if pipeline_link
%td %td.pipeline-link
= link_to pipeline_path(pipeline) do = link_to pipeline_path(pipeline), class: 'has-tooltip', title: _('Pipeline ID (IID)') do
%span.pipeline-id ##{pipeline.id} %span.pipeline-id ##{pipeline.id}
%span.pipeline-iid (##{pipeline.iid})
%span by %span by
- if pipeline.user - if pipeline.user
= user_avatar(user: pipeline.user, size: 20) = user_avatar(user: pipeline.user, size: 20)
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
= link_to project_pipeline_path(@project, last_pipeline.id), class: "ci-status-icon-#{last_pipeline.status}" do = link_to project_pipeline_path(@project, last_pipeline.id), class: "ci-status-icon-#{last_pipeline.status}" do
= ci_icon_for_status(last_pipeline.status) = ci_icon_for_status(last_pipeline.status)
#{ _('Pipeline') } #{ _('Pipeline') }
= link_to "##{last_pipeline.id}", project_pipeline_path(@project, last_pipeline.id) = link_to "##{last_pipeline.id} (##{last_pipeline.iid})", project_pipeline_path(@project, last_pipeline.id), class: "has-tooltip", title: _('Pipeline ID (IID)')
= ci_label_for_status(last_pipeline.status) = ci_label_for_status(last_pipeline.status)
- if last_pipeline.stages_count.nonzero? - if last_pipeline.stages_count.nonzero?
#{ n_(s_('Pipeline|with stage'), s_('Pipeline|with stages'), last_pipeline.stages_count) } #{ n_(s_('Pipeline|with stage'), s_('Pipeline|with stages'), last_pipeline.stages_count) }
......
---
title: Show Pipeline IID everywhere Pipeline ID is shown
merge_request: 57414
author: Mike Scott
type: added
...@@ -6886,6 +6886,9 @@ msgstr "" ...@@ -6886,6 +6886,9 @@ msgstr ""
msgid "Pipeline" msgid "Pipeline"
msgstr "" msgstr ""
msgid "Pipeline ID (IID)"
msgstr ""
msgid "Pipeline Schedule" msgid "Pipeline Schedule"
msgstr "" msgstr ""
......
...@@ -52,7 +52,7 @@ describe 'Merge request > User merges when pipeline succeeds', :js do ...@@ -52,7 +52,7 @@ describe 'Merge request > User merges when pipeline succeeds', :js do
# so we have to wait for asynchronous call to reload it # so we have to wait for asynchronous call to reload it
# and have_content expectation handles that. # and have_content expectation handles that.
# #
expect(page).to have_content "Pipeline ##{pipeline.id} running" expect(page).to have_content "Pipeline ##{pipeline.id} (##{pipeline.iid}) running"
end end
it_behaves_like 'Merge when pipeline succeeds activator' it_behaves_like 'Merge when pipeline succeeds activator'
......
...@@ -160,7 +160,7 @@ describe 'Merge request > User sees merge widget', :js do ...@@ -160,7 +160,7 @@ describe 'Merge request > User sees merge widget', :js do
it 'shows head pipeline information' do it 'shows head pipeline information' do
within '.ci-widget-content' do within '.ci-widget-content' do
expect(page).to have_content("Pipeline ##{pipeline.id} pending " \ expect(page).to have_content("Pipeline ##{pipeline.id} (##{pipeline.iid}) pending " \
"for #{pipeline.short_sha} " \ "for #{pipeline.short_sha} " \
"on #{pipeline.ref}") "on #{pipeline.ref}")
end end
...@@ -189,7 +189,7 @@ describe 'Merge request > User sees merge widget', :js do ...@@ -189,7 +189,7 @@ describe 'Merge request > User sees merge widget', :js do
it 'shows head pipeline information' do it 'shows head pipeline information' do
within '.ci-widget-content' do within '.ci-widget-content' do
expect(page).to have_content("Pipeline ##{pipeline.id} pending " \ expect(page).to have_content("Pipeline ##{pipeline.id} (##{pipeline.iid}) pending " \
"for #{pipeline.short_sha} " \ "for #{pipeline.short_sha} " \
"on #{merge_request.to_reference} " \ "on #{merge_request.to_reference} " \
"with #{merge_request.source_branch}") "with #{merge_request.source_branch}")
...@@ -201,7 +201,7 @@ describe 'Merge request > User sees merge widget', :js do ...@@ -201,7 +201,7 @@ describe 'Merge request > User sees merge widget', :js do
it 'shows head pipeline information' do it 'shows head pipeline information' do
within '.ci-widget-content' do within '.ci-widget-content' do
expect(page).to have_content("Pipeline ##{pipeline.id} pending " \ expect(page).to have_content("Pipeline ##{pipeline.id} (##{pipeline.iid}) pending " \
"for #{pipeline.short_sha} " \ "for #{pipeline.short_sha} " \
"on #{merge_request.to_reference} " \ "on #{merge_request.to_reference} " \
"with #{merge_request.source_branch}") "with #{merge_request.source_branch}")
...@@ -234,7 +234,7 @@ describe 'Merge request > User sees merge widget', :js do ...@@ -234,7 +234,7 @@ describe 'Merge request > User sees merge widget', :js do
it 'shows head pipeline information' do it 'shows head pipeline information' do
within '.ci-widget-content' do within '.ci-widget-content' do
expect(page).to have_content("Pipeline ##{pipeline.id} pending " \ expect(page).to have_content("Pipeline ##{pipeline.id} (##{pipeline.iid}) pending " \
"for #{pipeline.short_sha} " \ "for #{pipeline.short_sha} " \
"on #{merge_request.to_reference} " \ "on #{merge_request.to_reference} " \
"with #{merge_request.source_branch} " \ "with #{merge_request.source_branch} " \
...@@ -248,7 +248,7 @@ describe 'Merge request > User sees merge widget', :js do ...@@ -248,7 +248,7 @@ describe 'Merge request > User sees merge widget', :js do
it 'shows head pipeline information' do it 'shows head pipeline information' do
within '.ci-widget-content' do within '.ci-widget-content' do
expect(page).to have_content("Pipeline ##{pipeline.id} pending " \ expect(page).to have_content("Pipeline ##{pipeline.id} (##{pipeline.iid}) pending " \
"for #{pipeline.short_sha} " \ "for #{pipeline.short_sha} " \
"on #{merge_request.to_reference} " \ "on #{merge_request.to_reference} " \
"with #{merge_request.source_branch} " \ "with #{merge_request.source_branch} " \
......
...@@ -61,7 +61,7 @@ describe 'User browses commits' do ...@@ -61,7 +61,7 @@ describe 'User browses commits' do
it 'renders commit ci info' do it 'renders commit ci info' do
visit project_commit_path(project, sample_commit.id) visit project_commit_path(project, sample_commit.id)
expect(page).to have_content "Pipeline ##{pipeline.id} pending" expect(page).to have_content "Pipeline ##{pipeline.id} (##{pipeline.iid}) pending"
end end
end end
......
...@@ -16,6 +16,12 @@ describe 'User browses jobs' do ...@@ -16,6 +16,12 @@ describe 'User browses jobs' do
visit(project_jobs_path(project)) visit(project_jobs_path(project))
end end
it 'shows pipeline id and IID' do
page.within('td.pipeline-link') do
expect(page).to have_content("##{pipeline.id} (##{pipeline.iid})")
end
end
it 'shows the coverage' do it 'shows the coverage' do
page.within('td.coverage') do page.within('td.coverage') do
expect(page).to have_content('99.9%') expect(page).to have_content('99.9%')
......
...@@ -129,7 +129,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do ...@@ -129,7 +129,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
visit project_job_path(project, job) visit project_job_path(project, job)
within '.js-pipeline-info' do within '.js-pipeline-info' do
expect(page).to have_content("Pipeline ##{pipeline.id} for #{pipeline.ref}") expect(page).to have_content("Pipeline ##{pipeline.id} (##{pipeline.iid}) for #{pipeline.ref}")
end end
end end
......
...@@ -9,6 +9,7 @@ describe('Stages Dropdown', () => { ...@@ -9,6 +9,7 @@ describe('Stages Dropdown', () => {
const mockPipelineData = { const mockPipelineData = {
id: 28029444, id: 28029444,
iid: 123,
details: { details: {
status: { status: {
details_path: '/gitlab-org/gitlab-ce/pipelines/28029444', details_path: '/gitlab-org/gitlab-ce/pipelines/28029444',
...@@ -77,8 +78,8 @@ describe('Stages Dropdown', () => { ...@@ -77,8 +78,8 @@ describe('Stages Dropdown', () => {
expect(vm.$el.querySelector('.dropdown .js-selected-stage').textContent).toContain('deploy'); expect(vm.$el.querySelector('.dropdown .js-selected-stage').textContent).toContain('deploy');
}); });
it(`renders the pipeline info text like "Pipeline #123 for source_branch"`, () => { it(`renders the pipeline info text like "Pipeline #123 (#12) for source_branch"`, () => {
const expected = `Pipeline #${pipeline.id} for ${pipeline.ref.name}`; const expected = `Pipeline #${pipeline.id} (#${pipeline.iid}) for ${pipeline.ref.name}`;
const actual = trimText(vm.$el.querySelector('.js-pipeline-info').innerText); const actual = trimText(vm.$el.querySelector('.js-pipeline-info').innerText);
expect(actual).toBe(expected); expect(actual).toBe(expected);
...@@ -100,10 +101,10 @@ describe('Stages Dropdown', () => { ...@@ -100,10 +101,10 @@ describe('Stages Dropdown', () => {
}); });
}); });
it(`renders the pipeline info text like "Pipeline #123 for !456 with source_branch into target_branch"`, () => { it(`renders the pipeline info text like "Pipeline #123 (#12) for !456 with source_branch into target_branch"`, () => {
const expected = `Pipeline #${pipeline.id} for !${pipeline.merge_request.iid} with ${ const expected = `Pipeline #${pipeline.id} (#${pipeline.iid}) for !${
pipeline.merge_request.source_branch pipeline.merge_request.iid
} into ${pipeline.merge_request.target_branch}`; } with ${pipeline.merge_request.source_branch} into ${pipeline.merge_request.target_branch}`;
const actual = trimText(vm.$el.querySelector('.js-pipeline-info').innerText); const actual = trimText(vm.$el.querySelector('.js-pipeline-info').innerText);
expect(actual).toBe(expected); expect(actual).toBe(expected);
...@@ -143,10 +144,10 @@ describe('Stages Dropdown', () => { ...@@ -143,10 +144,10 @@ describe('Stages Dropdown', () => {
}); });
}); });
it(`renders the pipeline info like "Pipeline #123 for !456 with source_branch"`, () => { it(`renders the pipeline info like "Pipeline #123 (#12) for !456 with source_branch"`, () => {
const expected = `Pipeline #${pipeline.id} for !${pipeline.merge_request.iid} with ${ const expected = `Pipeline #${pipeline.id} (#${pipeline.iid}) for !${
pipeline.merge_request.source_branch pipeline.merge_request.iid
}`; } with ${pipeline.merge_request.source_branch}`;
const actual = trimText(vm.$el.querySelector('.js-pipeline-info').innerText); const actual = trimText(vm.$el.querySelector('.js-pipeline-info').innerText);
expect(actual).toBe(expected); expect(actual).toBe(expected);
......
...@@ -960,6 +960,7 @@ export default { ...@@ -960,6 +960,7 @@ export default {
}, },
pipeline: { pipeline: {
id: 140, id: 140,
iid: 13,
user: { user: {
name: 'Root', name: 'Root',
username: 'root', username: 'root',
......
export const pipelineWithStages = { export const pipelineWithStages = {
id: 20333396, id: 20333396,
iid: 304399,
user: { user: {
id: 128633, id: 128633,
name: 'Rémy Coutable', name: 'Rémy Coutable',
......
...@@ -13,6 +13,7 @@ describe('Pipeline Url Component', () => { ...@@ -13,6 +13,7 @@ describe('Pipeline Url Component', () => {
propsData: { propsData: {
pipeline: { pipeline: {
id: 1, id: 1,
iid: 1,
path: 'foo', path: 'foo',
flags: {}, flags: {},
}, },
...@@ -28,6 +29,7 @@ describe('Pipeline Url Component', () => { ...@@ -28,6 +29,7 @@ describe('Pipeline Url Component', () => {
propsData: { propsData: {
pipeline: { pipeline: {
id: 1, id: 1,
iid: 1,
path: 'foo', path: 'foo',
flags: {}, flags: {},
}, },
...@@ -47,6 +49,7 @@ describe('Pipeline Url Component', () => { ...@@ -47,6 +49,7 @@ describe('Pipeline Url Component', () => {
propsData: { propsData: {
pipeline: { pipeline: {
id: 1, id: 1,
iid: 1,
path: 'foo', path: 'foo',
flags: { flags: {
latest: true, latest: true,
...@@ -78,6 +81,7 @@ describe('Pipeline Url Component', () => { ...@@ -78,6 +81,7 @@ describe('Pipeline Url Component', () => {
propsData: { propsData: {
pipeline: { pipeline: {
id: 1, id: 1,
iid: 1,
path: 'foo', path: 'foo',
flags: { flags: {
latest: true, latest: true,
...@@ -100,6 +104,7 @@ describe('Pipeline Url Component', () => { ...@@ -100,6 +104,7 @@ describe('Pipeline Url Component', () => {
propsData: { propsData: {
pipeline: { pipeline: {
id: 1, id: 1,
iid: 1,
path: 'foo', path: 'foo',
flags: { flags: {
failure_reason: true, failure_reason: true,
......
...@@ -103,7 +103,7 @@ describe('MRWidgetPipeline', () => { ...@@ -103,7 +103,7 @@ describe('MRWidgetPipeline', () => {
it('should render pipeline ID', () => { it('should render pipeline ID', () => {
expect(vm.$el.querySelector('.pipeline-id').textContent.trim()).toEqual( expect(vm.$el.querySelector('.pipeline-id').textContent.trim()).toEqual(
`#${mockData.pipeline.id}`, `#${mockData.pipeline.id} (#${mockData.pipeline.iid})`,
); );
}); });
...@@ -150,7 +150,7 @@ describe('MRWidgetPipeline', () => { ...@@ -150,7 +150,7 @@ describe('MRWidgetPipeline', () => {
it('should render pipeline ID', () => { it('should render pipeline ID', () => {
expect(vm.$el.querySelector('.pipeline-id').textContent.trim()).toEqual( expect(vm.$el.querySelector('.pipeline-id').textContent.trim()).toEqual(
`#${mockData.pipeline.id}`, `#${mockData.pipeline.id} (#${mockData.pipeline.iid})`,
); );
}); });
...@@ -222,9 +222,9 @@ describe('MRWidgetPipeline', () => { ...@@ -222,9 +222,9 @@ describe('MRWidgetPipeline', () => {
sourceBranchLink: mockCopy.source_branch_link, sourceBranchLink: mockCopy.source_branch_link,
}); });
const expected = `Pipeline #${pipeline.id} ${pipeline.details.status.label} for ${ const expected = `Pipeline #${pipeline.id} (#${pipeline.iid}) ${
pipeline.commit.short_id pipeline.details.status.label
} on ${mockCopy.source_branch_link}`; } for ${pipeline.commit.short_id} on ${mockCopy.source_branch_link}`;
const actual = trimText(vm.$el.querySelector('.js-pipeline-info-container').innerText); const actual = trimText(vm.$el.querySelector('.js-pipeline-info-container').innerText);
...@@ -247,11 +247,11 @@ describe('MRWidgetPipeline', () => { ...@@ -247,11 +247,11 @@ describe('MRWidgetPipeline', () => {
sourceBranchLink: mockCopy.source_branch_link, sourceBranchLink: mockCopy.source_branch_link,
}); });
const expected = `Pipeline #${pipeline.id} ${pipeline.details.status.label} for ${ const expected = `Pipeline #${pipeline.id} (#${pipeline.iid}) ${
pipeline.commit.short_id pipeline.details.status.label
} on !${pipeline.merge_request.iid} with ${pipeline.merge_request.source_branch} into ${ } for ${pipeline.commit.short_id} on !${pipeline.merge_request.iid} with ${
pipeline.merge_request.target_branch pipeline.merge_request.source_branch
}`; } into ${pipeline.merge_request.target_branch}`;
const actual = trimText(vm.$el.querySelector('.js-pipeline-info-container').innerText); const actual = trimText(vm.$el.querySelector('.js-pipeline-info-container').innerText);
...@@ -274,9 +274,11 @@ describe('MRWidgetPipeline', () => { ...@@ -274,9 +274,11 @@ describe('MRWidgetPipeline', () => {
sourceBranchLink: mockCopy.source_branch_link, sourceBranchLink: mockCopy.source_branch_link,
}); });
const expected = `Pipeline #${pipeline.id} ${pipeline.details.status.label} for ${ const expected = `Pipeline #${pipeline.id} (#${pipeline.iid}) ${
pipeline.commit.short_id pipeline.details.status.label
} on !${pipeline.merge_request.iid} with ${pipeline.merge_request.source_branch}`; } for ${pipeline.commit.short_id} on !${pipeline.merge_request.iid} with ${
pipeline.merge_request.source_branch
}`;
const actual = trimText(vm.$el.querySelector('.js-pipeline-info-container').innerText); const actual = trimText(vm.$el.querySelector('.js-pipeline-info-container').innerText);
......
...@@ -62,6 +62,7 @@ export default { ...@@ -62,6 +62,7 @@ export default {
"Merge branch 'daaaa' into 'master'\n\nUpdate README.md\n\nSee merge request !22", "Merge branch 'daaaa' into 'master'\n\nUpdate README.md\n\nSee merge request !22",
pipeline: { pipeline: {
id: 172, id: 172,
iid: 32,
user: { user: {
name: 'Administrator', name: 'Administrator',
username: 'root', username: 'root',
...@@ -241,6 +242,8 @@ export default { ...@@ -241,6 +242,8 @@ export default {
export const mockStore = { export const mockStore = {
pipeline: { pipeline: {
id: 0, id: 0,
iid: 0,
path: '/root/acets-app/pipelines/0',
details: { details: {
status: { status: {
details_path: '/root/review-app-tester/pipelines/66', details_path: '/root/review-app-tester/pipelines/66',
...@@ -258,6 +261,8 @@ export const mockStore = { ...@@ -258,6 +261,8 @@ export const mockStore = {
}, },
mergePipeline: { mergePipeline: {
id: 1, id: 1,
iid: 1,
path: '/root/acets-app/pipelines/0',
details: { details: {
status: { status: {
details_path: '/root/review-app-tester/pipelines/66', details_path: '/root/review-app-tester/pipelines/66',
......
...@@ -600,6 +600,7 @@ describe('mrWidgetOptions', () => { ...@@ -600,6 +600,7 @@ describe('mrWidgetOptions', () => {
]; ];
const deploymentMockData = { const deploymentMockData = {
id: 15, id: 15,
iid: 7,
name: 'review/diplo', name: 'review/diplo',
url: '/root/acets-review-apps/environments/15', url: '/root/acets-review-apps/environments/15',
stop_url: '/root/acets-review-apps/environments/15/stop', stop_url: '/root/acets-review-apps/environments/15/stop',
...@@ -646,6 +647,7 @@ describe('mrWidgetOptions', () => { ...@@ -646,6 +647,7 @@ describe('mrWidgetOptions', () => {
vm.mr.state = 'merged'; vm.mr.state = 'merged';
vm.mr.mergePipeline = { vm.mr.mergePipeline = {
id: 127, id: 127,
iid: 35,
user: { user: {
id: 1, id: 1,
name: 'Administrator', name: 'Administrator',
......
...@@ -27,7 +27,7 @@ describe 'projects/commit/_commit_box.html.haml' do ...@@ -27,7 +27,7 @@ describe 'projects/commit/_commit_box.html.haml' do
render render
expect(rendered).to have_text("Pipeline ##{third_pipeline.id} failed") expect(rendered).to have_text("Pipeline ##{third_pipeline.id} (##{third_pipeline.iid}) failed")
end end
end end
...@@ -40,7 +40,7 @@ describe 'projects/commit/_commit_box.html.haml' do ...@@ -40,7 +40,7 @@ describe 'projects/commit/_commit_box.html.haml' do
it 'shows correct pipeline description' do it 'shows correct pipeline description' do
render render
expect(rendered).to have_text "Pipeline ##{pipeline.id} " \ expect(rendered).to have_text "Pipeline ##{pipeline.id} (##{pipeline.iid}) " \
'waiting for manual action' 'waiting for manual action'
end end
end end
......
...@@ -4,7 +4,7 @@ describe 'projects/ci/jobs/_build' do ...@@ -4,7 +4,7 @@ describe 'projects/ci/jobs/_build' do
include Devise::Test::ControllerHelpers include Devise::Test::ControllerHelpers
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:pipeline) { create(:ci_empty_pipeline, id: 1337, project: project, sha: project.commit.id) } let(:pipeline) { create(:ci_empty_pipeline, id: 1337, iid: 57, project: project, sha: project.commit.id) }
let(:build) { create(:ci_build, pipeline: pipeline, stage: 'test', stage_idx: 1, name: 'rspec 0:2', status: :pending) } let(:build) { create(:ci_build, pipeline: pipeline, stage: 'test', stage_idx: 1, name: 'rspec 0:2', status: :pending) }
before do before do
...@@ -15,14 +15,14 @@ describe 'projects/ci/jobs/_build' do ...@@ -15,14 +15,14 @@ describe 'projects/ci/jobs/_build' do
it 'won\'t include a column with a link to its pipeline by default' do it 'won\'t include a column with a link to its pipeline by default' do
render partial: 'projects/ci/builds/build', locals: { build: build } render partial: 'projects/ci/builds/build', locals: { build: build }
expect(rendered).not_to have_link('#1337') expect(rendered).not_to have_link('#1337 (#57)')
expect(rendered).not_to have_text('#1337 by API') expect(rendered).not_to have_text('#1337 (#57) by API')
end end
it 'can include a column with a link to its pipeline' do it 'can include a column with a link to its pipeline' do
render partial: 'projects/ci/builds/build', locals: { build: build, pipeline_link: true } render partial: 'projects/ci/builds/build', locals: { build: build, pipeline_link: true }
expect(rendered).to have_link('#1337') expect(rendered).to have_link('#1337 (#57)')
expect(rendered).to have_text('#1337 by API') expect(rendered).to have_text('#1337 (#57) by API')
end 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