Commit 7996a03e authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch 'pb-cleanup-jobs-table-vue-feature-flag' into 'master'

Introduce new jobs tab - clean up feature flag

See merge request gitlab-org/gitlab!79631
parents fa5af694 92d73cb7
......@@ -69,9 +69,7 @@ export default async function initPipelineDetailsBundle() {
}
try {
if (gon.features?.jobsTabVue) {
createPipelineJobsApp(SELECTORS.PIPELINE_JOBS);
}
} catch {
createFlash({
message: __('An error occurred while loading the Jobs tab.'),
......
......@@ -20,10 +20,6 @@ class Projects::PipelinesController < Projects::ApplicationController
push_frontend_feature_flag(:rearrange_pipelines_table, project, default_enabled: :yaml)
end
before_action do
push_frontend_feature_flag(:jobs_tab_vue, @project, default_enabled: :yaml)
end
# 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? }
......
......@@ -29,20 +29,7 @@
#js-tab-builds.tab-pane
- if stages.present?
- if Feature.enabled?(:jobs_tab_vue, @project, default_enabled: :yaml)
#js-pipeline-jobs-vue{ data: { full_path: @project.full_path, pipeline_iid: @pipeline.iid } }
- else
.table-holder.pipeline-holder
%table.table.ci-table.pipeline
%thead
%tr
%th= _('Status')
%th= _('Name')
%th= _('Job ID')
%th
%th= _('Coverage')
%th
= render partial: "projects/stage/stage", collection: stages, as: :stage
- if @pipeline.failed_builds.present?
#js-tab-failures.build-failures.tab-pane.build-page
......
- stage = stage.present(current_user: current_user)
%tr
%th{ colspan: 10 }
%strong
%a{ name: stage.name }
%span{ class: "ci-status-link ci-status-icon-#{stage.status}" }
= ci_icon_for_status(stage.status)
&nbsp;
= stage.name.titleize
= render stage.latest_ordered_statuses, stage: false, ref: false, pipeline_link: false, allow_retry: true
= render stage.retried_ordered_statuses, stage: false, ref: false, pipeline_link: false, retried: true
%tr
%td{ colspan: 10 }
&nbsp;
---
name: jobs_tab_vue
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/76146
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/347371
milestone: '14.6'
type: development
group: group::pipeline execution
default_enabled: true
......@@ -20971,9 +20971,6 @@ msgstr ""
msgid "Job Failed #%{build_id}"
msgstr ""
msgid "Job ID"
msgstr ""
msgid "Job artifact"
msgstr ""
......
......@@ -30,23 +30,7 @@ RSpec.describe 'Commits' do
project.add_reporter(user)
end
describe 'Commit builds with jobs_tab_vue feature flag off' do
before do
stub_feature_flags(jobs_tab_vue: false)
visit builds_project_pipeline_path(project, pipeline)
end
it { expect(page).to have_content pipeline.sha[0..7] }
it 'contains generic commit status build' do
page.within('.table-holder') do
expect(page).to have_content "##{status.id}" # build id
expect(page).to have_content 'generic' # build name
end
end
end
describe 'Commit builds with jobs_tab_vue feature flag on', :js do
describe 'Commit builds', :js do
before do
visit builds_project_pipeline_path(project, pipeline)
......@@ -107,20 +91,7 @@ RSpec.describe 'Commits' do
end
end
context 'Download artifacts with jobs_tab_vue feature flag off' do
before do
stub_feature_flags(jobs_tab_vue: false)
create(:ci_job_artifact, :archive, file: artifacts_file, job: build)
end
it do
visit pipeline_path(pipeline)
click_on 'Download artifacts'
expect(page.response_headers['Content-Type']).to eq(artifacts_file.content_type)
end
end
context 'Download artifacts with jobs_tab_vue feature flag on', :js do
context 'Download artifacts', :js do
before do
create(:ci_job_artifact, :archive, file: artifacts_file, job: build)
end
......@@ -149,28 +120,7 @@ RSpec.describe 'Commits' do
end
end
context "when logged as reporter and with jobs_tab_vue feature flag off" do
before do
stub_feature_flags(jobs_tab_vue: false)
project.add_reporter(user)
create(:ci_job_artifact, :archive, file: artifacts_file, job: build)
visit pipeline_path(pipeline)
end
it 'renders header', :js do
expect(page).to have_content pipeline.sha[0..7]
expect(page).to have_content pipeline.git_commit_message.gsub!(/\s+/, ' ')
expect(page).to have_content pipeline.user.name
expect(page).not_to have_link('Cancel running')
expect(page).not_to have_link('Retry')
end
it do
expect(page).to have_link('Download artifacts')
end
end
context "when logged as reporter and with jobs_tab_vue feature flag on", :js do
context "when logged as reporter", :js do
before do
project.add_reporter(user)
create(:ci_job_artifact, :archive, file: artifacts_file, job: build)
......
......@@ -916,111 +916,7 @@ RSpec.describe 'Pipeline', :js do
end
end
describe 'GET /:project/-/pipelines/:id/builds with jobs_tab_vue feature flag turned off' do
include_context 'pipeline builds'
let_it_be(:project) { create(:project, :repository) }
let(:pipeline) { create(:ci_pipeline, project: project, ref: 'master', sha: project.commit.id) }
before do
stub_feature_flags(jobs_tab_vue: false)
visit builds_project_pipeline_path(project, pipeline)
end
it 'shows a list of jobs' do
expect(page).to have_content('Test')
expect(page).to have_content(build_passed.id)
expect(page).to have_content('Deploy')
expect(page).to have_content(build_failed.id)
expect(page).to have_content(build_running.id)
expect(page).to have_content(build_external.id)
expect(page).to have_content('Retry')
expect(page).to have_content('Cancel running')
expect(page).to have_link('Play')
end
it 'shows jobs tab pane as active' do
expect(page).to have_css('#js-tab-builds.active')
end
context 'page tabs' do
it 'shows Pipeline, Jobs and DAG tabs with link' do
expect(page).to have_link('Pipeline')
expect(page).to have_link('Jobs')
expect(page).to have_link('Needs')
end
it 'shows counter in Jobs tab' do
expect(page.find('.js-builds-counter').text).to eq(pipeline.total_size.to_s)
end
it 'shows Jobs tab as active' do
expect(page).to have_css('li.js-builds-tab-link .active')
end
end
context 'retrying jobs' do
it { expect(page).not_to have_content('retried') }
context 'when retrying' do
before do
find('[data-testid="retryPipeline"]').click
end
it 'does not show a "Retry" button', :sidekiq_might_not_need_inline do
expect(page).not_to have_content('Retry')
end
end
end
context 'canceling jobs' do
it { expect(page).not_to have_selector('.ci-canceled') }
context 'when canceling' do
before do
click_on 'Cancel running'
end
it 'does not show a "Cancel running" button', :sidekiq_might_not_need_inline do
expect(page).not_to have_content('Cancel running')
end
end
end
context 'playing manual job' do
before do
within '.pipeline-holder' do
click_link('Play')
end
end
it { expect(build_manual.reload).to be_pending }
end
context 'when user unschedules a delayed job' do
before do
within '.pipeline-holder' do
click_link('Unschedule')
end
end
it 'unschedules the delayed job and shows play button as a manual job' do
expect(page).to have_content('Trigger this manual action')
end
end
context 'failed jobs' do
it 'displays a tooltip with the failure reason' do
page.within('.ci-table') do
failed_job_link = page.find('.ci-failed')
expect(failed_job_link[:title]).to eq('Failed - (unknown failure)')
end
end
end
end
describe 'GET /:project/-/pipelines/:id/builds with jobs_tab_vue feature flag turned on' do
describe 'GET /:project/-/pipelines/:id/builds' do
include_context 'pipeline builds'
let_it_be(:project) { create(:project, :repository) }
......
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