-
Notifications
You must be signed in to change notification settings - Fork 479
Add Release Api #211
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
Add Release Api #211
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eutkin
Thank you for the contribution. Looks good, just a few small changes are requested.
@@ -1,21 +1,18 @@ | |||
package org.gitlab4j.api; | |||
|
|||
import org.gitlab4j.api.models.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is good practice to not use wildcard imports, please change this to only import the types being used.
@@ -1,5 +1,13 @@ | |||
package org.gitlab4j.api; | |||
|
|||
import org.gitlab4j.api.GitLabApi.ApiVersion; | |||
import org.gitlab4j.api.models.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is good practice to not use wildcard imports, please change this to only import the types being used.
import java.util.Date; | ||
import java.util.List; | ||
|
||
import static org.junit.Assert.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is good practice to not use wildcard imports, please change this to only import the types being used.
import org.gitlab4j.api.models.Commit; | ||
import org.gitlab4j.api.models.Diff; | ||
import org.gitlab4j.api.models.Project; | ||
import org.gitlab4j.api.models.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is good practice to not use wildcard imports, please change this to only import the types being used.
public enum RefType { | ||
branch, tag, all | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All enums should be uppercase, and to make the enum work correctly with this library this enum should look like this:
public enum RefType {
BRANCH, TAG, ALL;
private static JacksonJsonEnumHelper<RefType> enumHelper = new JacksonJsonEnumHelper<>(RefType.class);
@JsonCreator
public static RefType forValue(String value) {
return enumHelper.forValue(value);
}
@JsonValue
public String toValue() {
return (enumHelper.toString(this));
}
@Override
public String toString() {
return (enumHelper.toString(this));
}
}
ok, i done, thank you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good, thanks for making them.
@eutkin |
@eutkin Just a heads up. The createRelease() and updateRelease() methods along with all the tag related methods have been moved to a new API called TagsApi. This was done as this library tries to maintain a one-to-one relationship with the GitLab API docs, and these methods are all in the Tags API at: Thanks again for your contribution. |
https://docs.gitlab.com/ee/api/tags.html#create-a-new-release
https://docs.gitlab.com/ee/api/tags.html#update-a-release