diff options
author | Fatih Acet <acetfatih@gmail.com> | 2018-02-15 08:15:23 +0000 |
---|---|---|
committer | Ian Baum <ibaum@gitlab.com> | 2018-02-23 11:52:41 -0600 |
commit | 646f6c2e6ede9d5b1c9bb5bff6555122182d8d35 (patch) | |
tree | 46b5fd4c9c5cc67fc49f75e48a05f65d6cb449b8 | |
parent | 21c2ffea5f50f9aa204d8ec6ba6b5cc47cba636e (diff) | |
download | gitlab-ce-646f6c2e6ede9d5b1c9bb5bff6555122182d8d35.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', () => { |