-
Notifications
You must be signed in to change notification settings - Fork 57
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 new field in PullRequest Object #50
Conversation
*/ | ||
@AutoValue | ||
public abstract class Properties { | ||
public abstract Long openTaskCount(); |
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.
If not nullable we can use long
instead of boxed version. Same for resolvedTaskCount
.
public static Reference create(String id, MinimalRepository repository) { | ||
return new AutoValue_Reference(id != null ? id : "refs/heads/master", repository); | ||
@SerializedNames({"id", "repository", "displayId"}) | ||
public static Reference create(String id, MinimalRepository repository, String displayId) { |
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.
Can we create overloaded constructor here. Previous can default to setting this property to say the id
.
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.
I don't understand what you mean.
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.
Constructor was the wrong word, my apologies. Overloaded versions of create
:
public static Reference create(String id, MinimalRepository repository) {
public static Reference create(String id, MinimalRepository repository, String displayId) {
The first can delegate to the second passing in whatever value id
is to displayId
.
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.
Ha ok, but Id and displayId isn't same value from api. Exemple for master branch :
id: "refs/heads/master",
displayId : "master"
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.
Ok. Then maybe check for non-null and if so split on /
and use last index? Something like this might work.
public static Reference create(String id, MinimalRepository repository) {
String displayId = null;
if (id != null) {
String parts [] = id.split("/");
displayId = parts[parts.length];
}
return create(id, repository, displayId);
}
And add a @deprecated annotation to the create(String id, MinimalRepository repository)
method.
CreatePullRequest cpr = CreatePullRequest.create(randomChars, "Fix for issue " + randomChars, fromRef, toRef, null, null); | ||
|
||
System.out.println("---------> CREATED PR: " + cpr); |
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.
Mind taking out this line while you're here poking around? :)
@j0nathan33 thanks splitting up the PR. Added some comments to address. Looks good. Thanks. |
*/ | ||
@AutoValue | ||
public abstract class Properties { | ||
public abstract long openTaskCount(); |
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.
Can we put a newline between class definition and openTaskCount
?
|
||
/** | ||
* Created by jdoire on 07/03/2017. | ||
*/ |
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.
Lets remove these Created by
comments.
@j0nathan33 minor issue with the "overloaded" change but I'll fix that on this end. Thanks for the PR! |
No description provided.