feat: instrument telemetry for status command#1317
Conversation
|
Claude Security Review: no high-confidence findings. (run) |
Package TarballHow to installgh release download pr-1317-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-0.14.2.tgz |
agentcore-cli-automation
left a comment
There was a problem hiding this comment.
Nice refactor — telemetry coverage is thorough and the integ tests look good (real CLI invocations, no excessive mocking). One behavioral regression worth fixing before merging: removing the outer try/catch around loadStatusConfig() / handleRuntimeLookup / handleProjectStatus changes the exit code for thrown errors. See inline comment.
Wrap status command execution paths with withCommandRunTelemetry: - Validation errors (invalid --type/--state) - Runtime lookup by ID (--runtime-id) - Default project status Schema changes: - Add runtime-endpoint, config-bundle, ab-test to FilterType enum Error typing: - Use ValidationError for invalid --type/--state input Tests: - Integration tests verifying telemetry emission for all paths
cfa51f8 to
ed0c3dd
Compare
|
Claude Security Review: no high-confidence findings. (run) |
| render(<Text color="red">{result.error.message}</Text>); | ||
| } | ||
| return; | ||
| process.exit(1); |
There was a problem hiding this comment.
This is needed to maintain the current behavior since everything is wrapped in a result now the catch at the end would never get hit.
Ideally we bubble up the result and handle this at a higher-level, but that's a larger refactor that is OOS of this PR and is inconsistent with how the codebase currently does this.
|
Claude Security Review: no high-confidence findings. (run) |
|
Claude Security Review: no high-confidence findings. (run) |
After rebasing, the dataset enrichment code referenced context.deployedState outside the withCommandRunTelemetry callback where context was defined. Rather than hoisting context outside the callback (which would lose telemetry coverage for loadStatusConfig failures), include deployedState in the ProjectStatusResult so it flows through the Result type naturally.
30e9c3a to
37f3b48
Compare
|
Claude Security Review: no high-confidence findings. (run) |
Description
Instrument telemetry for all status command execution paths, following the patterns established by the invoke (#1227) and import (#1312) telemetry PRs.
Schema changes:
runtime-endpoint,config-bundle,ab-testtoFilterTypeenum (previously these valid filter values would silently drop telemetry)Related Issue
Closes #
Documentation PR
N/A — internal telemetry, no user-facing documentation changes.
Type of Change
Testing
How have you tested the change?
npm run test:unitandnpm run test:integnpm run typechecknpm run lintsrc/assets/, I rannpm run test:update-snapshotsand committed the updated snapshotsChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.