Skip to content

v0.18.1 — rebase covers CLI resync PRs

Choose a tag to compare

@mmcky mmcky released this 21 Jul 01:18
e4378bc

Patch release. Closes #115 via #121.

Rebase mode now rebases CLI resync PRs, not only Action sync PRs

Rebase filtered on the translation-sync- branch prefix, but translate forward --github creates resync/{stem} branches — so merging one resync PR never rebased its siblings. During a drift-recovery wave that leaves a stack of 60+ open PRs whose bases go stale with every merge, each one re-enqueued by hand. Observed on the 69-PR lecture-python.zh-cn Track B wave.

The prefix turned out to be enforced in three independent places, and fixing any subset leaves the defect in place:

Layer Effect if it alone is wrong
runRebase's early return on the merged branch job runs, returns immediately — a silent no-op
the job if in examples/rebase-translations.yml job never starts
the sibling-PR filter job runs, finds nothing to rebase

All three now share one predicate. The root cause was that the prefixes had no owner — sync built one spelling, forward built another, and the filters re-spelled them by hand — so a new src/branch-naming.ts holds both prefixes and isTranslationBranch, and every builder and filter consumes it.

Widening rather than unifying the prefixes is deliberate: unifying changes branch naming for a command already in production use, and an in-flight wave would straddle both conventions mid-migration.

Action required for repos already running the rebase workflow

examples/rebase-translations.yml is copied into target repos, so an existing rebase-translations.yml needs its if broadened by hand — the action-side fix alone is not enough, since the workflow gate runs first:

if: >
  github.event.pull_request.merged == true &&
  (startsWith(github.event.pull_request.head.ref, 'translation-sync-') ||
   startsWith(github.event.pull_request.head.ref, 'resync/'))

Repos pinned @v0 pick up the action-side half automatically; the workflow half is a manual edit either way.

Also in this release

  • isTranslationBranch rejects a bare prefix (resync/ with nothing after it). No builder emits one, and every match authorises a force-push during rebase, so the predicate claims fewer branches rather than more.
  • Two structural regression guards, both verified to fail against the reintroduced defects rather than only to pass in their absence: branch-naming.ts is the only source file permitted to spell a prefix as a standalone literal, and the workflow template's if must list every prefix the predicate knows.
  • examples/rebase-translations.yml documents both branch kinds and pins @v0 instead of the exact @v0.15.0 it still carried.
  • actions/checkout in the docs/ workflow templates moved from @v4 to @v7, which had fallen behind the editions copying them.

Note for the record

The first fix for #115 was incomplete and was caught in review, not by the test suite. Neither the full suite nor the drift test written for this very class found the third layer, because src/index.ts has no unit coverage — the file holding mode dispatch and the rebase entry points. That gap is worth closing before the next round of guard work lands next door.

Full changelog: https://github.com/QuantEcon/action-translation/blob/main/CHANGELOG.md