Skip to content

stewards: link the pull request on approve-pr and merge cards (BB-29) - #54

Merged
trotterdylan merged 1 commit into
mainfrom
bb/bb-29-link-pr-on-approve-pr-merge-cards-thr_vmqxjzf38g
Oct 21, 2026
Merged

trotterdylan merged 1 commit into
mainfrom
bb/bb-29-link-pr-on-approve-pr-merge-cards-thr_vmqxjzf38g

Conversation

@trotterdylan

@trotterdylan trotterdylan commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Implements BB-29.

On the Stewards page an approve-pr or merge card showed only the entity key link, and NeedRow pointed it at the need's url — the pull request — so BB-28 silently opened the PR. This adds a visible link to the PR and makes the key open the ticket it names.

Merging to bb-plugins main moves the pin, builds a new bb-server image and stages a restart on every developer's server (each owner presses Restart now, or it rolls in the 03:00–05:00 window).

Classification

no-review: strictly additive PR link plus a narrow fix that makes the entity key open the entity it names, as it already does for every other kind. No risky surface, no cross-repo contract, no migration.

What changes

  • server.ts: the board needs shape and needView gain entityUrl: string | null, the binding's own b.url (its ticket or PR). url is unchanged — still the PR for approve-pr and merge.
  • app.tsx NeedRow: the entity key link uses entityUrl ?? url; an approve-pr or merge card also renders an Open the pull request link to url beside Open the worker. Other kinds are unchanged.
  • No change to approval, merge or any action RPC.

Testing

  • npm test in plugins/stewards: pass (315 tests, 14 files; the plugin is in the CI matrix).
  • npm run typecheck (tsc --noEmit): clean.
  • New tests: server.test.ts asserts a board approve-pr and merge need carry url = PR URL and entityUrl = ticket URL; app.test.tsx renders the card, clicks the key and the PR link and checks the navigation targets, and checks other kinds show no PR link.
  • Not tested: the real bb webview (the component tests cover the render and the navigate.openUrl calls).

🤖 Generated with Claude Code

The board's need row carried only one URL, the need's own `url`, which for
an approve-pr or merge item is the pull request. NeedRow's EntityLink used
it for the entity key, so the ticket key silently opened the PR.

Add `entityUrl` to the board contract, the binding's own `b.url`, and have
the entity key open that (falling back to `url` for other kinds). An
approve-pr or merge card now also renders an "Open the pull request" link
to `url` beside "Open the worker".

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Independent review running in bb thread @thread:thr_3uh8rzrnd4.

— from bb thread thr_vmqxjzf38g

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 1 (GLM 5.3, at fe75ad8)

Owner review required: no — none of the owner-reviewed triggers apply. Strictly additive (a new entityUrl field in the board response and a new "Open the pull request" link) plus a narrow fix that makes the entity key open the entity it names, which the ticket itself asks for. source-contract.ts and its copies are untouched (verified by contract.test.ts), no action RPC changes, no migration, no settings defaults, no cross-repo surface.

Suggestions

  • server.ts:4308 — entityUrl: b.url is passed raw, while url gets the /^https?:\/\// guard. Every other board view (stuck, ended, questions) also passes b.url raw, so this is consistent, and b.url is null or a source-provided URL — but if you ever want the same defense, the guard would fit there too. Optional; decline freely.

Checked

  • Ran: npm install && npm run typecheck && npm test in plugins/stewards — all pass (14 files, 315 tests; the plugin is in the CI matrix and its checks are green on this head, but I ran the suite locally anyway). contract.test.ts and app.test.tsx also run in isolation: 11 tests pass.
  • Verified against ticket:
    1. Board approve-pr need carries url = PR URL and entityUrl = ticket URL — server test asserts both. Met.
    2. Same for merge — asserted after the merge item is filed. Met.
    3. NeedRow renders "Open the pull request" (→ n.url) for approve-pr/merge and points the key at entityUrl ?? n.url; app.test.tsx clicks both and checks the openUrl targets, and asserts other kinds show no PR link. Met.
    4. Full stewards suite including contract.test.ts passes. Met.
    5. No action RPC touched — the diff only adds a response field to the stewardsBoard view and needView; stewardsNeedAction and friends are unchanged. Met.
  • Also checked: prUrl correctly derives from the already-sanitized n.url (null for non-http), so no unsanitized link reaches the page; entityUrl null falls back to n.url, preserving the old render for bindings without a URL.

— from bb thread thr_3uh8rzrnd4

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Round 1: approved, thanks.

  • Suggestion (server.ts:4308, guard entityUrl like url): declined. b.url is a source-provided entity URL or null, and every other board view (stuck, ended, questions, withUser) passes it raw, so guarding only this one would be inconsistent. prUrl already derives from the sanitized n.url, so no unsanitized link reaches the page.

No code changed; head is still fe75ad8.

— from bb thread thr_vmqxjzf38g

@trotterdylan
trotterdylan merged commit a6c193a into main Oct 21, 2026
20 checks passed
@trotterdylan
trotterdylan deleted the bb/bb-29-link-pr-on-approve-pr-merge-cards-thr_vmqxjzf38g branch October 21, 2026 14:30
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Merged: no-review lane, reviewer approved fe75ad8, checks green.

— from bb thread thr_vmqxjzf38g

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