Commit 3d4cff1c authored by Nick Thomas's avatar Nick Thomas

Merge branch '45669-table-in-jobs-on-pipeline' into 'master'

Remove all tables from Pipeline page when there is no job for the Pipeline

Closes #45669

See merge request gitlab-org/gitlab-ce!18540
parents 43463869 1c4eedd5
...@@ -25,7 +25,7 @@ export default { ...@@ -25,7 +25,7 @@ export default {
...mapState('pipelines', ['isLoadingPipeline', 'latestPipeline', 'stages', 'isLoadingJobs']), ...mapState('pipelines', ['isLoadingPipeline', 'latestPipeline', 'stages', 'isLoadingJobs']),
ciLintText() { ciLintText() {
return sprintf( return sprintf(
__('You can also test your .gitlab-ci.yml in the %{linkStart}Lint%{linkEnd}'), __('You can test your .gitlab-ci.yml in %{linkStart}CI Lint%{linkEnd}.'),
{ {
linkStart: `<a href="${_.escape(this.currentProject.web_url)}/-/ci/lint">`, linkStart: `<a href="${_.escape(this.currentProject.web_url)}/-/ci/lint">`,
linkEnd: '</a>', linkEnd: '</a>',
......
...@@ -19,30 +19,23 @@ ...@@ -19,30 +19,23 @@
#js-pipeline-graph-vue #js-pipeline-graph-vue
#js-tab-builds.tab-pane #js-tab-builds.tab-pane
- if pipeline.yaml_errors.present? - if pipeline.legacy_stages.present?
.bs-callout.bs-callout-danger .table-holder.pipeline-holder
%h4 Found errors in your .gitlab-ci.yml: %table.table.ci-table.pipeline
%ul %thead
- pipeline.yaml_errors.split(",").each do |error| %tr
%li= error %th Status
You can also test your .gitlab-ci.yml in the #{link_to "Lint", project_ci_lint_path(@project)} %th Job ID
%th Name
%th
%th Coverage
%th
= render partial: "projects/stage/stage", collection: pipeline.legacy_stages, as: :stage
- if pipeline.project.builds_enabled? && !pipeline.ci_yaml_file - elsif pipeline.project.builds_enabled? && !pipeline.ci_yaml_file
.bs-callout.bs-callout-warning .bs-callout.bs-callout-warning
\.gitlab-ci.yml not found in this commit \.gitlab-ci.yml not found in this commit
.table-holder.pipeline-holder
%table.table.ci-table.pipeline
%thead
%tr
%th Status
%th Job ID
%th Name
%th
%th Coverage
%th
= render partial: "projects/stage/stage", collection: pipeline.legacy_stages, as: :stage
- if @pipeline.failed_builds.present? - if @pipeline.failed_builds.present?
#js-tab-failures.build-failures.tab-pane.build-page #js-tab-failures.build-failures.tab-pane.build-page
%table.table.responsive-table.ci-table.responsive-table-sm-rounded %table.table.responsive-table.ci-table.responsive-table-sm-rounded
......
...@@ -9,6 +9,14 @@ ...@@ -9,6 +9,14 @@
- if @pipeline.commit.present? - if @pipeline.commit.present?
= render "projects/pipelines/info", commit: @pipeline.commit = render "projects/pipelines/info", commit: @pipeline.commit
= render "projects/pipelines/with_tabs", pipeline: @pipeline - if @pipeline.builds.empty? && @pipeline.yaml_errors.present?
.bs-callout.bs-callout-danger
%h4 Found errors in your .gitlab-ci.yml:
%ul
- @pipeline.yaml_errors.split(",").each do |error|
%li= error
You can test your .gitlab-ci.yml in #{link_to "CI Lint", project_ci_lint_path(@project)}.
- else
= render "projects/pipelines/with_tabs", pipeline: @pipeline
.js-pipeline-details-vue{ data: { endpoint: project_pipeline_path(@project, @pipeline, format: :json) } } .js-pipeline-details-vue{ data: { endpoint: project_pipeline_path(@project, @pipeline, format: :json) } }
---
title: Hide all tables on Pipeline when no Jobs for the Pipeline
merge_request: 18540
author: Takuya Noguchi
type: fixed
...@@ -7014,9 +7014,6 @@ msgstr "" ...@@ -7014,9 +7014,6 @@ msgstr ""
msgid "You can also star a label to make it a priority label." msgid "You can also star a label to make it a priority label."
msgstr "" msgstr ""
msgid "You can also test your .gitlab-ci.yml in the %{linkStart}Lint%{linkEnd}"
msgstr ""
msgid "You can easily contribute to them by requesting to join these groups." msgid "You can easily contribute to them by requesting to join these groups."
msgstr "" msgstr ""
...@@ -7038,6 +7035,9 @@ msgstr "" ...@@ -7038,6 +7035,9 @@ msgstr ""
msgid "You can set up jobs to only use Runners with specific tags. Separate tags with commas." msgid "You can set up jobs to only use Runners with specific tags. Separate tags with commas."
msgstr "" msgstr ""
msgid "You can test your .gitlab-ci.yml in %{linkStart}CI Lint%{linkEnd}."
msgstr ""
msgid "You cannot write to this read-only GitLab instance." msgid "You cannot write to this read-only GitLab instance."
msgstr "" msgstr ""
......
...@@ -114,33 +114,6 @@ describe 'Commits' do ...@@ -114,33 +114,6 @@ describe 'Commits' do
expect(page).to have_content 'canceled' expect(page).to have_content 'canceled'
end end
end end
describe '.gitlab-ci.yml not found warning' do
context 'ci builds enabled' do
it "does not show warning" do
visit pipeline_path(pipeline)
expect(page).not_to have_content '.gitlab-ci.yml not found in this commit'
end
it 'shows warning' do
stub_ci_pipeline_yaml_file(nil)
visit pipeline_path(pipeline)
expect(page).to have_content '.gitlab-ci.yml not found in this commit'
end
end
context 'ci builds disabled' do
before do
stub_ci_builds_disabled
stub_ci_pipeline_yaml_file(nil)
visit pipeline_path(pipeline)
end
it 'does not show warning' do
expect(page).not_to have_content '.gitlab-ci.yml not found in this commit'
end
end
end
end end
context "when logged as reporter" do context "when logged as reporter" do
...@@ -182,6 +155,39 @@ describe 'Commits' do ...@@ -182,6 +155,39 @@ describe 'Commits' do
end end
end end
end end
describe '.gitlab-ci.yml not found warning' do
before do
project.add_reporter(user)
end
context 'ci builds enabled' do
it 'does not show warning' do
visit pipeline_path(pipeline)
expect(page).not_to have_content '.gitlab-ci.yml not found in this commit'
end
it 'shows warning' do
stub_ci_pipeline_yaml_file(nil)
visit pipeline_path(pipeline)
expect(page).to have_content '.gitlab-ci.yml not found in this commit'
end
end
context 'ci builds disabled' do
it 'does not show warning' do
stub_ci_builds_disabled
stub_ci_pipeline_yaml_file(nil)
visit pipeline_path(pipeline)
expect(page).not_to have_content '.gitlab-ci.yml not found in this commit'
end
end
end
end end
context 'viewing commits for a branch' do context 'viewing commits for a branch' do
......
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