Skip to content
This repository has been archived by the owner on Jun 11, 2020. It is now read-only.

Organisations: List organisation repositories on the "add repositories" page, so they can be added to the dashboard [4] #620

Closed
5 tasks
nottrobin opened this issue Apr 11, 2017 · 6 comments · Fixed by #690
Assignees
Milestone

Comments

@nottrobin
Copy link
Contributor

nottrobin commented Apr 11, 2017

  • Ensure organisation repository information is being pulled from GitHub on sign-up
  • Ensure already added organisations are greyed out
  • List organisation repositories in /select-repositories
  • Ensure organisation repositories can be added to the dashboard
  • We need to ensure that only repositories for which the user is an "admin" are shown
@matthewpaulthomas
Copy link
Contributor

As I see it, there are five possibilities. You can add a repo if:
A. You’re the owner
B. You have Admin permission, and if it’s an organization repo, you’re a member of the organization
C. You have Admin permission (even if you’re an outside collaborator)
D. You have Write permission, and if it’s an organization repo, you’re a member of the organization
E. You have Write permission (even if you’re an outside collaborator).

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

@nottrobin
Copy link
Contributor Author

@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.

@bartaz
Copy link
Contributor

bartaz commented Apr 21, 2017

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

@nottrobin nottrobin changed the title List organisation repositories on the "select repositories" page, so they can be added to the dashboard List organisation repositories on the "add repositories" page, so they can be added to the dashboard Apr 21, 2017
@matthewpaulthomas matthewpaulthomas self-assigned this Apr 21, 2017
@matthewpaulthomas
Copy link
Contributor

Specification updated. Summary of changes:

  • Empty state “Want to use an organization repo or private repo?” becomes “Want to use a private repo?”
  • Empty state gains new help text for “Don’t have admin permission?”
  • “Organization and private repos not shown yet.” becomes “Private repos not shown yet.”

@matthewpaulthomas matthewpaulthomas removed their assignment Apr 21, 2017
@nottrobin nottrobin changed the title List organisation repositories on the "add repositories" page, so they can be added to the dashboard Organisations: List organisation repositories on the "add repositories" page, so they can be added to the dashboard Apr 21, 2017
@ghost ghost added the Status: Next label Apr 24, 2017
@cjwatson cjwatson self-assigned this Apr 24, 2017
@cjwatson
Copy link
Contributor

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

@ghost ghost removed the Confirmed label Apr 24, 2017
@cjwatson cjwatson changed the title Organisations: List organisation repositories on the "add repositories" page, so they can be added to the dashboard Organisations: List organisation repositories on the "add repositories" page, so they can be added to the dashboard [4] Apr 25, 2017
@cjwatson
Copy link
Contributor

The LP change above is now on production, and I'm proceeding with the BSI side of things.

cjwatson added a commit to cjwatson/build.snapcraft.io that referenced this issue Apr 27, 2017
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.
cjwatson added a commit that referenced this issue Apr 27, 2017
* 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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants