Skip to content

feat: support --app with both directory path and app command#617

Merged
go-to-k merged 15 commits intomainfrom
test/stack-deleter-unit-tests
Mar 30, 2026
Merged

feat: support --app with both directory path and app command#617
go-to-k merged 15 commits intomainfrom
test/stack-deleter-unit-tests

Conversation

@go-to-k
Copy link
Copy Markdown
Owner

@go-to-k go-to-k commented Mar 30, 2026

Summary

Support CDK CLI-compatible --app option that accepts both a cdk.out directory path and an app command string.

Behavior

-a value Action
Directory (e.g. ./cdk.out) Read manifest directly, skip synthesis
Command (e.g. npx ts-node bin/app.ts) Run npx cdk synth --app "command"
Not specified Run npx cdk synth using cdk.json

Tests

  • Unit: TestIsDirectory, TestCdkAction_AppPathDirectory, TestCdkAction_AppPathCommand
  • E2E: make e2e_cdk_app_option (deploys 2 stacks, deletes one via directory path, other via app command)

go-to-k added 11 commits March 30, 2026 16:39
- Add buildDependencyGraph and deleteSingleStackFunc fields to StackDeleter for DI
- Add NewStackDependencyGraphForTest helper in operation package
- Add 7 flow tests: independent stacks, dependency order, complex deps
  (6 stacks), build graph error, circular dependency, deletion error,
  concurrency limit verification
Replace stackDeleterIface with direct func fields (deleteStacksFunc,
deleteSingleStackFunc) on both StackDeleter and CdkDeleter.
Remove the thin deleteSingleStack wrapper method from StackDeleter.
Fix gofmt formatting.
- Extract ConfigLoader, DependencyAnalyzer, StackExecutor interfaces
  with default implementations in separate files
- StackDeleter and CdkDeleter use interfaces instead of func fields
- All default implementations are public structs
- Update tests to use mock implementations of interfaces
- ConfigLoader interface -> IConfigLoader, DefaultConfigLoader -> ConfigLoader
- DependencyAnalyzer interface -> IDependencyAnalyzer, DefaultDependencyAnalyzer -> DependencyAnalyzer
- StackExecutor interface -> IStackExecutor, DefaultStackExecutor -> StackExecutor
- When -a is a directory, read cdk.out directly (existing behavior)
- When -a is not a directory, pass it as --app to npx cdk synth
- Add unit tests for isDirectory and both -a paths
- Add e2e_cdk_app_option Makefile target testing both patterns
- Update CLI flag description
go-to-k added 4 commits March 30, 2026 20:05
- Add e2e/cdk_app_option/ with single-stack SNS Topic CDK app
- e2e_cdk_app_option: deploys, deletes via -a directory, redeploys,
  deletes via -a app command
- Add build dependency to e2e target
- Separate from cdk_integration to avoid cdk.out conflicts
@go-to-k go-to-k merged commit 2a3e891 into main Mar 30, 2026
2 checks passed
@go-to-k go-to-k deleted the test/stack-deleter-unit-tests branch March 30, 2026 11:38
This was referenced Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant