Skip to content

DX-2103: auto-merge the public-export PR after CI#35

Merged
lloyd-cio merged 3 commits into
mainfrom
dx-2103-auto-merge-export
Jun 12, 2026
Merged

DX-2103: auto-merge the public-export PR after CI#35
lloyd-cio merged 3 commits into
mainfrom
dx-2103-auto-merge-export

Conversation

@lloyd-cio

Copy link
Copy Markdown
Contributor

What

Final structural follow-up (#5) for DX-2103: remove the manual merge step. When CI passes on the Copybara-generated copybara/public-export branch, this workflow merges the export PR automatically — so cutting a release no longer requires a human to click merge on the mirror.

How

New destination-owned workflow .github/workflows/auto-merge-export.yml:

  • Triggers on workflow_run of CI (completed), so it only fires after CI has actually run and passed. Uses workflow_run rather than native branch-protection auto-merge so it works regardless of repo protection settings.
  • Guards: CI conclusion == success, head branch is copybara/public-export, same-repo (not a fork), PR author is the export bot (ami-ci), and the PR head still matches the exact commit CI validated (refuses to merge a newer, unvalidated push).
  • Uses a merge commit (not squash) so the original Copybara commit — and its CioCliPublicExport-RevId trailer used for last-rev tracking — stays in main's history.

Why this is safe / preserves the contract

Destination main still changes only through the export PR — this just removes the human from clicking merge, it doesn't bypass the PR or its CI. The release workflow (npm / GitHub release) is unchanged and remains separately gated.

Independent of the other DX-2103 PRs

No dependency on #109 (auto-export on merge), #33 (auto-semver), or #112/#34. It auto-merges whatever export PR exists — works with today's manual export and composes with #109 for the fully hands-off pipeline.

Prerequisite

Repo Settings → Actions → Workflow permissions must allow read/write (so GITHUB_TOKEN can merge). Branch protection must not require a human review on main (it currently doesn't).

Note

This is the change that removes the last human gate before public main. Per the DX-2103 discussion that's a policy call (Joey leaned toward keeping a human reviewing the changelog/version) — opening it as an isolated, easy-to-revert PR so it's ready, but it shouldn't merge until that's settled.

Removes the manual merge step (#3) from the release flow. When CI passes on
the Copybara-generated copybara/public-export branch, this workflow merges
the export PR automatically.

Destination main still changes only through that PR, so the export contract
is preserved — a human is just no longer required to click merge. Triggered
off a successful CI workflow_run (works regardless of branch-protection
settings), guarded to the export bot's PR on the export branch, refuses to
merge a commit newer than the one CI validated, and uses a merge commit so
the Copybara CioCliPublicExport-RevId trailer stays in main's history.
newhook
newhook previously approved these changes Jun 12, 2026
main's ruleset enforces required_linear_history and allows the rebase
merge method only, so the prior --merge call would have been rejected on
every run. Switch to --rebase. The CioCliPublicExport-RevId trailer lives
in the commit message and survives a rebase, so Copybara last-rev tracking
is unaffected — confirmed by main's existing history, which is fully linear
and carries the trailer on every export commit.
@lloyd-cio lloyd-cio merged commit ca4a8c8 into main Jun 12, 2026
3 checks passed
@lloyd-cio lloyd-cio deleted the dx-2103-auto-merge-export branch June 12, 2026 21:43
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.

2 participants