The source project of this merge request has been removed.
Expose :protected field for ../tags/:tag_name API endpoint
What does this MR do?
Just like the GET ../branches/:branch_name
API request returns the "protected":
boolean value for a specific branch, in #67127 (moved) it has been requested to do the same for GET ../tags/:tag_name
as the field is not provided.
According to the branches and tag API docs:
# GET /projects/:id/repository/branches/:branch_name
{
"name": "master",
"merged": false,
"protected": true,
"default": true,
"developers_can_push": false,
"developers_can_merge": false,
"can_push": true,
"commit": {
...
}
}
# GET /projects/:id/repository/tags/:tag_name
{
"name": "v5.0.0",
"message": null,
"target": "60a8ff033665e1207714d6670fcd7b65304ec02f",
"commit": {
...
},
"release": null
}
In this MR, I exposed the "protected":
field in the Tag < Grape::Entity
in the same fashion as it was done with the branch.
Screenshots
Running a proper GET /projects/:id/repository/tags/:tag_name
request now returns the boolean value.
Before | After |
---|---|
{ "name": "v5.0.0", "message": null, "target": "60a8ff033665e1207714d6670fcd7b65304ec02f", "commit": { ... }, "release": null |
{ "name": "v5.0.0", "message": null, "target": "60a8ff033665e1207714d6670fcd7b65304ec02f", "commit": { ... }, "release": null, "protected": true } |
Tested in a local GDK/GitLab-CE instance.
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry for user-facing changes, or community contribution. Check the link for other scenarios. -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Mention @gitlab-com/gl-security/appsec -
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Andrea Leone