Improve WebIDE error messages
Problem to solve
When the WebIDE fails to commit changes, a generic message is displayed. It doesn't carry much information, whereas we have some indications in the API response about the error.
Intended users
- Cameron (Compliance Manager)
- Parker (Product Manager)
- Delaney (Development Team Lead)
- Presley (Product Designer)
- Sasha (Software Developer)
- Devon (DevOps Engineer)
- Sidney (Systems Administrator)
- Sam (Security Analyst)
- Rachel (Release Manager)
- Alex (Security Operations Engineer)
- Simone (Software Engineer in Test)
- Allison (Application Ops)
- Priyanka (Platform Engineer)
- Dana (Data Analyst)
User experience goal
- Update content with the WebIDE
- Try to commit, but there's an error
- Have a clue about what's going on.
Proposal
Display a meaningful error message
The API already provides meaningful error messages. The backend needs to properly return these when there are errors.
upload: 'You are not allowed to upload code for this project.',
download: 'You are not allowed to download code from this project.',
auth_upload: 'You are not allowed to upload code.',
auth_download: 'You are not allowed to download code.',
deploy_key_upload: 'This deploy key does not have write access to this project.',
no_repo: 'A repository for this project does not exist yet.',
project_not_found: 'The project you were looking for could not be found.',
command_not_allowed: "The command you're trying to execute is not allowed.",
upload_pack_disabled_over_http: 'Pulling over HTTP is not allowed.',
receive_pack_disabled_over_http: 'Pushing over HTTP is not allowed.',
read_only: 'The repository is temporarily read-only. Please try again later.',
cannot_push_to_read_only: "You can't push code to a read-only GitLab instance.",
push_code: 'You are not allowed to push code to this project.'
Further details
The API is returning a JSON answer with a message, like:
{"message":"403 Forbidden - You are not allowed to push into this branch"}
This message should be displayed, along with the current "An error occurred while committing your changes" generic message.
We also need to update the modal saying This branch has changed since you started editing. Would you like to create a new branch?
in https://gitlab.com/gitlab-org/gitlab/-/blob/68af62f803229d399f2a1679a2fa78407920609b/app/assets/javascripts/ide/components/commit_sidebar/form.vue#L175.
Permissions and Security
N/A
Documentation
N/A
Availability & Testing
N/A