Feat/apps observability - #1583
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (24)
📝 WalkthroughWalkthroughAdds env-var management shortcuts, updates env-pull request/response handling, introduces observability log/trace/metric/analytics shortcuts, and adds shared output-schema and validation helpers with expanded tests, docs, registry tips, and e2e coverage. ChangesApps command expansion
Sequence Diagram(s)Env variable write flow sequenceDiagram
participant lark-cli
participant AppsEnvVarSet
participant CallAPITyped
participant create_or_update_env_var
lark-cli->>AppsEnvVarSet: +env-set --app-id ... --key ... --value ...
AppsEnvVarSet->>CallAPITyped: POST create_or_update_env_var
CallAPITyped->>create_or_update_env_var: env, key, value
create_or_update_env_var-->>CallAPITyped: action
CallAPITyped-->>AppsEnvVarSet: response map
AppsEnvVarSet-->>lark-cli: key, env, action
Log detail flow sequenceDiagram
participant lark-cli
participant AppsLogGet
participant search_logs
participant resolve_stack_trace
participant appsPrintSchemaTable
lark-cli->>AppsLogGet: +log-get --log-id ...
AppsLogGet->>search_logs: POST search_logs limit=1
search_logs-->>AppsLogGet: log item
AppsLogGet->>resolve_stack_trace: resolve ERROR log source stack
resolve_stack_trace-->>AppsLogGet: source_stack fields
AppsLogGet->>appsPrintSchemaTable: render normalized row
appsPrintSchemaTable-->>lark-cli: table output
Estimated code review effort🎯 5 (Critical) | ⏱️ ~90+ minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Adds first-class apps environment-variable management and observability shortcuts, aligning command naming and environment flags with common CLI conventions. The change introduces logs, traces, metrics, analytics, and env workflows for Miaoda/Spark apps, with updated skill guidance and focused tests for request shape, output schema, and error handling.
Changes
Add apps observability shortcuts for logs, traces, metrics, and analytics, including shared environment validation, output schemas, dry-run coverage, and OpenAPI request mapping.
Add apps env commands using env naming (+env-list, +env-set, +env-delete) and update +env-pull behavior to use the POST env-vars API.
Standardize user-facing environment flags on --environment only; remove --env usage and do not expose -e shorthand.
Add source-map stack reverse lookup for +log-get, exposing source_stack for applicable frontend error logs.
Improve apps error hints and output behavior around env operations, log detail, metric/analytics query formatting, and JSON/pretty output contracts.
Update lark-apps skill docs for env, env-pull, and observability, including OpenAPI environment mapping and source stack guidance.
Add/rename dry-run E2E and skill-eval coverage for apps env and observability flows.
Test Plan
Unit tests pass: PATH=/usr/local/go/bin:$PATH go test ./shortcuts/apps -count=1
Build passes: PATH=/usr/local/go/bin:$PATH make build
Manual local verification confirms the lark-cli apps env and observability flows work as expected against the proxy/dev test environment
Related Issues
None
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests