Cannot create a deploy token on repository : "Scopes can't be blank"
Summary
While creating a deploy token on a repository, I receive the error "Scopes can't be blank" even when scopes are selected
Steps to reproduce
- Go to a repository
- Enter repository Settings
- Go to deploy token section
- Create a deploy token
- Give it a name
- Add scopes
- Save it
- Error : "Scopes can't be blank"
Example Project
What is the current bug behavior?
An error message stating that "Scopes can't be blank" is displayed despite having two selected
What is the expected correct behavior?
The token is created and no error is displayed
Relevant logs and/or screenshots
Interface screenshot :
Bellow the cURL request (stripped out of token and cookies) extracted from developer tool.
curl 'https://gitlab.com/groupe1/group2/projects/-/settings/repository/deploy_token/create' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Accept-Encoding: gzip, deflate, br' \
-H 'X-CSRF-Token: <csrf token>' \
-H 'X-Requested-With: XMLHttpRequest' \
-H 'Content-Type: application/json' \
-H 'Origin: https://gitlab.com' \
-H 'Connection: keep-alive' \
-H 'Cookie: <cookies>' \
-H 'Sec-Fetch-Dest: empty' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Site: same-origin' \
-H 'TE: trailers' \
--data-raw '{"deploy_token":{"expires_at":"2022-10-17T22:00:00.000Z","name":"CI release","read_repository":false,"read_registry":false,"username":""}}'
Output of checks
This bug happens on GitLab.com. This was tested on Firefox 105.0.3 (64-bit) on Ubuntu 22.04.
/label reproduced on GitLab.com
Results of GitLab environment info
Gitlab.com
Results of GitLab application Check
Expand for output related to the GitLab application check
Gitlab.com