Skip to content

Add backport publish command - #3415

Draft
tianyiy-tim wants to merge 1 commit into
aws:backport-stack/applyfrom
tianyiy-tim:add-backport-publish
Draft

Add backport publish command#3415
tianyiy-tim wants to merge 1 commit into
aws:backport-stack/applyfrom
tianyiy-tim:add-backport-publish

Conversation

@tianyiy-tim

@tianyiy-tim tianyiy-tim commented Aug 10, 2026

Copy link
Copy Markdown
Member

Issues:

Addresses P425131803

Description of changes:

After apply you're left with one local branch per affected branch, and opening a pull request for each of them is still manual. For a fix that hits seven branches that's seven trips through the GitHub UI.

This pull request adds publish, which pushes those branches and opens one pull request each, in one command.

Most of the time you never type it. apply --open-pr offers to run it as soon as the cherry-picks are done, so a local session stays analyze then apply.

Stacked on #3414. The base here is backport-stack/apply, a scaffolding branch holding the commits below it, so this diff is only the 9 files this change touches. I will retarget it to main as the stack lands. Please don't merge it into the scaffolding branch.

Call-outs:

  • Branches go to your fork, pull requests are opened against aws/aws-lc. Pushing branches to aws/aws-lc is refused, so a mistyped --remote can't put half-reviewed work on the real repository.

  • Whether a branch is ready is read from git, not from anything apply recorded. So resolving a conflict by hand is enough for the next publish to pick that branch up, with no need to run apply again. That's the seam resolve uses later.

  • A branch that already has an open pull request is left alone, so re-running is safe.

  • Nothing is ever a draft and nothing is auto-merged.

  • Everything that talks to GitHub lives in util/github.py. The previous version of this tool grew one PR opener in publish and a second in resolve, and they drifted apart.

  • gh is a new prerequisite, for this command only.

Testing:

Unit tests - 26 new, 167 total:

python3 -m unittest testing.test_engine

They cover reading a remote URL, the refusal to push to aws/aws-lc, how a branch is named to GitHub across repos versus within one, and each outcome a branch can end in.

Real fix - verified --remote upstream is refused before anything is printed or pushed, --dry-run touches nothing, and that resolving one conflict by hand moved that branch from unfinished to publishable without re-running apply.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

@tianyiy-tim
tianyiy-tim force-pushed the add-backport-publish branch from 86cc7f5 to f303452 Compare August 10, 2026 18:08
@tianyiy-tim
tianyiy-tim force-pushed the backport-stack/apply branch from 4ef4e67 to 80da763 Compare August 10, 2026 18:09
@tianyiy-tim
tianyiy-tim force-pushed the add-backport-publish branch from f303452 to ea3a08a Compare August 10, 2026 21:43
@tianyiy-tim
tianyiy-tim force-pushed the backport-stack/apply branch from 80da763 to a76adef Compare August 10, 2026 21:43
@tianyiy-tim
tianyiy-tim force-pushed the add-backport-publish branch from ea3a08a to 5f40255 Compare August 10, 2026 22:20
@tianyiy-tim
tianyiy-tim force-pushed the backport-stack/apply branch from a76adef to e3e0ae2 Compare August 10, 2026 22:20
@tianyiy-tim
tianyiy-tim force-pushed the add-backport-publish branch from 5f40255 to a87a83d Compare August 11, 2026 17:53
@tianyiy-tim
tianyiy-tim force-pushed the backport-stack/apply branch from e3e0ae2 to 4c1a2b2 Compare August 11, 2026 17:53
@tianyiy-tim
tianyiy-tim force-pushed the add-backport-publish branch from a87a83d to cefd5e7 Compare August 12, 2026 16:46
@tianyiy-tim
tianyiy-tim force-pushed the backport-stack/apply branch from 4c1a2b2 to 55b39ad Compare August 12, 2026 16:46
@tianyiy-tim
tianyiy-tim force-pushed the add-backport-publish branch from cefd5e7 to ea6425c Compare August 13, 2026 18:26
@tianyiy-tim
tianyiy-tim force-pushed the backport-stack/apply branch from 55b39ad to 89fe5fe Compare August 13, 2026 18:26
@tianyiy-tim
tianyiy-tim force-pushed the add-backport-publish branch from ea6425c to 2bd6434 Compare August 13, 2026 18:39
@tianyiy-tim
tianyiy-tim force-pushed the backport-stack/apply branch from 89fe5fe to f3823ea Compare August 13, 2026 18:39
Pushes the branches apply built and opens one pull request per affected
branch, so a fix that lands on seven branches is one command rather than
seven trips through the GitHub UI. apply --open-pr offers it as soon as the
cherry-picks are done, so a local session stays analyze then apply

A branch is publishable once its cherry-pick is finished, which is read from
git rather than from anything apply recorded. Resolving a conflict by hand is
therefore enough to make the next publish pick that branch up, with no need
to run apply again. Whether it carries a pick of its own is measured against the
same release ref apply cut it from, so a fork that is behind on the release
branches cannot make an empty branch look ready

Branches are pushed to a fork and the pull requests are opened against
aws/aws-lc. Pushing to aws/aws-lc is refused outright, so a stray --remote
cannot put half-reviewed work on the real repository. A branch that already
has an open pull request is left alone, so re-running is safe

Everything that talks to GitHub lives in util/github.py. The previous version
of this tool grew one PR opener in publish and a second in resolve, and they
drifted apart

Nothing is ever a draft and nothing is auto-merged
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