Draft
Conversation
Implements TDD-based pre-deployment health check following DDD and hexagonal architecture principles. Key features: - BlockingCategory value object for categorizing pre-deployment issues - PreDeploymentCategorizer service for determining if issues block deployment - RunPreDeploymentHealthCheckUseCase for orchestrating pre-deployment checks - Extended Issue entity with INVALID_STACK_STATE, QUOTA_EXCEEDED, and MISSING_DEPENDENCY types The system detects blocking issues before deployment: - Invalid CloudFormation stack states (ROLLBACK_COMPLETE, CREATE_FAILED, etc.) - Orphaned resources that cause AlreadyExistsException (KMS aliases, VPCs, etc.) - Service quota violations - Missing dependencies All components implemented with comprehensive test coverage (57 passing tests). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…hecks Updates AWSResourceDetector adapter and IResourceDetector port to support pre-deployment health checks: Adapter enhancements: - Added AWS::KMS::Alias detection support (key blocker for deployments) - Added support for additional resource types (S3, Lambda, RDS, DynamoDB) - Updated findOrphanedResources to accept expectedResources from template - Implemented checkServiceQuotas method stub for quota validation - Improved orphan detection logic for pre-deployment scenarios Port interface updates: - Updated findOrphanedResources signature to support both pre and post-deployment - Added checkServiceQuotas method definition Testing: - Added comprehensive integration tests covering end-to-end scenarios - Tests verify orphaned resource detection, stack state validation, and first-time deployments - All 4 integration tests passing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Adds comprehensive pre-deployment health check to frigg deploy command to prevent deployment failures before they happen. CLI Integration: - Added runPreDeploymentHealthCheck function that executes before serverless deploy - Integrated with existing deploy workflow (runs after env validation, before deployment) - Added --skip-pre-check flag to bypass pre-deployment checks if needed - Fails fast with clear error messages when blocking issues detected - Shows warnings but allows deployment for non-blocking issues User Experience: - Progress indicators for each check step (6 steps total) - Detailed issue reporting with resource types and resolutions - Clear distinction between blocking issues (🚫) and warnings (⚠️ ) - Actionable recommendations (e.g., "frigg repair --import") - Fail-open on errors (allows deployment to proceed if check fails) Flow: 1. Check stack status (detects ROLLBACK_COMPLETE, etc.) 2. Validate stack state is deployable 3. Parse deployment template 4. Check for orphaned resources (KMS aliases, VPCs, etc.) 5. Check service quotas 6. Categorize and report issues Deployment is blocked if: - Stack in invalid state (ROLLBACK_COMPLETE, CREATE_FAILED, etc.) - Orphaned resources found (KMS aliases, named buckets, etc.) - Service quotas exceeded - Missing dependencies detected Deployment proceeds with warnings for: - Property drift (mutable properties) - Degraded health score - Missing optional tags 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
d1065b0 to
9f7e145
Compare
|
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.




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.