Skip to content

feat: add metrics subresources CLI commands (API parity)#86

Merged
callumreid merged 6 commits into
mainfrom
feat/cli-api-parity-metrics-subresources
Jul 2, 2026
Merged

feat: add metrics subresources CLI commands (API parity)#86
callumreid merged 6 commits into
mainfrom
feat/cli-api-parity-metrics-subresources

Conversation

@callumreid

@callumreid callumreid commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

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 evaluation
  • coval metrics versions <id> — list metric version history
  • coval metrics baselines <id> {list,get,create,update,delete} — manage baselines
  • coval metrics thresholds <id> {list,get,create,update,delete} — manage thresholds

Verification

  • cargo build
  • cargo clippy
  • cargo test 90/90 ✓

Greptile Summary

This PR adds versions, baselines, and thresholds subcommands to coval metrics, wiring new client methods, models, and command handlers to achieve API parity for metric subresources.

  • New client methods cover list/get/create/update/delete for baselines and thresholds, plus list_versions, with corresponding request/response models (MetricVersion, Baseline, Threshold, and their list wrappers).
  • Command dispatch follows the established two-level subcommand pattern (coval metrics baselines <METRIC_ID> <subcommand>), using clap #[command(subcommand)] with inline metric_id positional args on the parent variant.
  • Test coverage for the new commands is limited to --help flag 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 /threshold endpoint 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

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}
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@callumreid, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 26 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4a7e9023-f818-4f47-ba73-d294b680d2be

📥 Commits

Reviewing files that changed from the base of the PR and between 025e5c7 and dc54ced.

📒 Files selected for processing (5)
  • .gitignore
  • src/client/mod.rs
  • src/client/models/metric.rs
  • src/commands/metrics.rs
  • tests/cli_tests.rs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread src/commands/metrics.rs Outdated
Comment thread src/client/mod.rs
Comment thread src/commands/metrics.rs Outdated
@callumreid callumreid closed this Jul 2, 2026
@callumreid callumreid reopened this Jul 2, 2026
@callumreid callumreid force-pushed the feat/cli-api-parity-metrics-subresources branch from ff6f9da to 9e03a59 Compare July 2, 2026 18:04
@callumreid

Copy link
Copy Markdown
Contributor Author

🟢

@borgesius borgesius left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@callumreid callumreid merged commit 6c332f2 into main Jul 2, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants