Exposing Project Labels in the REST API
The intent here is to expose the tag_list property of the Project entity over the REST API so that any project searches include the information. The specific reason I've implemented this change is for an environment in which multiple gitlab servers exist, where a central portal to the projects that are spread around the network will be useful. Having access to filtering on this fairly large project list based on their labels, will be of great use.
This satisfies the feature request http://feedback.gitlab.com/forums/176466-general/suggestions/6325819-project-labels-via-api
The change was made in the lib/api/entities.rb
file.
The output of a GET
to something like /projects
or /projects/7
is now:
{
"id": 7,
"description": "Veritatis est eaque voluptas magni expedita.",
"default_branch": "master",
**"tag_list": [
"typeahead",
"twitter"
],**
"public": false,
"archived": false,
"visibility_level": 0,
...
}
Merge request reports
Activity
@cabkarian Can you please update the API documentation for this feature as well as adding a testcase to verify the feature?
@cabkarian Can you please fix the changelog so your line is added to the 7.9 release?
/cc @DouweM Can we still merge this for 7.9?
Added 1086 commits:
- 29fc10f1...6c1074e3 - 1080 commits from branch
gitlab-org:master
- c9057fa7 - Modified lib/api/entities.rb to expose Project class tag_list property to the API
- 314902e7 - Updated projects.md to show tag_list field when performing GETs
- 58071ee6 - Fixed typo at projects.md
- 8f4b893a - Updated projects_spec.rb to include check for tag_list key in project list
- 8a53d5af - Moved changes into 7.10 section of the CHANGELOG
- ffd3df3a - Merge branch 'feature_expose_project_labels' of gitlab.com:cabkarian/gitlab-ce i…
Toggle commit list- 29fc10f1...6c1074e3 - 1080 commits from branch
@cabkarian Sorry. To answer you question:
You can solve that by adding a new remote to your git repository. In this case:
git remote add upstream git@gitlab.com:gitlab-org/gitlab-ce.git
Then you can simply usegit pull upstream master
.It seems something went wrong whith your last push. You now add 10 commits and have 2 lines in the
CHANGELOG
.
Can you please fix that? Sorry for the hassle.Added 359 commits:
- ffd3df3a...0d0042d2 - 358 commits from branch
gitlab-org:master
- dfd98a2e - Modified lib/api/entities.rb to expose Project class tag_list property to the API
- ffd3df3a...0d0042d2 - 358 commits from branch
Added 1 commit:
- f0454905 - Modified lib/api/entities.rb to expose Project class tag_list property to the API
@haynes Looks good to me, merge if you agree :)