fix(pr): accept the short PR id that forge pr list prints #183

Merged
gmackie merged 1 commit from fix/pr-short-id into main 2026-08-02 21:39:51 +00:00
Owner

What

Make forge pr show/merge/close/comment/approve accept the short 8-char id that forge pr list prints (item #2 of the forge-CLI DX field report).

Why

Those subcommands looked up the PR by exact UUID, so the id list shows 404'd — every action needed a list --json round-trip to recover the full id.

Change

resolvePRID now prefix-matches a short id against the current app's PRs (a full UUID is still used as-is; errors clearly on no/ambiguous match). comment/request-changes route their explicit id through it too. Pure matcher matchPRIDPrefix is unit-tested.

Verification

Go build/vet green; TestMatchPRIDPrefix 4/4 (full-id passthrough, unique prefix, no-match, ambiguous).

Field report: item #2.

## What Make `forge pr show/merge/close/comment/approve` accept the short 8-char id that `forge pr list` prints (item #2 of the forge-CLI DX field report). ## Why Those subcommands looked up the PR by exact UUID, so the id `list` shows 404'd — every action needed a `list --json` round-trip to recover the full id. ## Change `resolvePRID` now prefix-matches a short id against the current app's PRs (a full UUID is still used as-is; errors clearly on no/ambiguous match). `comment`/`request-changes` route their explicit id through it too. Pure matcher `matchPRIDPrefix` is unit-tested. ## Verification Go `build`/`vet` green; `TestMatchPRIDPrefix` 4/4 (full-id passthrough, unique prefix, no-match, ambiguous). Field report: item #2.
fix(pr): accept the short PR id that forge pr list prints
All checks were successful
CI / gitleaks (pull_request) Successful in 8s
forgegraph/ci CI passed
CI / ci (pull_request) Successful in 6m32s
80974502c1
show/merge/close/comment/approve resolved the id via exact UUID match, so the
8-char id `forge pr list` displays 404'd. resolvePRID now prefix-matches a
short id against the current app's PRs (full UUID still used as-is; errors on
no/ambiguous match). comment/request-changes route their explicit id through it
too.
gmackie deleted branch fix/pr-short-id 2026-08-02 21:39:51 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
gmackie/ForgeGraph!183
No description provided.