Skip to content

fix(ci): keep flake-sync to one open pull request - #46

Merged
jasonodoom merged 1 commit into
mainfrom
fix/flake-sync-single-pr
Aug 26, 2026
Merged

fix(ci): keep flake-sync to one open pull request#46
jasonodoom merged 1 commit into
mainfrom
fix/flake-sync-single-pr

Conversation

@jasonodoom

Copy link
Copy Markdown
Contributor

Closing #30 turned up why it existed. flake-sync triggers on push to main and named its branch after the run id, so when seven queued pull requests merged between 22:00 and 22:06 UTC on 26 July, each push started a run, each correctly saw the same drift, and each opened its own pull request. #29 landed and fixed the hash; the other four went stale and conflicted. The [skip-flake-sync] marker worked, so this was redundancy rather than a loop.

  • The branch is now the fixed bot/flake-sync, force-pushed with a lease. An already-open sync pull request is updated and re-armed rather than duplicated, and its body is refreshed so it cannot describe an older hash transition than the diff it carries.
  • A concurrency group serialises runs. The fixed branch alone would leave two overlapping runs racing to write it, and the winner is not always the newer one, which would preserve exactly the stale-hash risk this removes.

The branch name carried the run id, so every push to main during a
merge batch opened another sync pull request for the same drift. Seven
merges on 26 July produced five; one landed and the rest went stale and
conflicted.

A fixed branch, force-pushed, updates the open pull request instead. A
concurrency group serialises runs, since two overlapping runs would
otherwise race to write that branch and an older main event could win,
leaving the pull request describing a stale lockfile.
@jasonodoom
jasonodoom enabled auto-merge (squash) August 26, 2026 04:29
@jasonodoom
jasonodoom merged commit f241329 into main Aug 26, 2026
3 checks passed
@jasonodoom
jasonodoom deleted the fix/flake-sync-single-pr branch August 26, 2026 04:30
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