Build notification message always shown when switching from merge request to another
In GitLab 8.7.3, the build notification message always shows when you jump from one merge request to another due to changes in !3998 (merged). Steps to reproduce:
- Visit https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4083
- Then visit https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4082.
- Wait until you see a "Build passed" message.
I think the problem is that the widget gets initialized once, and !3998 (merged) made it so that any changes would cause a notification.
The previous implementation had:
if @opts.ci_status is ''
@opts.ci_status = data.status
return
I think this prevented this extraneous notification from occurring since the options are blank the first time you visit the merge request. That wasn't obvious to me when I reviewed !3998 (merged). I'm also not sure why this isn't handled properly by calling getCIStatus(false)
in the widget, and getCIStatus(true)
in the polling call.