feat: add metrics subresources CLI commands (API parity)#86
Conversation
Adds test, versions, baselines, and thresholds subcommands:
- metrics test <id> --simulation-output-id <id>
- metrics versions <id>
- metrics baselines <id> {list,get,create,update,delete}
- metrics thresholds <id> {list,get,create,update,delete}
|
Warning Review limit reached
Next review available in: 26 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
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 |
ff6f9da to
9e03a59
Compare
|
🟢 |
borgesius
left a comment
There was a problem hiding this comment.
Looks reasonable. I checked the backend route table; the threshold singleton/plural split here matches the API, and the baselines/versions paths line up as well.
Summary
Adds test, versions, baselines, and thresholds subcommands to
coval metrics.What's New
coval metrics test <id> --simulation-output-id <id>— queue a test metric evaluationcoval metrics versions <id>— list metric version historycoval metrics baselines <id> {list,get,create,update,delete}— manage baselinescoval metrics thresholds <id> {list,get,create,update,delete}— manage thresholdsVerification
cargo build✓cargo clippy✓cargo test90/90 ✓Greptile Summary
This PR adds
versions,baselines, andthresholdssubcommands tocoval metrics, wiring new client methods, models, and command handlers to achieve API parity for metric subresources.list_versions, with corresponding request/response models (MetricVersion,Baseline,Threshold, and their list wrappers).coval metrics baselines <METRIC_ID> <subcommand>), using clap#[command(subcommand)]with inlinemetric_idpositional args on the parent variant.--helpflag checks; no mock-server integration tests were added for the new API calls.Confidence Score: 4/5
Safe to merge with caution — the new commands compile and the help-output tests pass, but the threshold endpoint design contains a URL inconsistency that will cause one operation to hit the wrong API path at runtime.
The bulk of the change is mechanical scaffolding (models, client methods, command dispatch) that follows established patterns in the codebase. The baseline CRUD and version listing look correct. The threshold subresource, however, mixes two incompatible REST shapes: get and update target a singular
/thresholdendpoint with no ID, while delete targets/thresholds/{threshold_id}. Whichever shape the real API uses, one of those calls will fail with a 404 or routing error for every user who invokes it.src/client/mod.rs — the threshold client methods (
get_threshold,update_threshold,delete_threshold) need to agree on whether the resource is addressed by a threshold ID or as a singleton per metric.Reviews (7): Last reviewed commit: "fix: resolve metrics subresource conflic..." | Re-trigger Greptile