Repository navigation
fix(devkit-sync): on-demand only, and stop deleting the PR branch - #54
Merged
Merged
Conversation
Policy — drop the nightly schedule (caller is workflow_dispatch only). A submodule pin is a deliberate dependency upgrade, not something that should land overnight. Measured: 189 runs across the fleet produced 29 merged bumps; 51 PRs opened, 18 closed without merging. And from 2026-07-10 it silently no-op'd for three weeks — every night it opened a PR whose checks sat in action_required awaiting approval, so nothing merged and nothing complained. A no-op looks exactly like "nothing to sync". Implementation — remove `git push origin --delete "$BRANCH_NAME"`. This is the real cause of those 18 closed PRs: deleting a head ref DELETES THE PR WITH IT, because GitHub auto-closes any open PR whose head branch disappears. Four of the casualties were already fully green — the v2.1.5 sync PRs, whose e2e had passed, were closed and re-queued for nothing. Verified from the event log on chat-comments#21: head_ref_deleted and closed, both by github-actions[bot] at 06:18:40, with the replacement PR #22 created two seconds later carrying an identical pin. The delete also made the `gh pr edit` reuse path dead code — it closed the very PR the next line searched for, so `existing` was always empty and every run created a new PR rather than updating one. Force-push alone is enough: an open PR follows its head ref.
This was referenced Aug 4, 2026
Merged
Merged
Merged
Merged
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.
Two changes. The first is what you asked for; the second is a bug I found while making it, and it's the more serious of the two.
1. Drop the schedule (policy)
Caller template is now
workflow_dispatch:only. A submodule pin is a deliberate dependency upgrade, not something that should land while nobody is watching.The schedule measurably cost more than it delivered:
189 devkit-sync runs → 29 merged bumps. And from 2026-07-10 it silently no-op'd for three weeks: every night it opened a PR whose checks sat in
action_requiredawaiting approval, so nothing merged and nothing complained — a no-op is indistinguishable from "nothing to sync".Deliberate bumps still work exactly as before:
make update-devkit, or dispatch this workflow manually.2. Stop deleting the branch (the actual bug)
The push step opened with:
Deleting a head ref deletes the PR with it — GitHub auto-closes any open PR whose head branch disappears. That is the real cause of those 18 closed-unmerged PRs, and four of the casualties were already fully green: the v2.1.5 sync PRs had passed their e2e and were discarded and re-queued for nothing.
Verified from the event log on
chat-comments#21:The delete also made the
gh pr editreuse path immediately below it dead code: it closed the very PR the next line went looking for, soexistingwas always empty and every run created a brand-new PR instead of updating one. That's why the branch shows a fresh PR number every time.A force-push is sufficient and non-destructive — an open PR follows its head ref and picks up the new commit.
Correction to something I said earlier
I told you the scheduler "closed all four green PRs and opened identical replacements", and attributed it to scheduling. The scheduling made it frequent, but the destruction came from the branch delete. Fixing only the schedule would have left a manual dispatch just as capable of clobbering an open green PR.
Propagation
devkit-syncnever writes.github/workflows/, so the template change does not reach consumers on its own — the four copies need the same edit. Doing that next, separately.