Show rebase pre-receive error to user
What does this MR do and why?
If a project has a push rule configured, a rebase may fail quietly with the message, "Rebase failed. Please rebase locally. Please try again." The user has no idea why this rebase failed.
Since pre-receive messages are sanitized to show only text that starts
with "GitLab:", we can safely display these to the user in
RebaseService, just as we do in MergeService.
Relates to #213608 (closed)
Screenshots or screen recordings
It seems like we have extraneous error messages popping up below: one flash message at the top, a flash message in the widget, and a rebasingError below the widget.
We seem to create a flash message in https://gitlab.com/gitlab-org/gitlab/blob/809b12710d0e65671cddfc8a6c8a88fe5d48c30f/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_rebase.vue#L124-126 even though we also display rebasingError in https://gitlab.com/gitlab-org/gitlab/blob/809b12710d0e65671cddfc8a6c8a88fe5d48c30f/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_rebase.vue#L190. Maybe we can drop rebasingError since it seems redundant?
I'm also inclined to drop the top flash message when merge_error is present.
Initial failure
After reload
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- In a project, enable fast-forward merges in the Settings -> General.
- Create a new file
a.txtand a merge request for that. - Create a new file
b.txtand a merge request for that. - Merge one of the merge requests.
- Visit the other merge request and click
Rebase.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.

