Pre Deploy Health Check System #478
Draft
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.




Pre-Deployment Health Check System
Summary
Implements a comprehensive pre-deployment health check system that prevents deployment failures by detecting blocking issues before invoking
serverless deploy. This addresses the recurring problem of orphaned resources (especially KMS aliases) causingAlreadyExistsExceptionerrors and broken CloudFormation stacks.Problem
Deployments frequently fail due to:
These failures waste time, create broken stacks requiring manual cleanup, and disrupt CI/CD pipelines.
Solution
A 6-step pre-deployment health check that runs before
serverless deploy:Deployment is blocked for critical issues that will cause CloudFormation to fail.
Deployment proceeds with warnings for non-critical issues (property drift, etc.).
Key Features
Domain Layer (TDD/DDD/Hexagonal)
Infrastructure Adapters
CLI Integration
frigg deploycommandUsage
Example Output
Blocking Issue Detected
No Issues - Deployment Proceeds
Architecture
Follows Hexagonal Architecture (Ports & Adapters):
Testing
Test categories:
Implementation Details
Blocking Issues (Prevent Deployment)
Warning Issues (Allow Deployment)
Design Decisions
Related
packages/devtools/infrastructure/docs/PRE-DEPLOYMENT-HEALTH-CHECK-SPEC.mdfrigg doctor(post-deployment) andfrigg repaircommandsdomains/health/Commits
feat(infrastructure): implement pre-deployment health check system- Domain layer (1,170 lines)feat(infrastructure): add adapter support for pre-deployment health checks- Infrastructure adapters (268 lines)feat(cli): integrate pre-deployment health check into deploy command- CLI integration (112 lines)Breaking Changes
None. All changes are additive and opt-out via
--skip-pre-checkflag.