fix: handle race condition in release promote job#85
Open
AaronFeledy wants to merge 1 commit intomainfrom
Open
fix: handle race condition in release promote job#85AaronFeledy wants to merge 1 commit intomainfrom
AaronFeledy wants to merge 1 commit intomainfrom
Conversation
When a fresh non-prerelease is published, GitHub fires both 'published' and 'released' events simultaneously. The promote job races the deploy job and fails because the package isn't on npm yet. Add a retry loop (up to 5 min) so promote waits for the package to appear, while still failing loudly if it never does.
✅ Deploy Preview for lando-symfony ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.

Problem
When a fresh (non-prerelease) release is created, GitHub fires both
publishedandreleasedevents simultaneously. Thepromotejob (triggered byreleased) races thedeployjob (triggered bypublished) and tries tonpm dist-tag addbefore the package is published to npm.Fix
Add a retry loop that waits up to 5 minutes for the package version to appear on npm before promoting. If the version never appears, the job fails with a clear error instead of silently succeeding.
This is better than simply skipping when the version doesn't exist (as in lando/phpmyadmin#72), because it still catches genuine failures — e.g., if a prerelease promotion runs and the version is truly missing.
Affected repos
This same fix is being rolled out to all Lando repos with this release workflow pattern.
Closes any race condition failures on the
promotejob.Note
Low Risk
Small CI workflow change limited to release promotion; main risk is delayed/failed releases if npm is slow or temporarily unavailable.
Overview
Prevents a race in
.github/workflows/release.ymlwhere thepromotejob could run before thedeployjob finishes publishing to npm.The promote step now polls
npm viewfor up to 5 minutes before runningnpm dist-tag add ... latest, and fails with a clear error if the version never appears.Written by Cursor Bugbot for commit 0abdeb2. This will update automatically on new commits. Configure here.