Merge branch 'issue-67127' into 'master'

Expose :protected field for ../tags/:tag_name API endpoint

See merge request gitlab-org/gitlab-ce!32790
This commit is contained in:
Ash McKenzie 2019-09-10 00:49:53 +00:00
commit d7c1af988d
4 changed files with 17 additions and 4 deletions

View file

@ -0,0 +1,5 @@
---
title: Expose 'protected' field for Tag API endpoint.
merge_request: 32790
author: Andrea Leone
type: added

View file

@ -46,7 +46,8 @@ Parameters:
},
"name": "v1.0.0",
"target": "2695effb5807a22ff3d138d593fd856244e155e7",
"message": null
"message": null,
"protected": true
}
]
```
@ -94,7 +95,8 @@ Example Response:
"committer_email": "contact@arthurverschaeve.be",
"committed_date": "2015-02-01T21:56:31.000+01:00"
},
"release": null
"release": null,
"protected": false
}
```
@ -138,7 +140,8 @@ Parameters:
},
"name": "v1.0.0",
"target": "2695effb5807a22ff3d138d593fd856244e155e7",
"message": null
"message": null,
"protected": false
}
```

View file

@ -1312,6 +1312,10 @@ module API
options[:project].releases.find_by(tag: repo_tag.name)
end
# rubocop: enable CodeReuse/ActiveRecord
expose :protected do |repo_tag, options|
::ProtectedTag.protected?(options[:project], repo_tag.name)
end
end
class Runner < Grape::Entity

View file

@ -16,7 +16,8 @@
{ "type": "null" },
{ "$ref": "release/tag_release.json" }
]
}
},
"protected": { "type": "boolean" }
},
"additionalProperties": false
}