Allow `max_artifact_size` to be changed via the REST API
What does this MR do and why?
Allow max_artifact_size to be changed via the REST API. This will be available for both Groups and Projects.
Note This will be only available for users who are admins
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Before | After |
|---|---|
How to set up and validate locally
Note These instructions work for Projects, but changing the URL to http://gdk.test:3000/api/v4/groups/<group_id> should work the same
- Create a Personal Access Token with the following scopes
api, read_api, read_user, admin_modefor a user that has access to the admin area - Get the ID of the Project you want to change the
max_artifacts_sizeattribute - Validate that you can read the new attribute when checking out the branch locally using
curl --header "PRIVATE-TOKEN: <token>" "http://gdk.test:3000/api/v4/projects/<project_id>"
This will return a JSON response, look for max_artifacts_size
{
...
"warn_about_potentially_unwanted_characters":true,
"autoclose_referenced_issues":true,
"max_artifacts_size":null,
"approvals_before_merge":0,
"mirror":false,
}
- Make a
PUTrequest to update the Project
curl --request PUT --header "PRIVATE-TOKEN: <personal_access_token>" --url "http://gdk.test:3000/api/v4/projects/<project_id>" --data "max_artifacts_size=1"
Example response
{
...
"warn_about_potentially_unwanted_characters":true,
"autoclose_referenced_issues":true,
"max_artifacts_size":1,
"approvals_before_merge":0,
"mirror":false,
}