Skip to content
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

Merged
merged 5 commits into from
Nov 25, 2015
Merged

Support for merge_commit_sha #231

merged 5 commits into from
Nov 25, 2015

Conversation

recena
Copy link
Contributor

@recena recena commented Nov 15, 2015

GHPullRequest object now includes merge_commit_sha

@reviewbybees specially, @oleg-nenashev

* FYI: https://developer.github.com/changes/2013-04-25-deprecating-merge-commit-sha
*/
@Deprecated
public String getMergeCommitSha() throws IOException {
Copy link
Collaborator

Choose a reason for hiding this comment

The 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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@oleg-nenashev Any recommendation here to improve it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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 get() method returns null. I think that is ok.

Copy link

Choose a reason for hiding this comment

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

Right. This line is preventing to fail on missing properties.

Copy link
Contributor

Choose a reason for hiding this comment

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

@oleg-nenashev @CheckForNull?

@ghost
Copy link

ghost commented Nov 15, 2015

This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation.

@@ -142,9 +145,9 @@ public PullRequest getPullRequest() {
}

//
// details that are only available via get with ID
//
//
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unrelated changes but...

Copy link
Collaborator

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 :)

Copy link
Contributor Author

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.

@lanwen
Copy link
Contributor

lanwen commented Nov 16, 2015

why you want to use deprecated field?

@KostyaSha
Copy link
Contributor

@lanwen because it can be valid for some unknown time or on some ancient enterprise installations?

@@ -186,6 +189,15 @@ public int getChangedFiles() throws IOException {
}

/**
* FYI: https://developer.github.com/changes/2013-04-25-deprecating-merge-commit-sha
Copy link
Contributor

Choose a reason for hiding this comment

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

javadoc @link?

Copy link
Contributor

Choose a reason for hiding this comment

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

javadoc @deprecated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure.

@amuniz
Copy link

amuniz commented Nov 16, 2015

🐝

@recena
Copy link
Contributor Author

recena commented Nov 17, 2015

@reviewbybees done

@oleg-nenashev
Copy link
Collaborator

👍

@jglick
Copy link
Contributor

jglick commented Nov 20, 2015

Does not make sense to introduce a deprecated API, especially as this will probably still working in v4.

@KostyaSha
Copy link
Contributor

probably makes sense call variable in camel case according to java convention and use Json annotation.

@recena
Copy link
Contributor Author

recena commented Nov 20, 2015

@jglick if you don't need to use it, simply ignore it. GH API V4 is not planned, there is not a date. While this happens this attribute is the only way to resolve some problems.

@recena
Copy link
Contributor Author

recena commented Nov 20, 2015

@jglick make sense to include not documented behaviors? For example, retrieve /merge spec???

@recena
Copy link
Contributor Author

recena commented Nov 20, 2015

@KostyaSha I agree but I tried to follow the current conventions in this project.

@recena
Copy link
Contributor Author

recena commented Nov 21, 2015

@jglick I apologize. I understood wrong your comment. I should read twice before to reply. Specially, when I read english text.

@recena
Copy link
Contributor Author

recena commented Nov 21, 2015

@jglick I'm going to remove the tag @decrecated.

@recena
Copy link
Contributor Author

recena commented Nov 23, 2015

@jglick @deprecated annotations were removed.

@ndeloof
Copy link
Contributor

ndeloof commented Nov 23, 2015

LGTM

@recena
Copy link
Contributor Author

recena commented Nov 25, 2015

@reviewbybees done

@jglick
Copy link
Contributor

jglick commented Nov 25, 2015

Belated 🐝.

I do not think we really want to be using this API. But I see no harm in exposing it via the library. It is up to the caller whether to rely on it or not. I presume that if and when the field is deleted from the JSON by GH, getMergeCommitSha will simply return null and that is that.

@ghost
Copy link

ghost commented Nov 25, 2015

This pull request has completed our internal processes and we now respectfully request the maintainers of this repository to consider our proposal contained within this pull request for merging.

@recena
Copy link
Contributor Author

recena commented Nov 25, 2015

@jglick If a field is removed from GitHub API, its getter asociated will return null.

recena added a commit that referenced this pull request Nov 25, 2015
@recena recena merged commit f7d1327 into hub4j:master Nov 25, 2015
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.

7 participants