Skip to content

release: Automate stable backports and release promotion - #3374

Closed
huacnlee wants to merge 1 commit into
mainfrom
release/automate-stable-backports
Closed

huacnlee wants to merge 1 commit into
mainfrom
release/automate-stable-backports

Conversation

@huacnlee

@huacnlee huacnlee commented Oct 6, 2026

Copy link
Copy Markdown
Member

Description

Keep main developing the next release while stable receives compatible changes. After a PR is squash-merged into main, the Stable Branch workflow cherry-picks it unless it has the exact Breaking Changes label. It reconciles outstanding commits into one generated PR, records conflicts for manual handling, and preserves source SHAs through squash merging to prevent duplicate backports.

The generated PR is merged only after the existing CI workflows validate its exact head, applicable documentation checks pass, and the stable base, PR head and source labels still match. CI is called explicitly with a read-only token, so this works without a new bot secret or relying on approval-gated PR events from GITHUB_TOKEN.

After a successful Release Crate run for an exact stable vX.Y.Z tag, reconciliation promotes stable to a newer published version. Prereleases, failed publishes and older versions do not advance it; retries preserve newer backports. Main pushes, release completion, hourly reconciliation and manual dispatch share one serialized workflow. No versions or tags are created automatically.

Document branch ownership and rollout, and require TypeScript/Bun for new repository scripts in AGENTS.md. This is an AI-assisted implementation. No public crate APIs change.

Repository setup

stable has already been cut from current main at af78e935, so existing compatible changes are included.

Before enabling this workflow, turn on Allow GitHub Actions to create and approve pull requests in repository Actions settings. That setting is currently disabled; the workflow needs PR creation and does not approve reviews. Existing branch rules still apply: stable can require the Stable backport status, and release promotion must be allowed to update its managed ref. This PR does not change repository settings, merge feature PRs, or publish a release.

Direct main commits have no PR label and require manual backporting. Conflicts and failed checks remain visible for maintainers. See docs/RELEASE-BRANCHES.md for recovery and new-series promotion details.

How to Test

  • bun test ./script/tests/stable-backport.test.ts: 8 passed. Local Git repositories exercise real cherry-picks and squash-history tracking; GitHub writes are mocked. Coverage includes label exclusion, conflicts, repeated reconciliation, failed CI, head/base changes, labels added during CI, empty patches, exact successful release tags, older releases and preserved post-release fixes.
  • TypeScript tsc --noEmit for the new script and test: passed using the installed Bun types.
  • actionlint v1.7.12 on the three changed workflows: passed.
  • bun build script/stable-backport.ts --target bun: passed.
  • git diff --check: passed.

The production workflow has not been run; it becomes available on main after merge and requires the Actions setting above. Rust tests were not rerun because this change only affects release automation and documentation.

Checklist

  • Read CONTRIBUTING and kept the PR focused on stable branch automation.
  • Reviewed the AI-assisted implementation.
  • Added and passed Bun integration tests, type checking and workflow validation.
  • Documented the repository setting required for activation.

Keep main on the next release and backport merged PRs to stable unless they carry Breaking Changes. Reconcile pending commits into one batch, reuse CI on its exact revision, and merge only while its head, base and labels still match.

Promote stable only after an exact stable tag successfully publishes. Add Bun integration coverage and document repository setup and branch ownership. Require Bun for new repository scripts.

AI-assisted implementation.
@huacnlee huacnlee closed this Oct 6, 2026
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