Reject bluegreen deploys with detached process-group machines#4982
Open
tomr-a5 wants to merge 1 commit into
Open
Reject bluegreen deploys with detached process-group machines#4982tomr-a5 wants to merge 1 commit into
tomr-a5 wants to merge 1 commit into
Conversation
56f4fa9 to
ef3d37e
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a safety gate to fly deploy --strategy bluegreen to prevent deployments when the selected deployment target has zero managed (Fly Launch) Machines but does have active detached Machines in the same configured process group(s), which could otherwise keep serving old traffic during the blue/green handoff.
Changes:
- Reuses existing deploy-target filters (regions/machines/process-groups) to scope the detached-machine safety check to the same target the deploy will act on.
- Fails early (before release creation) for bluegreen when the target has no managed Machines but has active detached Machines in configured process groups, treating missing process-group metadata as the app’s default group.
- Adds unit and integration test coverage for the new bluegreen rejection behavior (including implicit
appprocess group cases).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
internal/command/deploy/machines.go |
Adds bluegreen validation to detect and reject detached Machines in the selected target when there are no managed Machines to safely orchestrate. |
internal/command/deploy/machines_test.go |
Adds focused unit tests covering reject/allow cases and filter interactions for the new bluegreen behavior. |
test/preflight/fly_deploy_bluegreen_test.go |
Adds an integration preflight test reproducing the implicit app process-group scenario with a detached Machine and asserting bluegreen deploy fails with actionable messaging. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Refs #4886.
What
Reject bluegreen deploys when the selected deploy target has no managed Fly
Launch Machines, but does have active detached Machines in the same process
group.
Why
Bluegreen deploys can create or update a managed Fly Launch fleet while active
Machines outside Fly Launch management keep serving old traffic. In that shape,
flyctl cannot safely cordon or replace those detached Machines as part of the
bluegreen handoff.
How
Testing
go test ./internal/command/deploy -run 'TestSetMachinesForDeployment|Test_resolveUpdatedMachineConfig_Basic' -count=1 -vgo test ./internal/command/deploy -count=1go test -tags=integration ./test/preflight -list 'TestFlyDeployBluegreenImplicitAppProcessGroup'go test -tags=integration ./test/preflight -run TestFlyDeployBluegreenImplicitAppProcessGroup -count=0make preflight-test T=TestFlyDeployBluegreenImplicitAppProcessGroupgit diff --check