Skip to content

List only main, develop and open-PR branches as spec versions - #252

Merged
jgeluk merged 1 commit into
developfrom
issue/251-list-only-pr-branches
Aug 21, 2026
Merged

List only main, develop and open-PR branches as spec versions#252
jgeluk merged 1 commit into
developfrom
issue/251-list-only-pr-branches

Conversation

@jgeluk

@jgeluk jgeluk commented Aug 21, 2026

Copy link
Copy Markdown
Member

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:

WOULD LIST:  DPROD 1.0 (Beta)  [archive]
             develop
             issue/184-schedule-model

WOULD DROP:  fix/retire-github-pages-urls            (no open PR)
             issue/198-reuse-odrl-collections        (no open PR)
             issue/238-unified-evaluation-context    (no open PR)
             issue/239-duty-only-properties          (no open PR)
             issue/241-doc-metadata-drift            (no open PR)
             issue/246-jsonld-context                (no open PR)
             issue/249-spec-versions-branch-filter   (no open PR)

9 → 2 branches. Every drop is a branch whose PR has already merged.

The filter had to move

isAdvertisableBranch() was being applied inside getSpecVersions() — 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 repairs dependabot/*, 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 in UNADVERTISED_BRANCH_PREFIXES if 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:

endpoint fine-grained permission
#249 GET /repos/{owner}/{repo}/branches Contents: Read-only
now GET /repos/{owner}/{repo}/pulls Pull requests: Read-only

Pull requests: Read-only needs adding to the token before this merges, or the picker will correctly degrade to the archive and develop with the "Branch list unavailable" notice, and log Resource not accessible by personal access token. Contents can be dropped.

tsc --noEmit and pnpm build clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VHbek1ZojYktiTaeFqChqA

…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
@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dprod Ready Ready Preview Aug 21, 2026 12:31pm

@jgeluk
jgeluk merged commit 730c67b into develop Aug 21, 2026
6 checks passed
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.

Spec versions should list only main, develop and open-PR branches

1 participant