Repository navigation
Serialize Lambda deploys per environment - #339
Merged
Merged
Conversation
Two merges to staging could start two deploy-lambda runs at once. CloudFormation accepts one update per stack at a time, so the second run failed at the sam deploy step with an UPDATE_IN_PROGRESS error. Add a per-branch concurrency group to the workflow. A second deploy now waits for the first to finish. Cancellation is off, because cancelling a job does not stop its CloudFormation update, so the next run would hit the same error. Also add one sentence about the queueing to the Lambda deployment section of the CI docs. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Adds a per-branch
concurrencygroup todeploy-lambda.yml, so two Lambda deploys to the same environment run one after the other instead of at the same time.Why
Two merges to
staginglanded 21 seconds apart: #337 and #336. Each one started a deploy. The second deploy reachedsam deploywhile the first was still updating the staging CloudFormation stack, so CloudFormation rejected it with anUPDATE_IN_PROGRESSerror.Staging is running the image from #337. The change in #336 only updates
virtualenv, a dev-only tool that the Lambda image does not install, so staging runs the same code either way.Changes
.github/workflows/deploy-lambda.yml: addsconcurrencywith the groupdeploy-lambda-<branch>andcancel-in-progress: false. A second deploy waits for the first.docs/developer/ci-and-deployment.md: adds one sentence about the queueing in the Lambda deploy section.Cancellation stays off on purpose. Cancelling a job does not stop its CloudFormation update, so the next run would fail the same way. If a third merge arrives while one run is waiting, GitHub cancels the waiting run and keeps the newest one. The newest commit includes all earlier changes.
Testing
make checkpasses.make sam-check-overrides: the workflow check passes. The other check in the same command fails on a Mac with a local Xcode tools error, unrelated to this change.Once this merges, the workflow runs on the new
stagingcommit. A deploy that overlaps another one should show as queued.