fix(compute): address PR review — validation, cleanup, version bump#53
fix(compute): address PR review — validation, cleanup, version bump#53tonychang04 merged 2 commits intomainfrom
Conversation
…liability Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
WalkthroughVersion bump to 0.1.42 with hardened error handling in deploy cleanup, numeric validation for port/memory options, improved memory formatting, clamped log limits, and better CLI usage reporting. Integration tests updated for status flexibility. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/integration/compute.test.ts (1)
64-67: Consider relaxing the status assertion here as well.The "compute get" test (line 66) still expects exactly
'running', but if test execution is fast, the service may still be increatingordeployingstate. This could cause intermittent flakiness similar to what was addressed in the "compute create" test.♻️ Proposed fix
expect(payload.id).toBe(createdServiceId); - expect(payload.status).toBe('running'); + expect(['running', 'creating', 'deploying']).toContain(payload.status);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/integration/compute.test.ts` around lines 64 - 67, The test currently asserts payload.status is exactly 'running' after the "compute get" step; relax this by allowing intermediate states so the test isn't flaky: update the assertion that references payload.status (in the "compute get" test that compares payload.id to createdServiceId) to accept 'creating', 'deploying', or 'running' (e.g., replace the strict toBe('running') check with a containment or regex check that allows those three statuses).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/integration/compute.test.ts`:
- Around line 64-67: The test currently asserts payload.status is exactly
'running' after the "compute get" step; relax this by allowing intermediate
states so the test isn't flaky: update the assertion that references
payload.status (in the "compute get" test that compares payload.id to
createdServiceId) to accept 'creating', 'deploying', or 'running' (e.g., replace
the strict toBe('running') check with a containment or regex check that allows
those three statuses).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5029d0ec-81f4-4db0-9147-e14f87b7ac4d
📒 Files selected for processing (6)
package.jsonsrc/commands/compute/deploy.tssrc/commands/compute/list.tssrc/commands/compute/logs.tssrc/commands/compute/update.tssrc/integration/compute.test.ts
Summary
getFlyToken(deploy.ts)reportCliUsageskipped on empty-list and no-logs paths (list.ts, logs.ts)-MBplaceholder showing when memory is null (list.ts)--limitas positive integer, clamp to [1, 1000] (logs.ts)--portand--memoryas finite numbers (update.ts)🤖 Generated with Claude Code
Note
Fix validation, cleanup error handling, and usage tracking in compute commands
unlinkSync/renameSynccleanup in a try/catch inregisterComputeDeployCommandso filesystem errors during teardown no longer mask the real deploy result.--portand--memoryinregisterComputeUpdateCommand, throwing aCLIErrorfor non-numeric values instead of silently coercing toNaN.--limitoption inregisterComputeLogsCommandto the range [1, 1000].listandlogscommands.listto show'-'for falsy values (e.g.0) instead of'0MB'.Macroscope summarized afd595b.
Summary by CodeRabbit
Release Notes
New Features
--portand--memoryoptions in compute update command with descriptive error messages.Bug Fixes
--limitoption (enforced range: 1-1000).Chores