From e57556239dff927cf5b60d80514415f89026bd99 Mon Sep 17 00:00:00 2001 From: Thomas Randolph Date: Mon, 6 Jul 2020 09:50:57 -0600 Subject: [PATCH 1/3] Add missing function call --- app/assets/javascripts/pages/projects/commit/pipelines/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/assets/javascripts/pages/projects/commit/pipelines/index.js b/app/assets/javascripts/pages/projects/commit/pipelines/index.js index 9f08260c3d6cd5..1415a6f60c8f18 100644 --- a/app/assets/javascripts/pages/projects/commit/pipelines/index.js +++ b/app/assets/javascripts/pages/projects/commit/pipelines/index.js @@ -1,6 +1,7 @@ import $ from 'jquery'; import MiniPipelineGraph from '~/mini_pipeline_graph_dropdown'; import initPipelines from '~/commit/pipelines/pipelines_bundle'; +import { fetchCommitMergeRequests } from '~/commit_merge_requests'; document.addEventListener('DOMContentLoaded', () => { new MiniPipelineGraph({ @@ -8,5 +9,6 @@ document.addEventListener('DOMContentLoaded', () => { }).bindEvents(); // eslint-disable-next-line no-jquery/no-load $('.commit-info.branches').load(document.querySelector('.js-commit-box').dataset.commitPath); + fetchCommitMergeRequests(); initPipelines(); }); -- GitLab From d32161a569c4b7a05f4be48ade5cbfbc38770ef8 Mon Sep 17 00:00:00 2001 From: Thomas Randolph Date: Mon, 6 Jul 2020 10:35:31 -0600 Subject: [PATCH 2/3] Add changelog for fixed pipelines related MRs spinner --- .../unreleased/defect-pipeline-related-mr-spinner.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 changelogs/unreleased/defect-pipeline-related-mr-spinner.yml diff --git a/changelogs/unreleased/defect-pipeline-related-mr-spinner.yml b/changelogs/unreleased/defect-pipeline-related-mr-spinner.yml new file mode 100644 index 00000000000000..1468c26653885e --- /dev/null +++ b/changelogs/unreleased/defect-pipeline-related-mr-spinner.yml @@ -0,0 +1,6 @@ +--- +title: Fix infinite loading spinner for related merge requests on commit pipelines + tab +merge_request: 36077 +author: +type: fixed -- GitLab From 58a7e8fbbf1e288db45daff0f3f267ebcb38e953 Mon Sep 17 00:00:00 2001 From: Thomas Randolph Date: Wed, 8 Jul 2020 21:00:50 -0600 Subject: [PATCH 3/3] Add test for the commit pipeline page showing no related MRs --- spec/features/projects/commit/builds_spec.rb | 25 +++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/spec/features/projects/commit/builds_spec.rb b/spec/features/projects/commit/builds_spec.rb index 13f73b8cf449ef..f97abc5bd8b9d0 100644 --- a/spec/features/projects/commit/builds_spec.rb +++ b/spec/features/projects/commit/builds_spec.rb @@ -6,23 +6,32 @@ let(:project) { create(:project, :repository) } before do + create(:ci_pipeline, project: project, + sha: project.commit.sha, + ref: 'master') + user = create(:user) project.add_maintainer(user) sign_in(user) + + visit pipelines_project_commit_path(project, project.commit.sha) end context 'when no builds triggered yet' do - before do - create(:ci_pipeline, project: project, - sha: project.commit.sha, - ref: 'master') + it 'shows the ID of the first pipeline' do + page.within('.table-holder') do + expect(page).to have_content project.ci_pipelines[0].id # pipeline ids + end end + end - it 'user views commit pipelines page' do - visit pipelines_project_commit_path(project, project.commit.sha) + context 'with no related merge requests' do + it 'shows the correct text for no related MRs' do + wait_for_requests - page.within('.table-holder') do - expect(page).to have_content project.ci_pipelines[0].id # pipeline ids + page.within('.merge-request-info') do + expect(page).not_to have_selector '.spinner' + expect(page).to have_content 'No related merge requests found' end end end -- GitLab