Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I retrieve a Gitlab Project tag list through the API?

Tags:

rest

gitlab

I'm writing a REST client to look at project information available from several gitlab servers at the same time in one consolidated place. I understand REST and am able to pull the project details I need except one: the tags.

I'm not talking about git repository tags, those I'm able to get to just fine. I'm referring to the tags that are set under Project Settings. These are tags that, from what I can tell, are meant to be a form of describing the project, not referencing a particular commit hash.

like image 681
tryexceptpass Avatar asked Nov 14 '25 11:11

tryexceptpass


2 Answers

I submitted a merge request back to the Gitlab folks, if accept, any REST call that involves a Project class will include a "tag_list" field with all the project labels.

The merge request is available here: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/329

EDIT: This was merged in Gitlab version 7.10.0 so now you can just run a GET on the Project and the tag_list will be included with the JSON response.

like image 125
tryexceptpass Avatar answered Nov 17 '25 07:11

tryexceptpass


Not possible: ACCEPTING MERGE REQUEST at: http://feedback.gitlab.com/forums/176466-general/suggestions/6325819-project-labels-via-api , so feel free to implement it if you need it.

Should be simple: just return the project.tag_list (see: https://github.com/mbleigh/acts-as-taggable-on) as a JSON list from https://github.com/gitlabhq/gitlabhq/blob/41518a467dcef61deca24ad2f6205c6fd5706e1b/lib/api/projects.rb#L60

Always check the request tracker first for features ;) True, in this case you may have done it an not found because of label vs tag keyword confusion, I think it was renamed at some point, so always search for both.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!