Commit c52b1d48 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch...

Merge branch 'ee-41545-gitlab-merge-request-status-could-not-connect-to-the-ci-server-please-check-your-settings-and-try-again' into 'master'

EE Resolve "Reword error message for internal CI unknown pipeline status"

See merge request gitlab-org/gitlab-ee!8073
parents e98aadf1 c50e5e5c
<script> <script>
/* eslint-disable vue/require-default-prop */ /* eslint-disable vue/require-default-prop */
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';
...@@ -38,6 +39,10 @@ export default { ...@@ -38,6 +39,10 @@ export default {
type: String, type: String,
required: false, required: false,
}, },
troubleshootingDocsPath: {
type: String,
required: true,
},
}, },
computed: { computed: {
hasPipeline() { hasPipeline() {
...@@ -61,6 +66,12 @@ export default { ...@@ -61,6 +66,12 @@ export default {
hasCommitInfo() { hasCommitInfo() {
return this.pipeline.commit && Object.keys(this.pipeline.commit).length > 0; return this.pipeline.commit && Object.keys(this.pipeline.commit).length > 0;
}, },
errorText() {
return sprintf(__('Could not retrieve the pipeline status. For troubleshooting steps, read the %{linkStart}documentation.%{linkEnd}'), {
linkStart: `<a href="${this.troubleshootingDocsPath}">`,
linkEnd: '</a>',
});
},
/* We typically set defaults ([]) in the store or prop declarations, but because triggered /* We typically set defaults ([]) in the store or prop declarations, but because triggered
* and triggeredBy are appended to `pipeline`, we can't set defaults in the store, and we * and triggeredBy are appended to `pipeline`, we can't set defaults in the store, and we
* need to check their length here to prevent initializing linked-pipeline-mini-lists * need to check their length here to prevent initializing linked-pipeline-mini-lists
...@@ -91,8 +102,10 @@ export default { ...@@ -91,8 +102,10 @@ export default {
name="status_failed_borderless" name="status_failed_borderless"
/> />
</div> </div>
<div class="media-body"> <div
Could not connect to the CI server. Please check your settings and try again class="media-body"
v-html="errorText"
>
</div> </div>
</template> </template>
<template v-else-if="hasPipeline"> <template v-else-if="hasPipeline">
......
...@@ -302,6 +302,7 @@ export default { ...@@ -302,6 +302,7 @@ export default {
:has-ci="mr.hasCI" :has-ci="mr.hasCI"
:source-branch="mr.sourceBranch" :source-branch="mr.sourceBranch"
:source-branch-link="mr.sourceBranchLink" :source-branch-link="mr.sourceBranchLink"
:troubleshooting-docs-path="mr.troubleshootingDocsPath"
/> />
<deployment <deployment
v-for="deployment in mr.deployments" v-for="deployment in mr.deployments"
......
...@@ -18,6 +18,8 @@ export default class MergeRequestStore { ...@@ -18,6 +18,8 @@ export default class MergeRequestStore {
this.squash = data.squash; this.squash = data.squash;
this.squashBeforeMergeHelpPath = this.squashBeforeMergeHelpPath =
this.squashBeforeMergeHelpPath || data.squash_before_merge_help_path; this.squashBeforeMergeHelpPath || data.squash_before_merge_help_path;
this.troubleshootingDocsPath =
this.troubleshootingDocsPath || data.troubleshooting_docs_path;
this.enableSquashBeforeMerge = this.enableSquashBeforeMerge || true; this.enableSquashBeforeMerge = this.enableSquashBeforeMerge || true;
this.iid = data.iid; this.iid = data.iid;
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
window.gl.mrWidgetData = #{serialize_issuable(@merge_request, serializer: 'widget')} window.gl.mrWidgetData = #{serialize_issuable(@merge_request, serializer: 'widget')}
window.gl.mrWidgetData.squash_before_merge_help_path = '#{help_page_path("user/project/merge_requests/squash_and_merge")}'; window.gl.mrWidgetData.squash_before_merge_help_path = '#{help_page_path("user/project/merge_requests/squash_and_merge")}';
window.gl.mrWidgetData.troubleshooting_docs_path = '#{help_page_path('user/project/merge_requests', anchor: 'troubleshooting')}';
#js-vue-mr-widget.mr-widget #js-vue-mr-widget.mr-widget
......
---
title: Reword error message for internal CI unknown pipeline status
merge_request: 22474
author:
type: changed
...@@ -349,6 +349,35 @@ all your changes will be available to preview by anyone with the Review Apps lin ...@@ -349,6 +349,35 @@ all your changes will be available to preview by anyone with the Review Apps lin
Find out about [bulk editing merge requests](../../project/bulk_editing.md). Find out about [bulk editing merge requests](../../project/bulk_editing.md).
## Troubleshooting
Sometimes things don't go as expected in a merge request, here are some
troubleshooting steps.
### Merge request cannot retrieve the pipeline status
This can occur for one of two reasons:
* Sidekiq doesn't pick up the changes fast enough
* Because of the bug described in [#41545](https://gitlab.com/gitlab-org/gitlab-ce/issues/41545)
#### Sidekiq
Sidekiq didn't process the CI state change fast enough. Please wait a few
seconds and the status will update automatically.
#### Bug
Merge Request pipeline statuses can't be retrieved when the following occurs:
1. A Merge Requst is created
1. The Merge Request is closed
1. Changes are made in the project
1. The Merge Request is reopened
To enable the pipeline status to be properly retrieved, close and reopen the
Merge Request again.
## Tips ## Tips
Here are some tips that will help you be more efficient with merge requests in Here are some tips that will help you be more efficient with merge requests in
......
...@@ -198,6 +198,7 @@ export default { ...@@ -198,6 +198,7 @@ export default {
:has-ci="mr.hasCI" :has-ci="mr.hasCI"
:source-branch-link="mr.sourceBranchLink" :source-branch-link="mr.sourceBranchLink"
:source-branch="mr.sourceBranch" :source-branch="mr.sourceBranch"
:troubleshooting-docs-path="mr.troubleshootingDocsPath"
/> />
<deployment <deployment
v-for="deployment in mr.deployments" v-for="deployment in mr.deployments"
......
...@@ -2326,6 +2326,9 @@ msgstr "" ...@@ -2326,6 +2326,9 @@ msgstr ""
msgid "Copy token to clipboard" msgid "Copy token to clipboard"
msgstr "" msgstr ""
msgid "Could not retrieve the pipeline status. For troubleshooting steps, read the %{linkStart}documentation.%{linkEnd}"
msgstr ""
msgid "Create" msgid "Create"
msgstr "" msgstr ""
......
...@@ -179,7 +179,7 @@ describe 'Merge request > User sees merge widget', :js do ...@@ -179,7 +179,7 @@ describe 'Merge request > User sees merge widget', :js do
# Wait for the `ci_status` and `merge_check` requests # Wait for the `ci_status` and `merge_check` requests
wait_for_requests wait_for_requests
expect(page).to have_text('Could not connect to the CI server. Please check your settings and try again') expect(page).to have_text(%r{Could not retrieve the pipeline status\. For troubleshooting steps, read the <a href=\".+\">documentation\.</a>})
end end
end end
......
...@@ -41,8 +41,8 @@ describe 'Merge request > User sees pipelines', :js do ...@@ -41,8 +41,8 @@ describe 'Merge request > User sees pipelines', :js do
visit project_merge_request_path(project, merge_request) visit project_merge_request_path(project, merge_request)
wait_for_requests wait_for_requests
expect(page.find('.ci-widget')).to have_content( expect(page.find('.ci-widget')).to have_text(
'Could not connect to the CI server. Please check your settings and try again') %r{Could not retrieve the pipeline status\. For troubleshooting steps, read the <a href=\".+\">documentation\.</a>})
end end
end end
......
...@@ -23,6 +23,7 @@ describe('MRWidgetPipeline', () => { ...@@ -23,6 +23,7 @@ describe('MRWidgetPipeline', () => {
pipeline: mockData.pipeline, pipeline: mockData.pipeline,
ciStatus: 'success', ciStatus: 'success',
hasCi: true, hasCi: true,
troubleshootingDocsPath: 'help',
}); });
expect(vm.hasPipeline).toEqual(true); expect(vm.hasPipeline).toEqual(true);
...@@ -31,6 +32,7 @@ describe('MRWidgetPipeline', () => { ...@@ -31,6 +32,7 @@ describe('MRWidgetPipeline', () => {
it('should return false when there is no pipeline', () => { it('should return false when there is no pipeline', () => {
vm = mountComponent(Component, { vm = mountComponent(Component, {
pipeline: {}, pipeline: {},
troubleshootingDocsPath: 'help',
}); });
expect(vm.hasPipeline).toEqual(false); expect(vm.hasPipeline).toEqual(false);
...@@ -43,6 +45,7 @@ describe('MRWidgetPipeline', () => { ...@@ -43,6 +45,7 @@ describe('MRWidgetPipeline', () => {
pipeline: mockData.pipeline, pipeline: mockData.pipeline,
hasCi: true, hasCi: true,
ciStatus: 'success', ciStatus: 'success',
troubleshootingDocsPath: 'help',
}); });
expect(vm.hasCIError).toEqual(false); expect(vm.hasCIError).toEqual(false);
...@@ -53,6 +56,7 @@ describe('MRWidgetPipeline', () => { ...@@ -53,6 +56,7 @@ describe('MRWidgetPipeline', () => {
pipeline: mockData.pipeline, pipeline: mockData.pipeline,
hasCi: true, hasCi: true,
ciStatus: null, ciStatus: null,
troubleshootingDocsPath: 'help',
}); });
expect(vm.hasCIError).toEqual(true); expect(vm.hasCIError).toEqual(true);
...@@ -66,11 +70,12 @@ describe('MRWidgetPipeline', () => { ...@@ -66,11 +70,12 @@ describe('MRWidgetPipeline', () => {
pipeline: mockData.pipeline, pipeline: mockData.pipeline,
hasCi: true, hasCi: true,
ciStatus: null, ciStatus: null,
troubleshootingDocsPath: 'help',
}); });
expect( expect(
vm.$el.querySelector('.media-body').textContent.trim(), vm.$el.querySelector('.media-body').textContent.trim(),
).toEqual('Could not connect to the CI server. Please check your settings and try again'); ).toContain('Could not retrieve the pipeline status. For troubleshooting steps, read the <a href="help">documentation.</a>');
}); });
describe('with a pipeline', () => { describe('with a pipeline', () => {
...@@ -79,6 +84,7 @@ describe('MRWidgetPipeline', () => { ...@@ -79,6 +84,7 @@ describe('MRWidgetPipeline', () => {
pipeline: mockData.pipeline, pipeline: mockData.pipeline,
hasCi: true, hasCi: true,
ciStatus: 'success', ciStatus: 'success',
troubleshootingDocsPath: 'help',
}); });
}); });
...@@ -123,6 +129,7 @@ describe('MRWidgetPipeline', () => { ...@@ -123,6 +129,7 @@ describe('MRWidgetPipeline', () => {
pipeline: mockCopy.pipeline, pipeline: mockCopy.pipeline,
hasCi: true, hasCi: true,
ciStatus: 'success', ciStatus: 'success',
troubleshootingDocsPath: 'help',
}); });
}); });
...@@ -163,6 +170,7 @@ describe('MRWidgetPipeline', () => { ...@@ -163,6 +170,7 @@ describe('MRWidgetPipeline', () => {
pipeline: mockCopy.pipeline, pipeline: mockCopy.pipeline,
hasCi: true, hasCi: true,
ciStatus: 'success', ciStatus: 'success',
troubleshootingDocsPath: 'help',
}); });
expect( expect(
...@@ -180,6 +188,7 @@ describe('MRWidgetPipeline', () => { ...@@ -180,6 +188,7 @@ describe('MRWidgetPipeline', () => {
pipeline: mockCopy.pipeline, pipeline: mockCopy.pipeline,
hasCi: true, hasCi: true,
ciStatus: 'success', ciStatus: 'success',
troubleshootingDocsPath: 'help',
}); });
expect(vm.$el.querySelector('.js-mini-pipeline-graph')).toEqual(null); expect(vm.$el.querySelector('.js-mini-pipeline-graph')).toEqual(null);
...@@ -194,6 +203,7 @@ describe('MRWidgetPipeline', () => { ...@@ -194,6 +203,7 @@ describe('MRWidgetPipeline', () => {
}), }),
hasCi: true, hasCi: true,
ciStatus: 'success', ciStatus: 'success',
troubleshootingDocsPath: 'help',
}); });
}); });
...@@ -214,6 +224,7 @@ describe('MRWidgetPipeline', () => { ...@@ -214,6 +224,7 @@ describe('MRWidgetPipeline', () => {
}), }),
hasCi: true, hasCi: true,
ciStatus: 'success', ciStatus: 'success',
troubleshootingDocsPath: 'help',
}); });
}); });
......
...@@ -230,6 +230,7 @@ export default { ...@@ -230,6 +230,7 @@ export default {
'/help/user/project/merge_requests/index#interacting-with-security-reports-ultimate', '/help/user/project/merge_requests/index#interacting-with-security-reports-ultimate',
merge_commit_path: merge_commit_path:
'http://localhost:3000/root/acets-app/commit/53027d060246c8f47e4a9310fb332aa52f221775', 'http://localhost:3000/root/acets-app/commit/53027d060246c8f47e4a9310fb332aa52f221775',
troubleshooting_docs_path: 'help'
}; };
// Codeclimate // Codeclimate
export const headIssues = [ export const headIssues = [
......
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