diff options
author | Fatih Acet <acetfatih@gmail.com> | 2018-02-15 08:15:23 +0000 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2018-02-15 08:15:23 +0000 |
commit | e9802a833c1741990c13ced6288cdcefb194b17e (patch) | |
tree | d3bdee8f2bd5eed6735883c713c1d18f960b19e5 | |
parent | 75245f3452ea0f14d92383efad5eed77cf91e6ec (diff) | |
parent | 4e732deca8feb3d3c1a0538ddb9a98e3c442bb27 (diff) | |
download | gitlab-ce-e9802a833c1741990c13ced6288cdcefb194b17e.tar.gz |
Merge branch '34130-null-pipes' into 'master'
Resolve "Merge request says "Could not connect to the CI server", no CI or integration is configured"
See merge request gitlab-org/gitlab-ce!17053
3 files changed, 15 insertions, 0 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.js b/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.js index edf67fcd0a7..d8f0442ef9d 100644 --- a/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.js +++ b/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.js @@ -152,6 +152,7 @@ export default { }, handleNotification(data) { if (data.ci_status === this.mr.ciStatus) return; + if (!data.pipeline) return; const label = data.pipeline.details.status.label; const title = `Pipeline ${label}`; diff --git a/changelogs/unreleased/34130-null-pipes.yml b/changelogs/unreleased/34130-null-pipes.yml new file mode 100644 index 00000000000..a56e5cf8db2 --- /dev/null +++ b/changelogs/unreleased/34130-null-pipes.yml @@ -0,0 +1,5 @@ +--- +title: Prevent MR Widget error when no CI configured +merge_request: +author: +type: fixed diff --git a/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js b/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js index cd00d0a39a3..45035effe81 100644 --- a/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js +++ b/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js @@ -295,6 +295,15 @@ describe('mrWidgetOptions', () => { expect(notify.notifyMe).not.toHaveBeenCalled(); }); + + it('should not notify if no pipeline provided', () => { + vm.handleNotification({ + ...data, + pipeline: undefined, + }); + + expect(notify.notifyMe).not.toHaveBeenCalled(); + }); }); describe('resumePolling', () => { |