fix: gate assertAwsDeployImage on usesFlySandboxes - #187
Conversation
The FixThis PR resolves the issue by gating all call sites of assertAwsDeployImage(config) behind the Changes Made:
How it Works: Users deploying the control plane to an unsupported AWS region (like eu-central-1) with sandbox.backend: "sprites" |
|
solves #177 |
rajpratham1
left a comment
There was a problem hiding this comment.
This is a straightforward correctness fix that aligns validation with the selected deployment architecture.
What the PR fixes
Previously, assertAwsDeployImage(config) was executed unconditionally in multiple places, even when the deployment was configured to use Fly sandboxes instead of AWS Lambda MicroVM sandboxes.
The PR consistently guards those checks:
if (!usesFlySandboxes(config)) {
assertAwsDeployImage(config);
}
This ensures the AWS deploy image is only validated when it is actually relevant.
Why this is correct
The deployment image is only required for AWS-hosted Lambda MicroVM sandboxes.
For configurations using Fly sandboxes:
there is no AWS deploy image to validate,
failing validation is a false positive,
users should not be blocked by an irrelevant prerequisite.
The change correctly ties the validation to the deployment mode instead of always enforcing it.
Consistency improvements
The PR updates all of the major call sites:
✅ initial deployment validation
✅ deployment snapshot path
✅ diagnostic/health checks
✅ drift detection
This avoids inconsistent behavior where some commands might still require an AWS deploy image while others don't.
Code quality
The implementation is:
minimal,
easy to understand,
consistent across the file,
low risk.
Minor suggestion (non-blocking)
The repeated pattern:
if (!usesFlySandboxes(config))
assertAwsDeployImage(config);
now appears several times. If similar deployment-mode gating continues to grow, it may eventually be worth introducing a small helper (or central validation routine) to avoid repeating the same conditional logic. This is purely a maintainability suggestion.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.