List only main, develop and open-PR branches as spec versions - #252
Merged
Conversation
…uest #249 filtered on branch existence, which still left merged-but-undeleted branches in the picker: production advertised 9 branches, of which one had an open pull request. The listing is now main + develop + every branch with a pull request in flight. Anything else is a unit of work rather than a version of the specification. Routing stays permissive, and the advertisability filter moved out of getSpecVersions() into getListedSpecVersions() to keep it that way. Filtering during discovery would unroute those deployments as well as hide them, so a preview link shared on a pull request would break the moment it merged — the opposite of what is wanted. (This also fixes that for dependabot/*, which #249 had inadvertently unrouted.) dependabot/* stays unadvertised even while its pull request is open: a dependency bump is not a version of the specification. ballot/* is no longer special-cased. A ballot is listed while its pull request is open, and afterwards lives on as the frozen archive entry if adopted, or as an unlisted but still-resolvable preview URL. Simulated against live data the listing becomes the archive, develop and issue/184-schedule-model, dropping 7 merged branches. Note the token permission changes with the endpoint: /pulls requires Pull requests: Read-only, where /branches needed Contents: Read-only. Documented in site/.env.example and site/README.md. Resolves: #251
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
jgeluk
requested review from
FroehlichMarcel,
joshcornejo,
matthiasautrata,
rivettp and
tonyseale
as code owners
August 21, 2026 12:30
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.
Fixes #251. Follow-up to #249.
Rule
The picker now lists
main(archive) +develop+ every branch with an open pull request. Simulated against live data:9 → 2 branches. Every drop is a branch whose PR has already merged.
The filter had to move
isAdvertisableBranch()was being applied insidegetSpecVersions()— the function the middleware routes with. Excluding a prefix there does not just hide a deployment, it unroutes it, so a preview link shared on a pull request would 404 the moment it merged.It now applies only in
getListedSpecVersions(). Routing stays permissive, listing is opinionated. This also repairsdependabot/*, which #249 had inadvertently unrouted.Two smaller decisions
dependabot/*stays unadvertised even while its PR is open — a dependency bump is not a version of the specification. One entry inUNADVERTISED_BRANCH_PREFIXESif you want it back.ballot/*is no longer special-cased. It is listed while its PR is open, and afterwards lives on either as the frozen archive entry (if adopted) or as an unlisted but still-resolvable preview URL. This supersedes the note added in Spec versions page lists deleted branches: GitHub filter fails open #249.Token permission changes
The endpoint changed, so the permission does too:
GET /repos/{owner}/{repo}/branchesContents: Read-onlyGET /repos/{owner}/{repo}/pullsPull requests: Read-onlyPull requests: Read-onlyneeds adding to the token before this merges, or the picker will correctly degrade to the archive anddevelopwith the "Branch list unavailable" notice, and logResource not accessible by personal access token.Contentscan be dropped.tsc --noEmitandpnpm buildclean.🤖 Generated with Claude Code
https://claude.ai/code/session_01VHbek1ZojYktiTaeFqChqA