Organisations: List organisation repositories on the "add repositories" page, so they can be added to the dashboard [4] #620
Comments
As I see it, there are five possibilities. You can add a repo if: I thought yesterday’s conclusion was that we weren’t going to pay any attention to whether someone was an admin, ruling out B or C. So I’m not sure why “We need to ensure that only repositories for which the user is an ‘admin’ are shown”. @evandandrea can you clarify? (If we do pay attention to whether someone is an admin, we’ll need to notice and handle the case of an admin being demoted. But we need to handle the equivalent case for Write permission anyway.) |
@matthewpaulthomas This list was meant to be exhaustive in the sense that many of the items may happen implicitly or already be the case, it's just a check list. the reason the user needs to be an admin is because only then can we setup the webhooks. |
Only admins can add webhooks, so user needs to be an admin on given repository to add it to BSI (set up a webhook on GH to connect repo to LP). So I guess we shouldn't list any repos that user cannot add - so we should only list repos where user in an admin (regardless of ownership of the repo: user, org, collaborator). When user logs in (and first time authorizes BSI to access their GH) they give us rights and choose which of their orgs to allow us access. So by listing all user repositories we will get a list of all repos user has access to (own, collaboration, orgs). From that list we should filter only those where user is admin so they can effectively add it to BSI (set up the webhook). |
Specification updated. Summary of changes:
|
I've proposed https://code.launchpad.net/~cjwatson/launchpad/snap-find-by-url-prefixes/+merge/323035 as a prerequisite for this. (In order for it to be reasonable to list organisation repositories on the "add repositories" page, we need added repositories to show up on the "my repositories" page once you've added them; and to do that in a way that doesn't have terrible performance, we need something like this LP change.) |
The LP change above is now on production, and I'm proceeding with the BSI side of things. |
This shows organisation repositories for which the user has admin permissions in the add-repositories dialog, and shows organisation repositories that the user can write to on the my-repositories page. Various aspects of the UI will need to be tidied up in future PRs, but this at least gets us started. We now request the `read:org` scope from GitHub, which allows us to tell which organisations a user is in. Fixes canonical-web-and-design#620; fixes canonical-web-and-design#648.
* Sort repository list rows alphabetically * Add baseline support for organisation repositories This shows organisation repositories for which the user has admin permissions in the add-repositories dialog, and shows organisation repositories that the user can write to on the my-repositories page. Various aspects of the UI will need to be tidied up in future PRs, but this at least gets us started. We now request the `read:org` scope from GitHub, which allows us to tell which organisations a user is in. Fixes #620; fixes #648. * Make internalFindSnaps somewhat less confusing * Clear the correct memcached entries in newSnap
The text was updated successfully, but these errors were encountered: