Repository navigation
app/: onboarding through the GitHub App (sc-9027, PR 1 of 3) - #116
Open
ndbroadbent wants to merge 2 commits into
Open
ndbroadbent wants to merge 2 commits into
ndbroadbent wants to merge 2 commits into
Conversation
…s recorded from sign-ins and webhooks; GET /github/setup maps an installation to an organization and makes a project per repository the person can maintain; no Default project; checklist install_github_app → add_to_ci → connect_agent → review_changes
…b (own account, an owner of the organization, or its installer) before any organization or mapping is written; the mapping is written only where none exists; GET /github/setup sets up only the install this browser started (state); personal organization by ID; orphaned goldens removed
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sc-9027, PR 1 of 3: the backend for onboarding through the GitHub App. Signing up now makes an empty personal organization. Installing the App makes the projects.
Installations
github_installations: the installation, its account (id, login, type), the organization it was set up for, who set it up,suspended_at,deleted_at, and the last set-up's result.user_installations: which installations each person can reach.installationwebhook:created,unsuspendandnew_permissions_acceptedrecord the installation, and the installer can reach it at once.suspendmarks it suspended.deletedmarks it removed and clears who can reach it. The row stays, so a reinstall maps back to the same organization.installation_repositories:added, on an installation that's been set up, makes projects in its organization (as the sender if they're an admin there, else as whoever set it up).removedkeeps today's behaviour: the installation is detached from the linked projects, so checks stop. The repository URL is kept, so adding the repository back reattaches the same project instead of making a duplicate.Setup URL:
GET /github/setup?installation_id=…(app host). Set this as the GitHub App's Setup URL./{org}?setup=add_to_ci&installation={id}.githubis now a reserved organization slug.Setting an installation up (
forge::installations::set_up, alsoPOST /api/ui/installations/{id}/setupfor the checklist's "already installed on X" offer). It's safe to run again: repositories already linked are left as they are.<login>-githubwith a note when that's taken; name from GitHub; the installer is admin. Other people join through the hourly sync.link_repository's checks.truncatedwhen there are more.Checklist
install_github_app → add_to_ci → connect_agent → review_changes, withcreate_projectgone.install_github_appis done once an installation is set up for the organization.install_url;installations: the person's installations, each with its organization, ornullfor an offer;github: each installation set up for this organization, with its last set-up result, for the "repos you can't Maintain" list.PR 2 (frontend) and PR 3 (end-to-end onboarding test) follow. Sign-ups stay closed until PR 3 is green and Nathan has walked through it.
Tests:
tests/installations.rs, covering:setup.rsandorganizations.rsare updated. The full suite passes on a build box with Postgres 17 and RustFS.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.