-
Notifications
You must be signed in to change notification settings - Fork 86
Description
Problem
We need to find a way to add available GithubAppInstallations
for a User
that the user has access to for the GitHub App.
We'll have to refresh this data by hitting GitHub's API endpoint for listing a user's installations.
We may want an endpoint for this at our own /user/github-app-installations
. We could also consider having this simply be available to a User
on the UserView
, but this may confuse things with an existing GithubAppInstallations
relationship. We could perhaps rename the key to something like available-github-app-installations
but keep the type github-app-installation
.
Alternatively, we could also rename the user
relationship in GithubAppInstallation
to sender
, which is more in-line with GitHub's own API and can reduce some confusion there.
Activity
joshsmith commentedon Jul 19, 2017
This could definitely use some thoughts @begedin.
begedin commentedon Jul 20, 2017
The way I see it, this goes two ways
If this is a relationship we want to store locally, then we need to add it to the user, rename the existing
user
relationship on theGithubAppInstallation
tosender
orinstaller
. Add anowner
or something as a second user relationship. The user can then haveaccessible_github_app_installations
andinstalled_github_app_installations
.Then we can deal with it through
ember-data
and modelsIf it's something we fetch at one point and simply pass on as JSON to the user, then I see the benefit of having a special endpoint for it. In that case, we should probably be circumventing
ember-data
as well and simply have a computed filter the data directly.Either way, I'm leaning against scheduled/periodic refreshes just to store the records locally. If we want to store them, we should identify the cases where they change and store them.
Automatic refreshes sound like we're almost bruteforcing it and I don't like doing that until we've exhausted our options.
begedin commentedon Oct 2, 2017
I was sure I already updated this, but apparently not.
Our agreed upon approach is the following
[]
github_id
fields in our local database.With implementation and tests, I don't think we would need to go over 4 hours for this.