Skip to content

feat: versioned sync commit subject and upstream commit list in PR body#6

Merged
flipvh merged 1 commit into
mainfrom
feat/sync-pr-version-and-commits
Jul 6, 2026
Merged

feat: versioned sync commit subject and upstream commit list in PR body#6
flipvh merged 1 commit into
mainfrom
feat/sync-pr-version-and-commits

Conversation

@flipvh

@flipvh flipvh commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Problem

A sync PR (e.g. cellajs/raak#20) was opened with the bare title chore: sync upstream cella and an empty description: the explicit --title overrides --fill, and the squashed sync commit has no body to fill from. You couldn't tell from the PR which upstream version it moved to or which commits it brought in.

Changes

Versioned commit subject / PR title — the finishing rerun now commits as e.g.:

chore: sync upstream cella v0.2.2 (4f7d87c)

The version is the manifest's release tag when tracking releases, else upstream's root package.json version at the merged commit (readPackageVersionAtRef). Falls back to the previous chore: sync upstream cella <sha> format when neither resolves, and the chore: prefix release-please needs is preserved. shipSyncBranch reuses the squash commit's subject as the PR title. The same message builder is used by flattenSyncBranch for manually-committed merges.

Upstream commit list in the PR body — the PR is now opened with a generated body:

Syncs upstream cellajs/cella to 4f7d87c (v0.2.2).

8 upstream commits since last sync (compare):

The range is recovered at ship time from committed manifests — the sync branch's cella.manifest.json holds the new upstream sha, the trunk's holds the previous one — so it works on the rerun long after the merge engine computed its in-memory commit list (refs/cella/last-sync is no help there; the merge already moved it). Merge-base fallback covers forks whose last sync predates the manifest; with no manifest at all the old --fill behavior is kept. The list is capped at the 50 newest commits with an "…N earlier commits not shown" line, and bare #123 refs in upstream subjects are qualified as cellajs/cella#123 so GitHub links them to the upstream PR instead of the fork's own.

Verification

  • 132/132 tests pass, including new unit tests for the body renderer (truncation, ref qualification, plain-text degradation) and the manifest/version readers against real git fixtures.
  • Ran the new builders against cellajs/raak's real cella/sync/20260706-1146 branch: title and body reproduce that sync's 8 upstream commits exactly (output above).

🤖 Generated with Claude Code

The sync PR was opened with a constant title and an empty body: --title
overrode --fill, so neither the upstream version nor the commit id made it
into the PR name, and the squashed commit has no body to fill from.

- Commit subject (and PR title, reused from it) now reads
  `chore: sync upstream cella v0.2.2 (4f7d87c)` — release tag when tracking
  releases, else upstream's root package.json version at the merged commit,
  falling back to the old format when neither resolves.
- The PR body lists the upstream commits the sync brought in, with commit
  and compare links. The range is recovered at ship time from committed
  manifests (branch HEAD = new sync point, trunk = previous one), so it
  works on the rerun long after the merge engine ran. Bare #123 refs in
  upstream subjects are qualified with the upstream slug so GitHub links
  them upstream instead of to the fork's own PRs. Falls back to --fill
  when no manifest exists.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@flipvh flipvh merged commit db63de6 into main Jul 6, 2026
7 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.

1 participant