Improve web UI/editor UI for CODEOWNER failures
When a user attempts to merge a change to a protected branch, and that changeset includes files that would violate the project's CODEOWNERS
rules, we display mixed messaging.
Editor
Its messaging is correct, but might want to be visited with some formatting; it is using a recycled version of the CLI error message.
Web IDE
Meanwhile, the Web IDE's error is flatly wrong; the FE interprets any kind of error from the merge attempt as a conflict.
In our initial exploration, we identified other opportunities for improvement, such as flagging files in the tree view before merge attempt, as well as adding integration tests that actually test the entire cycle within the context of an existing CODEOWNERS
rule.
https://gitlab.com/gitlab-org/gitlab/-/issues/118807#note_287984794
Proposal
Display error messages matching the following scenarios when committing. For the single file editor display error messages in an alert. In the Web IDE display messages in a modal.
Scenario | Message | Action buttons |
---|---|---|
Unexpected error | Could not commit. An unexpected error occurred | Cancel |
CODEOWNERS rule violation | Pushes to protected branches that contain changes to files that match patterns defined in CODEOWNERS are disabled for this project. Please submit these changes via a merge request. The following pattern(s) from CODEOWNERS were matched: - *.md |
Create new branch, Cancel |
Branch changed | This branch has changed since you started editing. Would you like to create a new branch? | Create new branch, Cancel |
Availability and Testing
Regression testing: running package-and-qa
in MR recommended to ensure existing functionality is not affected by the modifications. We might also need to modify any front-end/QA tests that verify error messages.