-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Additional GitHub Apps APIs #1854
Conversation
8acddd0
to
b446b5a
Compare
b446b5a
to
87c2022
Compare
1e5d95f
to
b4b1fe8
Compare
👀 |
I'm still dogfooding these. |
I'm noticing a nuanced difference in the way some responses are delivered that is throwing this off.. https://developer.github.com/v3/apps/installations/#response |
cc: @shiftkey ☝️ |
Nvm, I learned things today... |
@StanleyGoldman is this related to the |
Yea, I was just mentally unprepared for things to be different between api calls like that. |
4b6cd2c
to
40bd9dc
Compare
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.
Hey @StanleyGoldman it's looking pretty good, ive made some reviwe comments/thoughts just on the Observable client since that was first in the list, but the comments apply to the regular client too.
In general
-
I havent marked up every XMlDoc inconsistency - we will need to get the comments and param entries right, but we can focus on that once we have the main code etc done
-
we should think about the naming of the mehtods corrresponding to "find" endpoints as im not sure
Getxxx
is the best for those. I suggested a couple of options - which do you think sounds better? -
since the authentication for github apps, installations and user-to-server oauth is so complex, we probably need to indicate in the XmlDoc comments of every endpoint what type of auth it requires
-
any endpoint taking repo
/repos/:owner
/:name
we also by convention, support the "undocumented" endpoint/repositories/:id/
Also im not sure of the historic reasons but the main client and interface for both the Observable and normal clients live in the top level folder with all sub clients in the Clients folder below there. I see you renamed/moved the Observable one into the Clients folder but didnt do the same thing for the normal client. In general id say we shouldnt move things since it makes tracing history more difficult, unless its a really good reason... and if you think it IS a good reason, we should at least be consistent and do it for normal and observable 😁
/// <remarks> | ||
/// Refer to the API documentation for more information: https://developer.github.com/v3/apps/installations/ | ||
/// </remarks> | ||
IObservableGitHubAppsInstallationsClient Installations { get; } |
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.
The property name should be singular, eg github.App.Installation.xxxx
/// <remarks>https://developer.github.com/v3/apps/#find-repository-installation</remarks> | ||
/// <param name="owner">The owner of the repo</param> | ||
/// <param name="repo">The name of the repo</param> | ||
IObservable<Installation> GetRepositoryInstallation(string owner, string repo); |
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 wonder if this should be named GetRepositoryInstallationForCurrent()
since it uses the currently authenticated GitHub App... or otherwise FindRepositoryInstallation()
?
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.
also we need to support the repositoryId
version of this call in addition to the owner/repo
version
IObservable<Installation> GetRepositoryInstallation(string owner, string repo); | ||
|
||
/// <summary> | ||
/// Enables an authenticated GitHub App to find the repository's installation information. |
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.
comment says repository but should be organization
/// Enables an authenticated GitHub App to find the repository's installation information. | ||
/// </summary> | ||
/// <remarks>https://developer.github.com/v3/apps/#find-organization-installation</remarks> | ||
/// <param name="owner">The owner of the repo</param> |
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.
incorrect params
/// <remarks>https://developer.github.com/v3/apps/#find-organization-installation</remarks> | ||
/// <param name="owner">The owner of the repo</param> | ||
/// <param name="repo">The name of the repo</param> | ||
IObservable<Installation> GetOrganizationInstallation(string organization); |
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.
GetOrganizationInstallationForCurrent or FindOrganizationInstallation?
/// <remarks>https://developer.github.com/v3/apps/#find-user-installation</remarks> | ||
/// <param name="owner">The owner of the repo</param> | ||
/// <param name="repo">The name of the repo</param> | ||
IObservable<Installation> GetUserInstallation(string user); |
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.
GetUserInstallationForCurrent ? Or FindUserInstallation?
public interface IObservableGitHubAppsInstallationsClient | ||
{ | ||
/// <summary> | ||
/// List repositories of the authenticated GitHub App (requires GitHubApp JWT token auth). |
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.
The docs says this endpoint uses an installation token, not a JWT... and this would get repositories of an installation rather than a github app (which would have many installations each with potentially many repos)
So let's go with "List repositories of the authenticated installation (requires Installation Token auth)" or something similar
IObservable<RepositoriesResponse> GetAllRepositoriesForCurrent(); | ||
|
||
/// <summary> | ||
/// List repositories of the authenticated GitHub App (requires GitHubApp JWT token auth). |
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.
same as above
IObservable<RepositoriesResponse> GetAllRepositoriesForCurrent(ApiOptions options); | ||
|
||
/// <summary> | ||
/// List repositories accessible to the user for an installation. |
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.
Comment probably needs to indicate this requires a user to server OAuth token
e3e1ade
to
731bd2b
Compare
First off, sorry about my sloppiness, I was rushing so I can go and dogfood this. Thanks for reviewing.
|
579b1d7
to
fc1461b
Compare
I was gonna send the latest changes in a separate pull request, but then i got lazy. |
…to be consistent with single/plural naming conventions
Your changes so far get a 👍 from me. |
I think the last thing to do is unit tests for the observable client and ideally integration tests (at least for the things we can easily setup) |
…rts in Observable client
…rrect route that the tests found!
…d ObservableGitHubAppInstallationsClient
OK I think im done with adding unit and integration tests for EVERYTHING. Glad I did this too, as it found a few problems! 😀 |
Hey @StanleyGoldman these latest changes I already had a separate PR for #1857 and I also did them in a way that keeps the old models working for GHE 2.14 since it won't get these changes I think I did forget to add the start/end column members but we can just add that to the other PR and keep this one focused on the app/installation endpoints |
e71cc85
to
86d4514
Compare
Ah my bad, I was not aware of the nuance. |
release_notes: Implement additional endpoints for GitHub Apps to find installations for a given organization, repository or user |
release_notes: Implement GitHub Apps Installation API to allow listing all repositories a GitHub App Installation or GitHub App authenticated user has access to |
This API call comes in handy for integrators of GitHub Apps: