Skip to content

Repository picker: GitHub App setup maps the installation; people pick repositories, a queued job makes them projects (sc-9027) - #153

Merged
ndbroadbent merged 7 commits into
mainfrom
repository-picker
Dec 4, 2026
Merged

ndbroadbent merged 7 commits into
mainfrom
repository-picker

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Nathan's design after the 3 Dec setup incident. Setting up DocSpring's "all repositories" installation made a project per repository inside the /github/setup request. It made 7 before the request hit the app's 30 s limit and returned 503.

What changes

  • Setting up makes no projects. set_up only maps the installation to its organization. That's a few GitHub calls at most, so it answers at once. The reinstall match (by account) and the claim checks are unchanged.
  • The repository picker (/{org}/repositories, where setup now lands). It lists every repository the person can reach through the org's installations, with checkboxes, search, 50 a page, and the ones already linked marked "Already a project". Repositories they can't add say why ("You're write", "Archived").
    • Each installation can have its own picker (?installation=), with account tabs when there are several.
    • "Add repositories" on the org page, and "Pick its repositories" in the checklist, open it later.
  • The data comes from sign-in. GitHub sign-in already fetched /user/installations/{id}/repositories with permissions. It now keeps the result in user_repositories, so the picker makes no GitHub calls. When an installation is known only from the webhook, /github/setup sends the person through sign-in once. "Refresh from GitHub" does the same on demand.
  • Picked repositories become projects in a queued job (ImportRepositories, a repository_imports row). It takes at most 50 per pick, links them one by one through link_repository's checks, and saves progress after each. The page polls and shows it, then "Next: add VisualCI to CI".
    • /status gains stalled_repository_import_seconds.
    • Talira infra: a Gatus threshold of about 600 s would catch a dead queue.
  • Repositories added on GitHub later never become projects by themselves. The installation_repositories webhook no longer creates projects.
  • repositories is now a reserved slug, because of the new route.

Tests (app/tests/installations.rs)

  • An org with 300 repositories on "all": setup takes 5 GitHub calls or fewer and under 5 s, and makes no projects. The picker pages and searches with zero GitHub calls. Picking 2 makes exactly 2, and picking 51 is refused.
  • Uninstall plus reinstall with a new ID: projects move to the new installation, with no new org and no new projects.
  • A stranger's installation (an account with no VisualCI user) stays unclaimed. Its installation, push, workflow_run and installation_repositories deliveries answer 200, with no failed jobs and no projects.
  • One person with two installations (their own account and an org) gets the right org for each, and a separate picker for each.
  • Existing tests are updated: a personal account maps to the personal org, someone else can't claim it, setup lands on the picker, and webhooks never make projects.

Journeys. The GitHub stub now plays the App's side: install with an account choice, signed webhooks, the redirect to the Setup URL, installation tokens, repositories and permissions. The runner configures a throwaway App key and webhook secret. New journeys:

  1. Set up with 300 repositories, then page, search, pick 2 and watch progress through to the next step.
  2. A reinstall keeps the org and its projects.
  3. Personal and organization installations, each with its own picker; someone else gets "isn't yours".
  4. A stranger's installation stays unclaimed.

Screenshots. The seed adds Acme's installation with 60 repositories, and a half-made pick in side-project. New screenshots: app/repositories, app/repositories/search and app/repositories/progress.

Docs. The quick start, the docs index, the visualci skill (plugin 0.1.53) and docs/design.md.

Not covered: a guard across every request handler (rather than these onboarding ones) that bounds GitHub calls. It needs a per-request counter in the GitHub client: sc-9124.

Plain search values in addresses. TanStack Router's default serialiser JSON-quotes a string that looks like a number. So the setup landing (/acme/repositories?installation=7) was rewritten to ?installation=%227%22, and so was the org page's ?installation=. The router now writes plain values (frontend/src/search.ts, with tests), and only objects and arrays go through JSON. Routes already convert what they read (String(search.installation), Number(search.page)). The journey now fails if the picker's address isn't a plain number. It doesn't read the old quoted form: no released link ever had it (the server always redirects with a plain id), and we don't keep compatibility shims before launch.

@visualci-com

visualci-com Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

VisualCI

docspring/visualci · build #270 · 20 added, 341 unchanged · approved by visualci features agent for Nathan Broadbent

The rebase of #153 onto main: the same picker snapshots approved in build 263 (identical images).

This PR vs base: 1 changed since #240, across 4 builds

Snapshot Before After
screenshots/app/repositories/1440-dark (added) –
screenshots/app/repositories/1440-dark-2x (added) –
screenshots/app/repositories/1440-light (added) –
screenshots/app/repositories/1440-light-2x (added) –
screenshots/app/repositories/390-dark (added) –
screenshots/app/repositories/390-dark-2x (added) –
screenshots/app/repositories/390-light (added) –
screenshots/app/repositories/390-light-2x (added) –
and 12 more in the build

docspring/visualci · journeys · build #272 · 14 added, 14 unchanged · approved by visualci features agent for Nathan Broadbent

The rebase of #153 onto main: the same picker journeys approved in build 260.

This PR vs base: nothing since #238, across 4 builds

Snapshot Before After
journeys/personal-and-organization-installations/01-site (added) –
journeys/personal-and-organization-installations/02-own-account-picker (added) –
journeys/personal-and-organization-installations/03-organization-picker (added) –
journeys/personal-and-organization-installations/04-site (added) –
journeys/personal-and-organization-installations/05-not-yours (added) –
journeys/reinstall-keeps-the-organization-and-projects/01-site (added) –
journeys/reinstall-keeps-the-organization-and-projects/02-picker-after-reinstall (added) –
journeys/setup-picks-from-300-repositories/01-site (added) –
and 6 more in the build

Updated as builds change. Agents can review with VisualCI's MCP tools.

…r and a queued job make the ones people choose
…eople pick the repositories, a queued job makes them into projects (sc-9027)
…and keep a long name's badge on its row on a phone
…router's JSON-quoted %225002%22; the journey checks the picker's address is plain
…" with a tooltip), pick all on a page, "Add repositories" when nothing is picked; an empty org shows one install button
@ndbroadbent
ndbroadbent merged commit 6a7a1dc into main Dec 4, 2026
14 checks passed
@ndbroadbent
ndbroadbent deleted the repository-picker branch December 4, 2026 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant