Skip to content

Implemented being able to set a tag_list when creating and updating a project. #172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 15, 2018

Conversation

jimrinhealthcare
Copy link
Contributor

I've left a note in for the V3 API section as I wasn't sure if you'd prefer to just ignore tag lists here (Gitlab doesn't appear to do anything with them if you send them) or throw some sort of exception.

I've added what I think the unit test changes should be, but couldn't work out what needed setting up to run them.

@@ -646,10 +646,20 @@ public Project createProject(Project project, String importUrl) throws GitLabApi
if (isApiVersion(ApiVersion.V3)) {
boolean isPublic = (project.getPublic() != null ? project.getPublic() : project.getVisibility() == Visibility.PUBLIC);
formData.withParam("public", isPublic);

if (project.getTagList() != null && !project.getTagList().isEmpty()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would prefer to throw the following exception:

IllegalArgumentException("GitLab API v3 does not support tag lists when creating projects")

@@ -877,10 +887,20 @@ public Project updateProject(Project project) throws GitLabApiException {
formData.withParam("visibility_level", project.getVisibilityLevel());
boolean isPublic = (project.getPublic() != null ? project.getPublic() : project.getVisibility() == Visibility.PUBLIC);
formData.withParam("public", isPublic);

if (project.getTagList() != null && !project.getTagList().isEmpty()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above comment about throwing an exception.

@gmessner
Copy link
Collaborator

@jimrinhealthcare
Thank you for your contribution. I am going to go ahead and merge this as 4.8.10 is being ready for release and it would be good to have this in the release. I will add the exception after it is merged.

@gmessner gmessner merged commit 865a863 into gitlab4j:master Apr 15, 2018
gmessner added a commit that referenced this pull request Apr 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants