feat: open the metadata sync as a PR for review instead of merging it unattended - #464
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #464 +/- ##
==========================================
+ Coverage 87.69% 87.74% +0.05%
==========================================
Files 43 43
Lines 3893 3893
Branches 993 993
==========================================
+ Hits 3414 3416 +2
+ Misses 277 276 -1
+ Partials 202 201 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
twcclegg
force-pushed
the
feat/metadata-auto-merge-soak-window
branch
4 times, most recently
from
September 8, 2026 07:41
be9fdbc to
bda3893
Compare
twcclegg
force-pushed
the
feat/metadata-auto-merge-soak-window
branch
3 times, most recently
from
September 10, 2026 14:14
39d47ea to
1d03975
Compare
twcclegg
force-pushed
the
feat/metadata-auto-merge-soak-window
branch
2 times, most recently
from
September 12, 2026 23:27
7a0056b to
966050a
Compare
twcclegg
force-pushed
the
feat/metadata-auto-merge-soak-window
branch
4 times, most recently
from
September 13, 2026 17:23
6f4b13b to
cfd1154
Compare
… unattended
github-actions-metadata-update.sh opened the metadata-update/* PR and enabled
auto-merge in the same breath, so the 08:00 sync was usually merged, tagged,
released and dispatched to nuget.org before anyone was awake. The only chance to
look at one was to catch it during the few minutes its checks took.
The sync now opens the PR and stops. Reviewing and merging it is the intended
way a metadata release ships.
Auto-merge becomes the backstop rather than the plan: a later run that finds the
PR still open regenerates the sync onto the same branch, force-pushes it and
turns auto-merge on, so a release is never left stalled because nobody was
around to look. Regenerating rather than arming what is already there is what
keeps that backstop small - the commit that lands was built minutes earlier by
this script, so nothing has to reason about a day-old branch:
- Auto-merge is armed at the one moment github accepts it. The mutation is
rejected on a PR that could be merged right now ("Pull request is in clean
status") and only works while one is blocked, which the force-push has just
made it. Arming a day-old PR is not possible at all; merging it over the api
instead would mean verifying the check rollup by hand, since the bot account
bypasses main's required status checks and the api would not refuse a red PR.
- metadata-update/* sits outside every ruleset, so the branch stays writable
while the PR is open. The force-push overwrites whatever is there, so a commit
pushed in the meantime never reaches a release.
- The checks gating the merge are minutes old rather than a day stale against a
main that has moved.
Deliberately not built: any notion of declining a release. Closing the PR just
means the next run opens another. A rejected sync either has to be skipped once
and resumed at the next upstream release or block releases indefinitely, and
upstream's next release is the thing that actually resolves it.
Also not handled: a maintainer acting inside the minutes a run takes. Merging or
closing by hand happens hours either side of a scheduled job, and upstream
releases are at least five days apart, so at most one metadata PR is ever open.
twcclegg
force-pushed
the
feat/metadata-auto-merge-soak-window
branch
from
September 14, 2026 01:37
cfd1154 to
2ce3b16
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The changelog-folding and commit-attribution half of this work is split out into #471. They touch adjacent regions of
lib/github-actions-metadata-update.sh, so whichever merges second needs a rebase.Problem
lib/github-actions-metadata-update.shopened themetadata-update/*PR and enabled auto-merge in the same breath, so the 08:00 sync was usually merged, tagged, released and dispatched to nuget.org before anyone was awake. The only chance to look at one was to catch it during the few minutes its checks took.Change
The sync opens the PR and stops. Reviewing and merging it is the intended way a metadata release ships.
Auto-merge is the backstop, not the plan. A later run that finds the PR still open regenerates the sync onto the same branch, force-pushes it, and turns auto-merge on — so a release is never left stalled because nobody was around to look. A PR opened at 08:00 that nobody touches merges shortly after 08:00 the following day.
Everything downstream is untouched:
finalize_metadata_release.ymlstill tags the merge commit, creates the release and dispatches the publish. No workflow file changes at all.Why the backstop regenerates rather than arming what is there
enablePullRequestAutoMergeis rejected on a PR that could be merged right now (Pull request is in clean status) and only works while one is blocked — which the force-push has just made it. Arming a day-old PR isn't possible at all; merging it over the API instead would mean verifying the check rollup by hand, becauselibphonenumber-csharp-botis an always-bypass actor onmain'srequired_status_checksand the API would not refuse a red PR.metadata-update/*sits outside every ruleset, so the branch stays writable while the PR is open; the force-push overwrites whatever is there.mainthat has moved.The trade-off, stated plainly: the commit that merges is not the one read the day before.
Deliberately not built
Any notion of declining a release. Closing the PR just means the next run opens another. A rejected sync either has to be skipped once and resumed at the next upstream release, or block releases indefinitely — neither is worth machinery, and upstream's next release is what actually resolves it. An earlier revision of this PR had
--ignore-closed-prand a closed-PR guard; both are gone.Guards against a maintainer acting inside the minutes a run takes. Merging or closing by hand happens hours either side of a scheduled job, and upstream releases are at least five days apart, so at most one metadata PR is ever open. Re-reading the PR before the force-push, retrying the auto-merge arm against GitHub's async mergeability recompute, and rewriting the PR body mid-flight were all written and then removed on those grounds.
Skipping the
.java/.protogates on the backstop run. A.javachange upstream means an actual port, and a run failing daily until someone does it is the existing, intended signal. If you ever dispatch withskip_java_check, the backstop won't fire and you merge the PR by hand.A ref guard on the workflow. An earlier revision refused to run from any ref but
main. It is not a security control —workflow_dispatchruns the workflow definition from the ref being dispatched, so the same push that editslib/can drop the guard — and keeping it meant special-casingdry_runto preserve the documented dry-run-from-a-branch path. This PR now leaves the workflow file untouched.Not addressed here
Repo configuration rather than code:
metadata-update/*is covered by no ruleset, so the branch is writable while the PR is open. Regenerating makes that harmless for the merge path, but restricting pushes to it would be better.README.mdclaimsmainrequires every push to go through a PR "with no bypass for any actor (including this automation's own bot account)". Neither half is true. Corrected in feat: fold the changelog by authorship, and attribute the sync commit #471, which already rewrites that paragraph.finalize-metadata-release.shderives its tag from the head ref with no check that it is newer than what is published.