⏪ undo LocalStack legacy CloudFormation engine workaround#86
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #86 +/- ##
==========================================
- Coverage 87.37% 87.17% -0.21%
==========================================
Files 18 18
Lines 1933 1933
==========================================
- Hits 1689 1685 -4
- Misses 244 248 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.30.
| Benchmark suite | Current: 41a577f | Previous: 1bbc649 | Ratio |
|---|---|---|---|
tests/test_performance.py::TestCascadeOverheadBenchmarks::test_acquire_with_cascade |
27.218195583238636 iter/sec (stddev: 0.07316920017406905) |
35.73282947749318 iter/sec (stddev: 0.09186254420360597) |
1.31 |
This comment was automatically generated by workflow using github-action-benchmark.
This reverts commit 1bbc649. Prefer using LocalStack's v2 CloudFormation engine (the default) rather than the legacy engine. While v2 has a stack deletion bug with conditional resources, the legacy engine has its own bug with CloudWatch Alarm Threshold parameters. The v2 engine is the future of LocalStack CloudFormation support, and we should track the upstream bug rather than permanently work around it. Upstream issue: localstack/localstack#13609 Re-opens #81 for tracking until LocalStack fixes the v2 engine. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
41a577f to
a2f4f85
Compare
Code ReviewFound 3 issues that need attention. See inline comments below. |
Issue 1: CloudFormation Bug - Condition MismatchFile: The Bug scenario:
Fix: Change line 497 back to References:
|
Issue 2: Test Coverage ReductionFile: The test changed from using Impact:
Fix: Either:
CLAUDE.md Reference:
Ref: Lines 226 to 229 in a2f4f85 |
Issue 3: Test Deletion Without ReplacementFile: The test Analysis of remaining coverage:
Issue: Fix: Instead of deleting the test, wrap the try:
await manager.delete_stack(stack_name, wait=True)
assert not await manager.stack_exists(stack_name)
except Exception as e:
# Known issue: LocalStack v2 engine has deletion bugs
# See: https://github.com/localstack/localstack/issues/13609
pytest.skip(f"Stack deletion failed (known LocalStack v2 bug): {e}")CLAUDE.md Reference:
Ref: Lines 226 to 229 in a2f4f85 |
Code ReviewFound 2 issues requiring attention: Issue 1: CloudFormation Template Bug - Output References Non-Existent ResourceFile: Problem: The Impact: When
The output will attempt to reference a resource that doesn't exist, causing CloudFormation deployment to fail. Suggested Fix: Condition: DeployAggregatorAlarmsReference:
Issue 2: CLAUDE.md References Non-Existent Pytest MarkerFile: Problem: The PR removes the Impact: The documented command will either fail or return no tests, creating confusion for developers following the documentation. Suggested Fix Options:
Reference: CLAUDE.md testing section at Lines 283 to 296 in a2f4f85 |
1. Fix CloudFormation condition mismatch: AggregatorDLQAlarmName output now uses DeployAggregatorAlarms condition (not DeployAggregator) to match the resource it references. 2. Add test_cloudformation_stack_deployment_no_alarms: Tests the edge case where EnableAggregator=true but EnableAlarms=false. 3. Add test_stack_create_and_delete_minimal: Integration test for full stack lifecycle with graceful handling of LocalStack v2 deletion bug. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The e2e marker was removed by the revert. Update CLAUDE.md to reflect that integration tests now include full stack lifecycle tests. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
This reverts commit 1bbc649 (PR #85) which added the legacy CloudFormation engine workaround.
Rationale: Prefer using LocalStack's v2 CloudFormation engine (the default) rather than the legacy engine. While v2 has a stack deletion bug with conditional resources, the legacy engine has its own bug with CloudWatch Alarm Threshold parameters.
The Dilemma
LocalStack has two CloudFormation engine implementations, each with different bugs:
Decision
The v2 engine is the future of LocalStack CloudFormation support. Rather than permanently work around the v2 bug with the legacy engine (which has its own issues), we should:
Re-opens
This PR re-opens #81 for tracking until LocalStack fixes the v2 engine bug.
Test plan
🤖 Generated with Claude Code