Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api-coverage-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ and update `reviewed_at`.
| First-class CLI operations | 131 |
| Reviewed gaps | 68 |
| Client operations | 155 |
| Published request fields on covered operations | 475 |
| Request fields modeled by the CLI | 474 |
| Published request fields on covered operations | 477 |
| Request fields modeled by the CLI | 476 |
| Reviewed request-field gaps | 1 |
| Published header and query parameters on covered operations | 196 |
| Parameters the CLI can send | 144 |
Expand Down
6 changes: 3 additions & 3 deletions api-coverage.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

[snapshot]
catalog_url = "https://api.coval.dev/v1/openapi"
reviewed_at = "2026-11-06"
reviewed_at = "2026-11-16"
published_operations = 199
cli_supported_operations = 131
published_request_fields = 475
cli_modeled_request_fields = 474
published_request_fields = 477
cli_modeled_request_fields = 476
published_parameters = 196
cli_supported_parameters = 144

Expand Down
25 changes: 25 additions & 0 deletions src/client/models/review_project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,19 @@ pub enum BatchAssignmentMode {
ManagerAssigned,
}

#[derive(Debug, Clone, Copy, Serialize, Deserialize, ValueEnum)]
pub enum BatchAllocationOrder {
#[serde(rename = "LIST_ORDER")]
#[value(name = "LIST_ORDER")]
ListOrder,
#[serde(rename = "LATEST_ADDED_FIRST")]
#[value(name = "LATEST_ADDED_FIRST")]
LatestAddedFirst,
#[serde(rename = "RANDOM")]
#[value(name = "RANDOM")]
Random,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct CreateReviewProjectRequest {
pub display_name: String,
Expand Down Expand Up @@ -88,6 +101,12 @@ pub struct CreateReviewProjectRequest {
skip_serializing_if = "Option::is_none"
)]
pub batch_size: Option<Option<u8>>,
#[serde(
default,
deserialize_with = "super::explicit_option",
skip_serializing_if = "Option::is_none"
)]
pub batch_allocation_order: Option<Option<BatchAllocationOrder>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub allow_metric_skipping: Option<bool>,
#[serde(
Expand Down Expand Up @@ -152,6 +171,12 @@ pub struct UpdateReviewProjectRequest {
skip_serializing_if = "Option::is_none"
)]
pub batch_size: Option<Option<u8>>,
#[serde(
default,
deserialize_with = "super::explicit_option",
skip_serializing_if = "Option::is_none"
)]
pub batch_allocation_order: Option<Option<BatchAllocationOrder>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub allow_metric_skipping: Option<bool>,
#[serde(
Expand Down
24 changes: 23 additions & 1 deletion src/commands/review_projects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use anyhow::Result;
use clap::{Args, Subcommand};

use crate::client::models::{
BatchAssignmentMode, CreateReviewProjectRequest, ListParams, ProjectType,
BatchAllocationOrder, BatchAssignmentMode, CreateReviewProjectRequest, ListParams, ProjectType,
UpdateReviewProjectRequest,
};
use crate::client::CovalClient;
Expand Down Expand Up @@ -100,6 +100,12 @@ pub struct CreateArgs {
batch_assignment_mode: Option<BatchAssignmentMode>,
#[arg(long, value_parser = clap::value_parser!(u8).range(1..=50), help = "Conversations per reviewer batch (1-50)")]
batch_size: Option<u8>,
#[arg(
long,
value_enum,
help = "Which free conversations a new reviewer batch takes"
)]
batch_allocation_order: Option<BatchAllocationOrder>,
}

#[derive(Args)]
Expand Down Expand Up @@ -165,6 +171,12 @@ pub struct UpdateArgs {
batch_assignment_mode: Option<BatchAssignmentMode>,
#[arg(long, value_parser = clap::value_parser!(u8).range(1..=50), help = "Conversations per reviewer batch (1-50)")]
batch_size: Option<u8>,
#[arg(
long,
value_enum,
help = "Which free conversations a new reviewer batch takes"
)]
batch_allocation_order: Option<BatchAllocationOrder>,
}

#[derive(Args)]
Expand Down Expand Up @@ -251,6 +263,11 @@ pub async fn execute(
args.batch_assignment_mode,
)?;
input_json::insert(&mut input, "batch_size", args.batch_size)?;
input_json::insert(
&mut input,
"batch_allocation_order",
args.batch_allocation_order,
)?;
let req: CreateReviewProjectRequest = input_json::finish(input)?;
let project = client.review_projects().create(req).await?;
emit_one_with_actions(
Expand Down Expand Up @@ -318,6 +335,11 @@ pub async fn execute(
args.batch_assignment_mode,
)?;
input_json::insert(&mut input, "batch_size", args.batch_size)?;
input_json::insert(
&mut input,
"batch_allocation_order",
args.batch_allocation_order,
)?;
let req: UpdateReviewProjectRequest = input_json::finish(input)?;
let project = client
.review_projects()
Expand Down
29 changes: 24 additions & 5 deletions tests/cli_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8703,9 +8703,10 @@ async fn test_november_parity_review_batch_settings_preserve_null_and_omission()
("PATCH", "update", "/v1/review-projects/proj456"),
] {
for settings in [
json!({"batch_assignment_mode": "SELF", "batch_size": 1}),
json!({"batch_assignment_mode": "MANAGER", "batch_size": 50}),
json!({"batch_assignment_mode": null, "batch_size": null}),
json!({"batch_assignment_mode": "SELF", "batch_size": 1, "batch_allocation_order": "LIST_ORDER"}),
json!({"batch_assignment_mode": "MANAGER", "batch_size": 50, "batch_allocation_order": "LATEST_ADDED_FIRST"}),
json!({"batch_assignment_mode": null, "batch_size": null, "batch_allocation_order": "RANDOM"}),
json!({"batch_assignment_mode": null, "batch_size": null, "batch_allocation_order": null}),
json!({}),
] {
let server = MockServer::start().await;
Expand Down Expand Up @@ -8734,7 +8735,11 @@ async fn test_november_parity_review_batch_settings_preserve_null_and_omission()
.assert()
.success();
let body = capture.take();
for field in ["batch_assignment_mode", "batch_size"] {
for field in [
"batch_assignment_mode",
"batch_size",
"batch_allocation_order",
] {
assert_eq!(body.get(field), settings.get(field));
}
}
Expand All @@ -8751,16 +8756,19 @@ async fn test_november_parity_review_batch_flags_override_json() {
"update",
"proj456",
"--input-json",
r#"{"batch_assignment_mode":null,"batch_size":null}"#,
r#"{"batch_assignment_mode":null,"batch_size":null,"batch_allocation_order":null}"#,
"--batch-assignment-mode",
"MANAGER",
"--batch-size",
"7",
"--batch-allocation-order",
"RANDOM",
],
)
.await;
assert_eq!(body["batch_assignment_mode"], "MANAGER");
assert_eq!(body["batch_size"], 7);
assert_eq!(body["batch_allocation_order"], "RANDOM");
}

fn november_uploaded_response() -> Value {
Expand Down Expand Up @@ -8926,6 +8934,17 @@ async fn test_november_parity_rejects_invalid_batch_mode_and_flag_ranges() {
.assert()
.failure()
.stderr(predicate::str::contains("unknown variant"));
coval_with_api(&server)
.args([
"review-projects",
"update",
"proj456",
"--input-json",
r#"{"batch_allocation_order":"OTHER"}"#,
])
.assert()
.failure()
.stderr(predicate::str::contains("unknown variant"));
for value in ["0", "51"] {
coval_with_api(&server)
.args([
Expand Down
Loading