Skip to content

[HR-160] Add ground_truth_subvalues_by_timestamp to annotation create/update#52

Merged
kdmelon merged 1 commit into
mainfrom
cli/add-subvalues-to-create-update
Mar 25, 2026
Merged

[HR-160] Add ground_truth_subvalues_by_timestamp to annotation create/update#52
kdmelon merged 1 commit into
mainfrom
cli/add-subvalues-to-create-update

Conversation

@kdmelon

@kdmelon kdmelon commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

The response model already supported subvalues (#45 ), but the create and update request models did not include the field. This adds --ground-truth-subvalues flag (JSON string) to both commands and wires it through to the API.

Summary by CodeRabbit

  • New Features
    • Enhanced review annotation capabilities: Users can now optionally specify ground truth subvalues organized by timestamp when creating or updating review annotations. This new functionality is accessible through command-line arguments that support JSON input format, with built-in validation to ensure proper data formatting and comprehensive error handling for invalid data submissions.

…/update

The response model already supported subvalues (HR-148), but the
create and update request models did not include the field. This adds
--ground-truth-subvalues flag (JSON string) to both commands and wires
it through to the API.
@coderabbitai

coderabbitai Bot commented Mar 25, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The changes extend review annotation request models with a new optional field for ground truth subvalues by timestamp, and update CLI commands to accept and parse this data as JSON input.

Changes

Cohort / File(s) Summary
Review Annotation Models
src/client/models/review_annotation.rs
Added optional ground_truth_subvalues_by_timestamp field to both CreateReviewAnnotationRequest and UpdateReviewAnnotationRequest structs, with conditional serialization.
Review Annotation CLI Commands
src/commands/review_annotations.rs
Added optional ground_truth_subvalues CLI argument to CreateArgs and UpdateArgs; parses JSON input and populates the corresponding request field, with error propagation for invalid JSON.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A timestamp-bound truth takes flight,
New subvalues parsed just right,
JSON whispers through the CLI,
Review annotations multiply!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary change: adding the ground_truth_subvalues_by_timestamp field to annotation create/update operations.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cli/add-subvalues-to-create-update

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 and usage tips.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/commands/review_annotations.rs`:
- Around line 118-121: The JSON parsing for the CLI flag
--ground-truth-subvalues is duplicated and lacks flag-specific context on
failure; centralize the parse by replacing both occurrences with a single parse
helper (or a single mapped call) that takes args.ground_truth_subvalues and
returns the deserialized value, and when calling serde_json::from_str add
map_err or context that includes the flag name (e.g.,
"--ground-truth-subvalues") so errors identify the flag; update references to
use the new helper/result and remove the duplicated serde_json::from_str calls
(symbols to change: args.ground_truth_subvalues, subvalues, and the duplicated
parse site around lines with the second serde_json::from_str).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fbea5018-eebe-46a1-95e5-2f3d0be6c802

📥 Commits

Reviewing files that changed from the base of the PR and between 2ec8570 and 6a7a0cd.

📒 Files selected for processing (2)
  • src/client/models/review_annotation.rs
  • src/commands/review_annotations.rs

Comment thread src/commands/review_annotations.rs
@kdmelon kdmelon merged commit 2b7f47b into main Mar 25, 2026
7 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