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

Issues pull requests apiv3 #17

Merged
merged 8 commits into from
Sep 6, 2012

Conversation

janinko
Copy link
Collaborator

@janinko janinko commented Aug 31, 2012

Overview
I cleaned up GHIssue and GHPullRequest and make them relevant to api v3

Added SmallUser representing reference to user. In api this user is represented by:

    "user": {
        "login": "janinko",
        "avatar_url": "https://secure.gravatar.com/avatar/bf8425ee432f7e9748f9e1c540a125ed?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png",
        "url": "https://api.github.com/users/janinko",
        "gravatar_id": "bf8425ee432f7e9748f9e1c540a125ed",
        "id": 644267
    },

Added DetailedPullRequest - when retrieving pull request by id, it has more attributes then pull requests obtained by GHRepository.getPullRequests(). The attributes are:

merged_by - SmallUser
review_comments - int
additions - int
merged - boolean
mergeable - Boolean
deletions - int
mergeable_state - String ("unknown", "dirty", "clean")
changed_files - int

Possible issues
I'm not sure if change in b40677a is OK. I changed return value of GHRepository.getPullRequest(int) from GHPullRequest to its subclass GHDetailedPullRequest. IMO it shouldn't be causing any problems.

Added SmallUser representing reference to user.
Added DetailedPullRequest - when retrieving pull request by id, it has more attributes then pull requests obtained by GHRepository.getPullRequests()
I'm not sure whether this influence something or not, but I think it should be OK.
@buildhive
Copy link

Kohsuke Kawaguchi » github-api #26 SUCCESS
This pull request looks good
(what's this?)

@kohsuke kohsuke merged commit 4e27d1b into hub4j:master Sep 6, 2012
@kohsuke
Copy link
Collaborator

kohsuke commented Sep 6, 2012

Thank you for adding this.

As you noted, in various places, GitHub V3 API distinguishes shallow data representation vs full data representation. I've been meaning to deal with this by adding lazy population support --- the object will populate itself if a field is requested that it doesn't have yet.

I think that is easier to use for the client, and we can avoid having multiple classes for conceptually the same thing.

I've used your change as the opportunity to implement it, and I've updated your change accordingly. Specifically, I got rid of GHSmallUser in favor of GHUser, and ditto for GHDetailedPullRequest.

I've released 1.32 with this change.

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.

3 participants