Commit add17d54 authored by Miguel Rincon's avatar Miguel Rincon

Merge branch 'jivanvl-remove-rearrange-pipelines-table-ff' into 'master'

Remove rearrange_pipeline_table feature flag

See merge request gitlab-org/gitlab!81924
parents 8e3158e8 6ace75f5
<script> <script>
import { GlIcon, GlLink, GlPopover, GlSprintf, GlTooltipDirective, GlBadge } from '@gitlab/ui'; import { GlIcon, GlLink, GlPopover, GlSprintf, GlTooltipDirective, GlBadge } from '@gitlab/ui';
import { __, sprintf } from '~/locale'; import { __ } from '~/locale';
import { helpPagePath } from '~/helpers/help_page_helper'; import { helpPagePath } from '~/helpers/help_page_helper';
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate/tooltip_on_truncate.vue'; import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate/tooltip_on_truncate.vue';
import { SCHEDULE_ORIGIN, ICONS } from '../../constants'; import { SCHEDULE_ORIGIN, ICONS } from '../../constants';
...@@ -18,7 +17,6 @@ export default { ...@@ -18,7 +17,6 @@ export default {
directives: { directives: {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
}, },
mixins: [glFeatureFlagMixin()],
inject: { inject: {
targetProjectFullPath: { targetProjectFullPath: {
default: '', default: '',
...@@ -139,28 +137,14 @@ export default { ...@@ -139,28 +137,14 @@ export default {
commitTitle() { commitTitle() {
return this.pipeline?.commit?.title; return this.pipeline?.commit?.title;
}, },
hasAuthor() {
return (
this.commitAuthor?.avatar_url && this.commitAuthor?.path && this.commitAuthor?.username
);
},
userImageAltDescription() {
return this.commitAuthor?.username
? sprintf(__("%{username}'s avatar"), { username: this.commitAuthor.username })
: null;
},
rearrangePipelinesTable() {
return this.glFeatures?.rearrangePipelinesTable;
},
}, },
}; };
</script> </script>
<template> <template>
<div class="pipeline-tags" data-testid="pipeline-url-table-cell"> <div class="pipeline-tags" data-testid="pipeline-url-table-cell">
<template v-if="rearrangePipelinesTable">
<div class="commit-title gl-mb-2" data-testid="commit-title-container"> <div class="commit-title gl-mb-2" data-testid="commit-title-container">
<span v-if="commitTitle" class="gl-display-flex"> <span v-if="commitTitle" class="gl-display-flex">
<tooltip-on-truncate :title="commitTitle" class="flex-truncate-child gl-flex-grow-1"> <tooltip-on-truncate :title="commitTitle" class="gl-flex-grow-1 gl-text-truncate">
<gl-link <gl-link
:href="commitUrl" :href="commitUrl"
class="commit-row-message gl-text-gray-900" class="commit-row-message gl-text-gray-900"
...@@ -214,16 +198,6 @@ export default { ...@@ -214,16 +198,6 @@ export default {
}}</gl-link> }}</gl-link>
<!--End of commit row--> <!--End of commit row-->
</div> </div>
</template>
<gl-link
v-if="!rearrangePipelinesTable"
:href="pipeline.path"
class="gl-text-decoration-underline"
data-testid="pipeline-url-link"
data-qa-selector="pipeline_url_link"
>
#{{ pipeline[pipelineKey] }}
</gl-link>
<div class="label-container gl-mt-1"> <div class="label-container gl-mt-1">
<gl-badge <gl-badge
v-if="isScheduled" v-if="isScheduled"
......
<script>
import { CHILD_VIEW } from '~/pipelines/constants';
import CommitComponent from '~/vue_shared/components/commit.vue';
export default {
components: {
CommitComponent,
},
props: {
pipeline: {
type: Object,
required: true,
},
viewType: {
type: String,
required: true,
},
},
computed: {
commitAuthor() {
let commitAuthorInformation;
if (!this.pipeline || !this.pipeline.commit) {
return null;
}
// 1. person who is an author of a commit might be a GitLab user
if (this.pipeline.commit.author) {
// 2. if person who is an author of a commit is a GitLab user
// they can have a GitLab avatar
if (this.pipeline.commit.author.avatar_url) {
commitAuthorInformation = this.pipeline.commit.author;
// 3. If GitLab user does not have avatar, they might have a Gravatar
} else if (this.pipeline.commit.author_gravatar_url) {
commitAuthorInformation = {
...this.pipeline.commit.author,
avatar_url: this.pipeline.commit.author_gravatar_url,
};
}
// 4. If committer is not a GitLab User, they can have a Gravatar
} else {
commitAuthorInformation = {
avatar_url: this.pipeline.commit.author_gravatar_url,
path: `mailto:${this.pipeline.commit.author_email}`,
username: this.pipeline.commit.author_name,
};
}
return commitAuthorInformation;
},
commitTag() {
return this.pipeline?.ref?.tag;
},
commitRef() {
return this.pipeline?.ref;
},
commitUrl() {
return this.pipeline?.commit?.commit_path;
},
commitShortSha() {
return this.pipeline?.commit?.short_id;
},
commitTitle() {
return this.pipeline?.commit?.title;
},
isChildView() {
return this.viewType === CHILD_VIEW;
},
},
};
</script>
<template>
<commit-component
:tag="commitTag"
:commit-ref="commitRef"
:commit-url="commitUrl"
:merge-request-ref="pipeline.merge_request"
:short-sha="commitShortSha"
:title="commitTitle"
:author="commitAuthor"
:show-ref-info="!isChildView"
/>
</template>
...@@ -3,7 +3,6 @@ import CodeQualityWalkthrough from '~/code_quality_walkthrough/components/step.v ...@@ -3,7 +3,6 @@ import CodeQualityWalkthrough from '~/code_quality_walkthrough/components/step.v
import { PIPELINE_STATUSES } from '~/code_quality_walkthrough/constants'; import { PIPELINE_STATUSES } from '~/code_quality_walkthrough/constants';
import { CHILD_VIEW } from '~/pipelines/constants'; import { CHILD_VIEW } from '~/pipelines/constants';
import CiBadge from '~/vue_shared/components/ci_badge_link.vue'; import CiBadge from '~/vue_shared/components/ci_badge_link.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import PipelinesTimeago from './time_ago.vue'; import PipelinesTimeago from './time_ago.vue';
export default { export default {
...@@ -12,7 +11,6 @@ export default { ...@@ -12,7 +11,6 @@ export default {
CiBadge, CiBadge,
PipelinesTimeago, PipelinesTimeago,
}, },
mixins: [glFeatureFlagsMixin()],
props: { props: {
pipeline: { pipeline: {
type: Object, type: Object,
...@@ -44,9 +42,6 @@ export default { ...@@ -44,9 +42,6 @@ export default {
codeQualityBuildPath() { codeQualityBuildPath() {
return this.pipeline?.details?.code_quality_build_path; return this.pipeline?.details?.code_quality_build_path;
}, },
rearrangePipelinesTable() {
return this.glFeatures?.rearrangePipelinesTable;
},
}, },
}; };
</script> </script>
...@@ -61,7 +56,7 @@ export default { ...@@ -61,7 +56,7 @@ export default {
:icon-classes="'gl-vertical-align-middle!'" :icon-classes="'gl-vertical-align-middle!'"
data-qa-selector="pipeline_commit_status" data-qa-selector="pipeline_commit_status"
/> />
<pipelines-timeago v-if="rearrangePipelinesTable" class="gl-mt-3" :pipeline="pipeline" /> <pipelines-timeago class="gl-mt-3" :pipeline="pipeline" />
<code-quality-walkthrough <code-quality-walkthrough
v-if="shouldRenderCodeQualityWalkthrough" v-if="shouldRenderCodeQualityWalkthrough"
:step="codeQualityStep" :step="codeQualityStep"
......
<script> <script>
import { GlTableLite, GlTooltipDirective } from '@gitlab/ui'; import { GlTableLite, GlTooltipDirective } from '@gitlab/ui';
import { s__, __ } from '~/locale'; import { s__, __ } from '~/locale';
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import eventHub from '../../event_hub'; import eventHub from '../../event_hub';
import PipelineMiniGraph from './pipeline_mini_graph.vue'; import PipelineMiniGraph from './pipeline_mini_graph.vue';
import PipelineOperations from './pipeline_operations.vue'; import PipelineOperations from './pipeline_operations.vue';
import PipelineStopModal from './pipeline_stop_modal.vue'; import PipelineStopModal from './pipeline_stop_modal.vue';
import PipelineTriggerer from './pipeline_triggerer.vue'; import PipelineTriggerer from './pipeline_triggerer.vue';
import PipelineUrl from './pipeline_url.vue'; import PipelineUrl from './pipeline_url.vue';
import PipelinesCommit from './pipelines_commit.vue';
import PipelinesStatusBadge from './pipelines_status_badge.vue'; import PipelinesStatusBadge from './pipelines_status_badge.vue';
import PipelinesTimeago from './time_ago.vue';
const DEFAULT_TD_CLASS = 'gl-p-5!'; const DEFAULT_TD_CLASS = 'gl-p-5!';
const HIDE_TD_ON_MOBILE = 'gl-display-none! gl-lg-display-table-cell!'; const HIDE_TD_ON_MOBILE = 'gl-display-none! gl-lg-display-table-cell!';
...@@ -22,19 +19,16 @@ export default { ...@@ -22,19 +19,16 @@ export default {
GlTableLite, GlTableLite,
LinkedPipelinesMiniList: () => LinkedPipelinesMiniList: () =>
import('ee_component/vue_shared/components/linked_pipelines_mini_list.vue'), import('ee_component/vue_shared/components/linked_pipelines_mini_list.vue'),
PipelinesCommit,
PipelineMiniGraph, PipelineMiniGraph,
PipelineOperations, PipelineOperations,
PipelinesStatusBadge, PipelinesStatusBadge,
PipelineStopModal, PipelineStopModal,
PipelinesTimeago,
PipelineTriggerer, PipelineTriggerer,
PipelineUrl, PipelineUrl,
}, },
directives: { directives: {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
}, },
mixins: [glFeatureFlagMixin()],
props: { props: {
pipelines: { pipelines: {
type: Array, type: Array,
...@@ -74,18 +68,16 @@ export default { ...@@ -74,18 +68,16 @@ export default {
key: 'status', key: 'status',
label: s__('Pipeline|Status'), label: s__('Pipeline|Status'),
thClass: DEFAULT_TH_CLASSES, thClass: DEFAULT_TH_CLASSES,
columnClass: this.rearrangePipelinesTable ? 'gl-w-15p' : 'gl-w-10p', columnClass: 'gl-w-15p',
tdClass: DEFAULT_TD_CLASS, tdClass: DEFAULT_TD_CLASS,
thAttr: { 'data-testid': 'status-th' }, thAttr: { 'data-testid': 'status-th' },
}, },
{ {
key: 'pipeline', key: 'pipeline',
label: this.rearrangePipelinesTable ? __('Pipeline') : this.pipelineKeyOption.label, label: __('Pipeline'),
thClass: DEFAULT_TH_CLASSES, thClass: DEFAULT_TH_CLASSES,
tdClass: this.rearrangePipelinesTable tdClass: `${DEFAULT_TD_CLASS}`,
? `${DEFAULT_TD_CLASS}` columnClass: 'gl-w-30p',
: `${DEFAULT_TD_CLASS} ${HIDE_TD_ON_MOBILE}`,
columnClass: this.rearrangePipelinesTable ? 'gl-w-30p' : 'gl-w-10p',
thAttr: { 'data-testid': 'pipeline-th' }, thAttr: { 'data-testid': 'pipeline-th' },
}, },
{ {
...@@ -96,14 +88,6 @@ export default { ...@@ -96,14 +88,6 @@ export default {
columnClass: 'gl-w-10p', columnClass: 'gl-w-10p',
thAttr: { 'data-testid': 'triggerer-th' }, thAttr: { 'data-testid': 'triggerer-th' },
}, },
{
key: 'commit',
label: s__('Pipeline|Commit'),
thClass: DEFAULT_TH_CLASSES,
tdClass: DEFAULT_TD_CLASS,
columnClass: 'gl-w-20p',
thAttr: { 'data-testid': 'commit-th' },
},
{ {
key: 'stages', key: 'stages',
label: s__('Pipeline|Stages'), label: s__('Pipeline|Stages'),
...@@ -112,14 +96,6 @@ export default { ...@@ -112,14 +96,6 @@ export default {
columnClass: 'gl-w-quarter', columnClass: 'gl-w-quarter',
thAttr: { 'data-testid': 'stages-th' }, thAttr: { 'data-testid': 'stages-th' },
}, },
{
key: 'timeago',
label: s__('Pipeline|Duration'),
thClass: DEFAULT_TH_CLASSES,
tdClass: DEFAULT_TD_CLASS,
columnClass: this.rearrangePipelinesTable ? 'gl-w-5p' : 'gl-w-15p',
thAttr: { 'data-testid': 'timeago-th' },
},
{ {
key: 'actions', key: 'actions',
thClass: DEFAULT_TH_CLASSES, thClass: DEFAULT_TH_CLASSES,
...@@ -129,12 +105,7 @@ export default { ...@@ -129,12 +105,7 @@ export default {
}, },
]; ];
return !this.rearrangePipelinesTable return fields;
? fields
: fields.filter((field) => !['commit', 'timeago'].includes(field.key));
},
rearrangePipelinesTable() {
return this.glFeatures?.rearrangePipelinesTable;
}, },
}, },
watch: { watch: {
...@@ -200,10 +171,6 @@ export default { ...@@ -200,10 +171,6 @@ export default {
<pipeline-triggerer :pipeline="item" /> <pipeline-triggerer :pipeline="item" />
</template> </template>
<template #cell(commit)="{ item }">
<pipelines-commit :pipeline="item" :view-type="viewType" />
</template>
<template #cell(stages)="{ item }"> <template #cell(stages)="{ item }">
<div class="stage-cell"> <div class="stage-cell">
<!-- This empty div should be removed, see https://gitlab.com/gitlab-org/gitlab/-/issues/323488 --> <!-- This empty div should be removed, see https://gitlab.com/gitlab-org/gitlab/-/issues/323488 -->
...@@ -229,10 +196,6 @@ export default { ...@@ -229,10 +196,6 @@ export default {
</div> </div>
</template> </template>
<template #cell(timeago)="{ item }">
<pipelines-timeago :pipeline="item" />
</template>
<template #cell(actions)="{ item }"> <template #cell(actions)="{ item }">
<pipeline-operations :pipeline="item" :canceling-pipeline="cancelingPipeline" /> <pipeline-operations :pipeline="item" :canceling-pipeline="cancelingPipeline" />
</template> </template>
......
<script> <script>
import { GlIcon, GlTooltipDirective } from '@gitlab/ui'; import { GlIcon, GlTooltipDirective } from '@gitlab/ui';
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import timeagoMixin from '~/vue_shared/mixins/timeago'; import timeagoMixin from '~/vue_shared/mixins/timeago';
export default { export default {
...@@ -8,7 +7,7 @@ export default { ...@@ -8,7 +7,7 @@ export default {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
}, },
components: { GlIcon }, components: { GlIcon },
mixins: [timeagoMixin, glFeatureFlagMixin()], mixins: [timeagoMixin],
props: { props: {
pipeline: { pipeline: {
type: Object, type: Object,
...@@ -54,14 +53,11 @@ export default { ...@@ -54,14 +53,11 @@ export default {
showSkipped() { showSkipped() {
return !this.duration && !this.finishedTime && this.skipped; return !this.duration && !this.finishedTime && this.skipped;
}, },
shouldDisplayAsBlock() {
return this.glFeatures?.rearrangePipelinesTable;
},
}, },
}; };
</script> </script>
<template> <template>
<div class="{ 'gl-display-block': shouldDisplayAsBlock }"> <div class="gl-display-block">
<span v-if="showInProgress" data-testid="pipeline-in-progress"> <span v-if="showInProgress" data-testid="pipeline-in-progress">
<gl-icon v-if="stuck" name="warning" class="gl-mr-2" :size="12" data-testid="warning-icon" /> <gl-icon v-if="stuck" name="warning" class="gl-mr-2" :size="12" data-testid="warning-icon" />
<gl-icon <gl-icon
......
...@@ -45,7 +45,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo ...@@ -45,7 +45,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
push_frontend_feature_flag(:restructured_mr_widget, project, default_enabled: :yaml) push_frontend_feature_flag(:restructured_mr_widget, project, default_enabled: :yaml)
push_frontend_feature_flag(:refactor_mr_widgets_extensions, project, default_enabled: :yaml) push_frontend_feature_flag(:refactor_mr_widgets_extensions, project, default_enabled: :yaml)
push_frontend_feature_flag(:rebase_without_ci_ui, project, default_enabled: :yaml) push_frontend_feature_flag(:rebase_without_ci_ui, project, default_enabled: :yaml)
push_frontend_feature_flag(:rearrange_pipelines_table, project, default_enabled: :yaml)
push_frontend_feature_flag(:markdown_continue_lists, project, default_enabled: :yaml) push_frontend_feature_flag(:markdown_continue_lists, project, default_enabled: :yaml)
# Usage data feature flags # Usage data feature flags
push_frontend_feature_flag(:users_expanding_widgets_usage_data, project, default_enabled: :yaml) push_frontend_feature_flag(:users_expanding_widgets_usage_data, project, default_enabled: :yaml)
......
...@@ -16,9 +16,6 @@ class Projects::PipelinesController < Projects::ApplicationController ...@@ -16,9 +16,6 @@ class Projects::PipelinesController < Projects::ApplicationController
before_action :authorize_create_pipeline!, only: [:new, :create, :config_variables] before_action :authorize_create_pipeline!, only: [:new, :create, :config_variables]
before_action :authorize_update_pipeline!, only: [:retry, :cancel] before_action :authorize_update_pipeline!, only: [:retry, :cancel]
before_action :ensure_pipeline, only: [:show, :downloadable_artifacts] before_action :ensure_pipeline, only: [:show, :downloadable_artifacts]
before_action do
push_frontend_feature_flag(:rearrange_pipelines_table, project, default_enabled: :yaml)
end
# Will be removed with https://gitlab.com/gitlab-org/gitlab/-/issues/225596 # Will be removed with https://gitlab.com/gitlab-org/gitlab/-/issues/225596
before_action :redirect_for_legacy_scope_filter, only: [:index], if: -> { request.format.html? } before_action :redirect_for_legacy_scope_filter, only: [:index], if: -> { request.format.html? }
......
---
name: rearrange_pipelines_table
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/72545
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/343286
milestone: '14.8'
type: development
group: group::pipeline execution
default_enabled: true
...@@ -27179,9 +27179,6 @@ msgstr "" ...@@ -27179,9 +27179,6 @@ msgstr ""
msgid "Pipeline|Checking pipeline status." msgid "Pipeline|Checking pipeline status."
msgstr "" msgstr ""
msgid "Pipeline|Commit"
msgstr ""
msgid "Pipeline|Could not retrieve the pipeline status. For troubleshooting steps, read the %{linkStart}documentation%{linkEnd}." msgid "Pipeline|Could not retrieve the pipeline status. For troubleshooting steps, read the %{linkStart}documentation%{linkEnd}."
msgstr "" msgstr ""
...@@ -27197,9 +27194,6 @@ msgstr "" ...@@ -27197,9 +27194,6 @@ msgstr ""
msgid "Pipeline|Detached merge request pipeline" msgid "Pipeline|Detached merge request pipeline"
msgstr "" msgstr ""
msgid "Pipeline|Duration"
msgstr ""
msgid "Pipeline|Failed" msgid "Pipeline|Failed"
msgstr "" msgstr ""
......
...@@ -125,7 +125,6 @@ RSpec.describe 'Merge request > User sees pipelines', :js do ...@@ -125,7 +125,6 @@ RSpec.describe 'Merge request > User sees pipelines', :js do
before do before do
stub_feature_flags(ci_disallow_to_create_merge_request_pipelines_in_target_project: false) stub_feature_flags(ci_disallow_to_create_merge_request_pipelines_in_target_project: false)
stub_feature_flags(rearrange_pipelines_table: false)
end end
it 'creates a pipeline in the parent project when user proceeds with the warning' do it 'creates a pipeline in the parent project when user proceeds with the warning' do
......
...@@ -161,7 +161,7 @@ RSpec.describe 'Pipelines', :js do ...@@ -161,7 +161,7 @@ RSpec.describe 'Pipelines', :js do
end end
end end
context 'when pipeline is detached merge request pipeline, with rearrange_pipelines_table feature flag turned off' do context 'when pipeline is detached merge request pipeline' do
let(:merge_request) do let(:merge_request) do
create(:merge_request, create(:merge_request,
:with_detached_merge_request_pipeline, :with_detached_merge_request_pipeline,
...@@ -174,8 +174,6 @@ RSpec.describe 'Pipelines', :js do ...@@ -174,8 +174,6 @@ RSpec.describe 'Pipelines', :js do
let(:target_project) { project } let(:target_project) { project }
before do before do
stub_feature_flags(rearrange_pipelines_table: false)
visit project_pipelines_path(source_project) visit project_pipelines_path(source_project)
end end
...@@ -183,14 +181,10 @@ RSpec.describe 'Pipelines', :js do ...@@ -183,14 +181,10 @@ RSpec.describe 'Pipelines', :js do
it 'shows pipeline information without pipeline ref', :sidekiq_might_not_need_inline do it 'shows pipeline information without pipeline ref', :sidekiq_might_not_need_inline do
within '.pipeline-tags' do within '.pipeline-tags' do
expect(page).to have_content(expected_detached_mr_tag) expect(page).to have_content(expected_detached_mr_tag)
end
within '.branch-commit' do
expect(page).to have_link(merge_request.iid, expect(page).to have_link(merge_request.iid,
href: project_merge_request_path(project, merge_request)) href: project_merge_request_path(project, merge_request))
end
within '.branch-commit' do
expect(page).not_to have_link(pipeline.ref) expect(page).not_to have_link(pipeline.ref)
end end
end end
...@@ -205,47 +199,7 @@ RSpec.describe 'Pipelines', :js do ...@@ -205,47 +199,7 @@ RSpec.describe 'Pipelines', :js do
end end
end end
context 'when pipeline is detached merge request pipeline, with rearrange_pipelines_table feature flag turned on' do context 'when pipeline is merge request pipeline' do
let(:merge_request) do
create(:merge_request,
:with_detached_merge_request_pipeline,
source_project: source_project,
target_project: target_project)
end
let!(:pipeline) { merge_request.all_pipelines.first }
let(:source_project) { project }
let(:target_project) { project }
before do
stub_feature_flags(rearrange_pipelines_table: true)
visit project_pipelines_path(source_project)
end
shared_examples_for 'detached merge request pipeline' do
it 'shows pipeline information without pipeline ref', :sidekiq_might_not_need_inline do
within '.pipeline-tags' do
expect(page).to have_content(expected_detached_mr_tag)
expect(page).to have_link(merge_request.iid,
href: project_merge_request_path(project, merge_request))
expect(page).not_to have_link(pipeline.ref)
end
end
end
it_behaves_like 'detached merge request pipeline'
context 'when source project is a forked project' do
let(:source_project) { fork_project(project, user, repository: true) }
it_behaves_like 'detached merge request pipeline'
end
end
context 'when pipeline is merge request pipeline, with rearrange_pipelines_table feature flag turned off' do
let(:merge_request) do let(:merge_request) do
create(:merge_request, create(:merge_request,
:with_merge_request_pipeline, :with_merge_request_pipeline,
...@@ -259,53 +213,6 @@ RSpec.describe 'Pipelines', :js do ...@@ -259,53 +213,6 @@ RSpec.describe 'Pipelines', :js do
let(:target_project) { project } let(:target_project) { project }
before do before do
stub_feature_flags(rearrange_pipelines_table: false)
visit project_pipelines_path(source_project)
end
shared_examples_for 'Correct merge request pipeline information' do
it 'does not show detached tag for the pipeline, and shows the link of the merge request, and does not show the ref of the pipeline', :sidekiq_might_not_need_inline do
within '.pipeline-tags' do
expect(page).not_to have_content(expected_detached_mr_tag)
end
within '.branch-commit' do
expect(page).to have_link(merge_request.iid,
href: project_merge_request_path(project, merge_request))
end
within '.branch-commit' do
expect(page).not_to have_link(pipeline.ref)
end
end
end
it_behaves_like 'Correct merge request pipeline information'
context 'when source project is a forked project' do
let(:source_project) { fork_project(project, user, repository: true) }
it_behaves_like 'Correct merge request pipeline information'
end
end
context 'when pipeline is merge request pipeline, with rearrange_pipelines_table feature flag turned on' do
let(:merge_request) do
create(:merge_request,
:with_merge_request_pipeline,
source_project: source_project,
target_project: target_project,
merge_sha: target_project.commit.sha)
end
let!(:pipeline) { merge_request.all_pipelines.first }
let(:source_project) { project }
let(:target_project) { project }
before do
stub_feature_flags(rearrange_pipelines_table: true)
visit project_pipelines_path(source_project) visit project_pipelines_path(source_project)
end end
...@@ -676,28 +583,6 @@ RSpec.describe 'Pipelines', :js do ...@@ -676,28 +583,6 @@ RSpec.describe 'Pipelines', :js do
context 'with pipeline key selection' do context 'with pipeline key selection' do
before do before do
stub_feature_flags(rearrange_pipelines_table: false)
visit project_pipelines_path(project)
wait_for_requests
end
it 'changes the Pipeline ID column for Pipeline IID' do
page.find('[data-testid="pipeline-key-dropdown"]').click
within '.gl-new-dropdown-contents' do
dropdown_options = page.find_all '.gl-new-dropdown-item'
dropdown_options[1].click
end
expect(page.find('[data-testid="pipeline-th"]')).to have_content 'Pipeline IID'
expect(page.find('[data-testid="pipeline-url-link"]')).to have_content "##{pipeline.iid}"
end
end
context 'with pipeline key selection and rearrange_pipelines_table ff on' do
before do
stub_feature_flags(rearrange_pipelines_table: true)
visit project_pipelines_path(project) visit project_pipelines_path(project)
wait_for_requests wait_for_requests
end end
......
...@@ -30,14 +30,11 @@ describe('Pipeline Url Component', () => { ...@@ -30,14 +30,11 @@ describe('Pipeline Url Component', () => {
const defaultProps = mockPipeline(projectPath); const defaultProps = mockPipeline(projectPath);
const createComponent = (props, rearrangePipelinesTable = false) => { const createComponent = (props) => {
wrapper = shallowMountExtended(PipelineUrlComponent, { wrapper = shallowMountExtended(PipelineUrlComponent, {
propsData: { ...defaultProps, ...props }, propsData: { ...defaultProps, ...props },
provide: { provide: {
targetProjectFullPath: projectPath, targetProjectFullPath: projectPath,
glFeatures: {
rearrangePipelinesTable,
},
}, },
}); });
}; };
...@@ -47,7 +44,6 @@ describe('Pipeline Url Component', () => { ...@@ -47,7 +44,6 @@ describe('Pipeline Url Component', () => {
wrapper = null; wrapper = null;
}); });
describe('with the rearrangePipelinesTable feature flag turned off', () => {
it('should render pipeline url table cell', () => { it('should render pipeline url table cell', () => {
createComponent(); createComponent();
...@@ -194,15 +190,6 @@ describe('Pipeline Url Component', () => { ...@@ -194,15 +190,6 @@ describe('Pipeline Url Component', () => {
expect(findTrainTag().exists()).toBe(false); expect(findTrainTag().exists()).toBe(false);
}); });
it('should not render the commit wrapper and commit-short-sha', () => {
createComponent();
expect(findCommitTitleContainer().exists()).toBe(false);
expect(findCommitShortSha().exists()).toBe(false);
});
});
describe('with the rearrangePipelinesTable feature flag turned on', () => {
it('should render the commit title, commit reference and commit-short-sha', () => { it('should render the commit title, commit reference and commit-short-sha', () => {
createComponent({}, true); createComponent({}, true);
...@@ -224,13 +211,9 @@ describe('Pipeline Url Component', () => { ...@@ -224,13 +211,9 @@ describe('Pipeline Url Component', () => {
${mockPipelineTag()} | ${'Tag'} ${mockPipelineTag()} | ${'Tag'}
${mockPipelineBranch()} | ${'Branch'} ${mockPipelineBranch()} | ${'Branch'}
${mockPipeline()} | ${'Merge Request'} ${mockPipeline()} | ${'Merge Request'}
`( `('should render tooltip $expectedTitle for commit icon type', ({ pipeline, expectedTitle }) => {
'should render tooltip $expectedTitle for commit icon type',
({ pipeline, expectedTitle }) => {
createComponent(pipeline, true); createComponent(pipeline, true);
expect(findCommitIconType().attributes('title')).toBe(expectedTitle); expect(findCommitIconType().attributes('title')).toBe(expectedTitle);
},
);
}); });
}); });
...@@ -17,7 +17,6 @@ import { ...@@ -17,7 +17,6 @@ import {
import eventHub from '~/pipelines/event_hub'; import eventHub from '~/pipelines/event_hub';
import CiBadge from '~/vue_shared/components/ci_badge_link.vue'; import CiBadge from '~/vue_shared/components/ci_badge_link.vue';
import CommitComponent from '~/vue_shared/components/commit.vue';
jest.mock('~/pipelines/event_hub'); jest.mock('~/pipelines/event_hub');
...@@ -37,18 +36,13 @@ describe('Pipelines Table', () => { ...@@ -37,18 +36,13 @@ describe('Pipelines Table', () => {
return pipelines.find((p) => p.user !== null && p.commit !== null); return pipelines.find((p) => p.user !== null && p.commit !== null);
}; };
const createComponent = (props = {}, rearrangePipelinesTable = false) => { const createComponent = (props = {}) => {
wrapper = extendedWrapper( wrapper = extendedWrapper(
mount(PipelinesTable, { mount(PipelinesTable, {
propsData: { propsData: {
...defaultProps, ...defaultProps,
...props, ...props,
}, },
provide: {
glFeatures: {
rearrangePipelinesTable,
},
},
}), }),
); );
}; };
...@@ -57,7 +51,6 @@ describe('Pipelines Table', () => { ...@@ -57,7 +51,6 @@ describe('Pipelines Table', () => {
const findStatusBadge = () => wrapper.findComponent(CiBadge); const findStatusBadge = () => wrapper.findComponent(CiBadge);
const findPipelineInfo = () => wrapper.findComponent(PipelineUrl); const findPipelineInfo = () => wrapper.findComponent(PipelineUrl);
const findTriggerer = () => wrapper.findComponent(PipelineTriggerer); const findTriggerer = () => wrapper.findComponent(PipelineTriggerer);
const findCommit = () => wrapper.findComponent(CommitComponent);
const findPipelineMiniGraph = () => wrapper.findComponent(PipelineMiniGraph); const findPipelineMiniGraph = () => wrapper.findComponent(PipelineMiniGraph);
const findTimeAgo = () => wrapper.findComponent(PipelinesTimeago); const findTimeAgo = () => wrapper.findComponent(PipelinesTimeago);
const findActions = () => wrapper.findComponent(PipelineOperations); const findActions = () => wrapper.findComponent(PipelineOperations);
...@@ -65,10 +58,7 @@ describe('Pipelines Table', () => { ...@@ -65,10 +58,7 @@ describe('Pipelines Table', () => {
const findTableRows = () => wrapper.findAllByTestId('pipeline-table-row'); const findTableRows = () => wrapper.findAllByTestId('pipeline-table-row');
const findStatusTh = () => wrapper.findByTestId('status-th'); const findStatusTh = () => wrapper.findByTestId('status-th');
const findPipelineTh = () => wrapper.findByTestId('pipeline-th'); const findPipelineTh = () => wrapper.findByTestId('pipeline-th');
const findTriggererTh = () => wrapper.findByTestId('triggerer-th');
const findCommitTh = () => wrapper.findByTestId('commit-th');
const findStagesTh = () => wrapper.findByTestId('stages-th'); const findStagesTh = () => wrapper.findByTestId('stages-th');
const findTimeAgoTh = () => wrapper.findByTestId('timeago-th');
const findActionsTh = () => wrapper.findByTestId('actions-th'); const findActionsTh = () => wrapper.findByTestId('actions-th');
const findRetryBtn = () => wrapper.findByTestId('pipelines-retry-button'); const findRetryBtn = () => wrapper.findByTestId('pipelines-retry-button');
const findCancelBtn = () => wrapper.findByTestId('pipelines-cancel-button'); const findCancelBtn = () => wrapper.findByTestId('pipelines-cancel-button');
...@@ -82,7 +72,7 @@ describe('Pipelines Table', () => { ...@@ -82,7 +72,7 @@ describe('Pipelines Table', () => {
wrapper = null; wrapper = null;
}); });
describe('Pipelines Table with rearrangePipelinesTable feature flag turned off', () => { describe('Pipelines Table', () => {
beforeEach(() => { beforeEach(() => {
createComponent({ pipelines: [pipeline], viewType: 'root' }); createComponent({ pipelines: [pipeline], viewType: 'root' });
}); });
...@@ -93,11 +83,8 @@ describe('Pipelines Table', () => { ...@@ -93,11 +83,8 @@ describe('Pipelines Table', () => {
it('should render table head with correct columns', () => { it('should render table head with correct columns', () => {
expect(findStatusTh().text()).toBe('Status'); expect(findStatusTh().text()).toBe('Status');
expect(findPipelineTh().text()).toBe('Pipeline ID'); expect(findPipelineTh().text()).toBe('Pipeline');
expect(findTriggererTh().text()).toBe('Triggerer');
expect(findCommitTh().text()).toBe('Commit');
expect(findStagesTh().text()).toBe('Stages'); expect(findStagesTh().text()).toBe('Stages');
expect(findTimeAgoTh().text()).toBe('Duration');
expect(findActionsTh().text()).toBe('Actions'); expect(findActionsTh().text()).toBe('Actions');
}); });
...@@ -125,27 +112,6 @@ describe('Pipelines Table', () => { ...@@ -125,27 +112,6 @@ describe('Pipelines Table', () => {
}); });
}); });
describe('triggerer cell', () => {
it('should render the pipeline triggerer', () => {
expect(findTriggerer().exists()).toBe(true);
});
});
describe('commit cell', () => {
it('should render commit information', () => {
expect(findCommit().exists()).toBe(true);
});
it('should display and link to commit', () => {
expect(findCommit().text()).toContain(pipeline.commit.short_id);
expect(findCommit().props('commitUrl')).toBe(pipeline.commit.commit_path);
});
it('should display the commit author', () => {
expect(findCommit().props('author')).toEqual(pipeline.commit.author);
});
});
describe('stages cell', () => { describe('stages cell', () => {
it('should render a pipeline mini graph', () => { it('should render a pipeline mini graph', () => {
expect(findPipelineMiniGraph().exists()).toBe(true); expect(findPipelineMiniGraph().exists()).toBe(true);
...@@ -163,7 +129,7 @@ describe('Pipelines Table', () => { ...@@ -163,7 +129,7 @@ describe('Pipelines Table', () => {
pipeline = createMockPipeline(); pipeline = createMockPipeline();
pipeline.details.stages = null; pipeline.details.stages = null;
createComponent({ pipelines: [pipeline] }, true); createComponent({ pipelines: [pipeline] });
}); });
it('stages are not rendered', () => { it('stages are not rendered', () => {
...@@ -176,7 +142,7 @@ describe('Pipelines Table', () => { ...@@ -176,7 +142,7 @@ describe('Pipelines Table', () => {
}); });
it('when update graph dropdown is set, should update graph dropdown', () => { it('when update graph dropdown is set, should update graph dropdown', () => {
createComponent({ pipelines: [pipeline], updateGraphDropdown: true }, true); createComponent({ pipelines: [pipeline], updateGraphDropdown: true });
expect(findPipelineMiniGraph().props('updateDropdown')).toBe(true); expect(findPipelineMiniGraph().props('updateDropdown')).toBe(true);
}); });
...@@ -207,30 +173,11 @@ describe('Pipelines Table', () => { ...@@ -207,30 +173,11 @@ describe('Pipelines Table', () => {
expect(findCancelBtn().attributes('title')).toBe(BUTTON_TOOLTIP_CANCEL); expect(findCancelBtn().attributes('title')).toBe(BUTTON_TOOLTIP_CANCEL);
}); });
}); });
});
describe('Pipelines Table with rearrangePipelinesTable feature flag turned on', () => {
beforeEach(() => {
createComponent({ pipelines: [pipeline], viewType: 'root' }, true);
});
it('should render table head with correct columns', () => {
expect(findStatusTh().text()).toBe('Status');
expect(findPipelineTh().text()).toBe('Pipeline');
expect(findStagesTh().text()).toBe('Stages');
expect(findActionsTh().text()).toBe('Actions');
});
describe('triggerer cell', () => { describe('triggerer cell', () => {
it('should render the pipeline triggerer', () => { it('should render the pipeline triggerer', () => {
expect(findTriggerer().exists()).toBe(true); expect(findTriggerer().exists()).toBe(true);
}); });
}); });
describe('commit cell', () => {
it('should not render commit information', () => {
expect(findCommit().exists()).toBe(false);
});
});
}); });
}); });
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