fix(pr): reconcile jj create with a push-auto-created branch PR (no dup) #186

Merged
gmackie merged 1 commit from fix/pr-create-dedup into main 2026-08-02 22:10:38 +00:00
Owner

What

forge pr create no longer creates a duplicate when a push already auto-created a PR on the branch (item #3 of the forge-CLI DX field report).

Why

A pushed jj change auto-creates a PR on its branch (identity branch_ref), but POST /api/fg/prs deduped only within the same identity kind (jj_change_id) — so forge pr create missed it and made a second PR.

Change

  • CLI: forge pr create sends the current jj bookmark (branch).
  • Server: for jj, reconciles (repo-scoped) with an existing open branch_ref changeset — updates it and attaches the jj_change_id so future creates dedup by change id — instead of creating a duplicate. New changesets also record branch_ref, so either order (push-then-create or create-then-push) dedups.

Verification

Go build/vet green; prs route test 3/3 incl. a new jj-reconcile case; changed TS files typecheck clean. The git path is unchanged (dedup is jj-scoped).

Field report: item #3.

## What `forge pr create` no longer creates a duplicate when a push already auto-created a PR on the branch (item #3 of the forge-CLI DX field report). ## Why A pushed jj change auto-creates a PR on its branch (identity `branch_ref`), but `POST /api/fg/prs` deduped only within the same identity kind (`jj_change_id`) — so `forge pr create` missed it and made a second PR. ## Change - CLI: `forge pr create` sends the current jj bookmark (`branch`). - Server: for jj, reconciles (repo-scoped) with an existing open `branch_ref` changeset — updates it and **attaches the `jj_change_id`** so future creates dedup by change id — instead of creating a duplicate. New changesets also record `branch_ref`, so either order (push-then-create or create-then-push) dedups. ## Verification Go `build`/`vet` green; prs route test **3/3** incl. a new jj-reconcile case; changed TS files typecheck clean. The git path is unchanged (dedup is jj-scoped). Field report: item #3.
fix(pr): reconcile jj create with a push-auto-created branch PR (no dup)
All checks were successful
CI / gitleaks (pull_request) Successful in 8s
forgegraph/ci CI passed
CI / ci (pull_request) Successful in 6m35s
863bf34c54
A pushed jj change auto-creates a PR on its branch (identity branch_ref); the
POST /api/fg/prs dedup only matched the same kind (jj_change_id), so `forge pr
create` made a duplicate. `forge pr create` now sends the jj bookmark, and the
server reconciles (repo-scoped) with the existing branch_ref changeset —
updating it and attaching the jj_change_id — instead of creating a second PR.
New changesets also record branch_ref so either order dedups.
gmackie deleted branch fix/pr-create-dedup 2026-08-02 22:10:38 +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!186
No description provided.