Skip to content

fix: serialize bump-and-open-pr per package to close a burst-supersede race - #5

Merged
Mearman merged 1 commit into
mainfrom
fix/serialize-bump-and-open-pr-per-package
Sep 8, 2026
Merged

fix: serialize bump-and-open-pr per package to close a burst-supersede race#5
Mearman merged 1 commit into
mainfrom
fix/serialize-bump-and-open-pr-per-package

Conversation

@Mearman

@Mearman Mearman commented Sep 8, 2026

Copy link
Copy Markdown
Member

Follows up on #2. That fix correctly closes an older sibling-update PR when a new release dispatches after it, but never covered several releases of the same package publishing within seconds of each other: each publish fires its own repository_dispatch event, and GitHub runs one bump-and-open-pr job per event fully in parallel with no visibility into siblings' in-flight work. The close-then-create step's "list currently-open PRs for this package" snapshot then predates every sibling run's own PR creation, so none of them close anything and all survive side by side.

Confirmed directly against novus-power/hive: a burst of pdf-codec releases fired nine repository_dispatch-triggered runs within 8 seconds of each other, and all nine PRs survived instead of only the newest.

Adds a job-level concurrency group on bump-and-open-pr, keyed by package name (concurrency groups are already scoped per-repository by GitHub, so this never collides across caller repos), non-cancelling so an in-flight push or PR-create is never killed mid-operation. GitHub's own queueing semantics collapse a same-package burst to at most two real executions rather than fully serializing every release in it, which is the outcome we actually want -- every run in between would otherwise open, then immediately close, its own now-superseded PR for nothing.

Test plan

  • actionlint -ignore 'property "automerge_app_private_key" is not defined' -- clean
  • npx prettier --check . -- clean
  • Real end-to-end verification happens the moment this merges and releases: a burst of same-package sibling releases should leave exactly one surviving PR.

…e race

Several releases of the same sibling package publishing within seconds
of each other each fire their own repository_dispatch event, and
GitHub runs one bump-and-open-pr job per event fully in parallel. The
close-then-create step reads a live snapshot of currently-open PRs for
the package -- under real concurrency every run in the burst takes
that snapshot before any sibling run has created its own PR, so none
of them see anything to close and all survive side by side.

Confirmed directly against novus-power/hive: a burst of pdf-codec
releases fired nine repository_dispatch-triggered runs within 8
seconds of each other, and all nine PRs survived instead of only the
newest.

Add a job-level concurrency group keyed by package name, non-cancelling
so an in-flight push/PR-create is never killed mid-operation. GitHub's
own queueing semantics collapse a same-package burst to at most two
real executions rather than fully serializing it, which is what we
want here anyway -- every run in between would otherwise open and
immediately close its own now-superseded PR for nothing.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-08T16:54:37.147353Z d0e6681 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Mearman
Mearman merged commit 5834e53 into main Sep 8, 2026
7 checks passed
@Mearman
Mearman deleted the fix/serialize-bump-and-open-pr-per-package branch September 8, 2026 16:50
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant