-
Notifications
You must be signed in to change notification settings - Fork 735
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
Support for merge_commit_sha #231
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,7 @@ public class GHPullRequest extends GHIssue { | |
private int deletions; | ||
private String mergeable_state; | ||
private int changed_files; | ||
private String merge_commit_sha; | ||
|
||
/** | ||
* GitHub doesn't return some properties of {@link GHIssue} when requesting the GET on the 'pulls' API | ||
|
@@ -142,9 +143,9 @@ public PullRequest getPullRequest() { | |
} | ||
|
||
// | ||
// details that are only available via get with ID | ||
// | ||
// | ||
// details that are only available via get with ID | ||
// | ||
|
||
public GHUser getMergedBy() throws IOException { | ||
populate(); | ||
return merged_by; | ||
|
@@ -185,6 +186,14 @@ public int getChangedFiles() throws IOException { | |
return changed_files; | ||
} | ||
|
||
/** | ||
* See <a href="https://developer.github.com/changes/2013-04-25-deprecating-merge-commit-sha">GitHub blog post</a> | ||
*/ | ||
public String getMergeCommitSha() throws IOException { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens if the field disappears? Does the method return null in such case? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When this happens, GitHub API v4 will be released and we should review the current status (compatibility). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @oleg-nenashev Any recommendation here to improve it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @oleg-nenashev I've checked that if your model has an attribute and is not mapped in the JSON, its There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right. This line is preventing to fail on missing properties. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @oleg-nenashev |
||
populate(); | ||
return merge_commit_sha; | ||
} | ||
|
||
/** | ||
* Fully populate the data by retrieving missing data. | ||
* | ||
|
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.
Unrelated changes but...
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.
Makes sense to convert the comment to Javadoc then :)
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.
Really, it is not a method comment, only a note in the middle of the file.