Skip to content

Conversation

@eutkin
Copy link
Contributor

@eutkin eutkin commented Jul 3, 2018

Copy link
Collaborator

@gmessner gmessner left a 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.*;
Copy link
Collaborator

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.

package org.gitlab4j.api;

import org.gitlab4j.api.GitLabApi.ApiVersion;
import org.gitlab4j.api.models.*;
Copy link
Collaborator

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.*;
Copy link
Collaborator

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.*;
Copy link
Collaborator

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
}

Copy link
Collaborator

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));
    }
}

@eutkin
Copy link
Contributor Author

eutkin commented Jul 4, 2018

ok, i done, thank you

Copy link
Collaborator

@gmessner gmessner left a 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.

@gmessner gmessner merged commit e2ee6fe into gitlab4j:master Jul 5, 2018
@gmessner gmessner mentioned this pull request Jul 5, 2018
@gmessner
Copy link
Collaborator

gmessner commented Jul 5, 2018

@eutkin
This has been released in 4.8.28

@gmessner
Copy link
Collaborator

gmessner commented Jul 5, 2018

@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:
https://docs.gitlab.com/ce/api/tags.html

Thanks again for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants