✨ Add get_status() method for comprehensive status reporting#141
Conversation
Add `get_stack_status()` method to both `RateLimiter` and `SyncRateLimiter` classes to provide programmatic access to CloudFormation stack status, matching the functionality of the `zae-limiter status` CLI command. This change: - Adds async `get_stack_status()` to `RateLimiter` returning stack status string or None if stack doesn't exist - Adds sync `get_stack_status()` to `SyncRateLimiter` wrapping the async implementation - Adds unit tests for both methods covering various CloudFormation states - Updates docs/getting-started.md with tabbed Programmatic/CLI options for checking status - Updates docs/infra/deployment.md with the new programmatic option Closes #115 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #141 +/- ##
==========================================
+ Coverage 87.64% 88.15% +0.51%
==========================================
Files 19 19
Lines 2016 2162 +146
==========================================
+ Hits 1767 1906 +139
- Misses 249 256 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
1 similar comment
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
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: 7e83ffd | Previous: 68a7381 | Ratio |
|---|---|---|---|
tests/benchmark/test_operations.py::TestCascadeOverheadBenchmarks::test_acquire_with_cascade |
32.62154801721996 iter/sec (stddev: 0.03942879027594723) |
137.69645669844323 iter/sec (stddev: 0.0003761862040854996) |
4.22 |
This comment was automatically generated by workflow using github-action-benchmark.
sodre
left a comment
There was a problem hiding this comment.
This should have been a property, not a getter. Also would ti be possible for the CLI to invoke limiter.stack_status() instead what it is doing? What are the tradeoffs?
|
Thanks for the feedback! A few considerations: Property vs MethodFor async operations, a property isn't straightforward because properties can't be awaited. We have a few options:
Given that However, if you prefer, I could rename it to just CLI using limiter.stack_statusThe current CLI uses Trade-offs of using
If we keep the current approach (CLI uses StackManager directly), they're still semantically equivalent - both call What's your preference?
|
Keep get_stack_status.
Let the CLI use StackManager on its own. |
Address review feedback: - Rename `get_stack_status()` to `stack_status()` on RateLimiter (async method) - Rename `get_stack_status()` to `stack_status` property on SyncRateLimiter - Add `*.local.md` to .gitignore - Remove accidentally committed ralph-loop.local.md file - Update tests and documentation accordingly Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…orting Add Status dataclass and get_status() method to provide unified status information across API and CLI: - Status dataclass with connectivity, infrastructure, identity, versions, and table metrics fields - Async get_status() in RateLimiter - Sync get_status() in SyncRateLimiter - Enhanced CLI status command with rich formatted output Closes #115 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add integration tests for RateLimiter.get_status() and SyncRateLimiter.get_status() to verify comprehensive status reporting works against real LocalStack infrastructure. Tests verify: - Connectivity: available flag and latency measurement - Infrastructure: table status reporting - Identity: ZAEL-prefixed name and region - Versions: client version populated - Metrics: table item count available Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove stack_status() method from RateLimiter and SyncRateLimiter (superseded by get_status() which is more comprehensive) - Refactor CLI status command to use StackManager and Repository directly instead of RateLimiter, making it truly read-only - Update CLI tests to mock Repository and StackManager - Remove stack_status tests from unit tests - Enhance e2e CLI output tests to verify all output sections The CLI status command is now a read-only operation that won't trigger any infrastructure upgrades or modifications. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Deploy command now creates the version record in DynamoDB after stack creation, so `zae-limiter status` shows schema/lambda versions immediately instead of N/A. - Add version record initialization step to deploy command - Update docs to use get_status() instead of removed stack_status() - Update CLI status output example in docs - Add e2e test verifying schema version after deploy - Update unit tests to mock Repository for version record Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
Statusdataclass with comprehensive status informationget_status()method toRateLimiterandSyncRateLimiterclassesstatuscommand with rich formatted output showing all status fieldsChanges
New Status Dataclass
The
Statusdataclass consolidates connectivity, infrastructure, identity, versions, and table metrics:New Methods
RateLimiter.get_status()(async):SyncRateLimiter.get_status()(sync):Enhanced CLI Output
The
zae-limiter statuscommand now shows rich formatted output:Test plan
RateLimiter.get_status()covering various statesSyncRateLimiter.get_status()matching async behaviorCloses #115
🤖 Generated with Claude Code