Resolve without mutation, network requests, model invocation or approval. Session context must be supplied explicitly by the invoking client.
(repo: &Repository, args: &IncrementalArgs)
| 421 | /// Resolve without mutation, network requests, model invocation or approval. |
| 422 | /// Session context must be supplied explicitly by the invoking client. |
| 423 | pub fn resolve(repo: &Repository, args: &IncrementalArgs) -> CliResult<IncrementalReport> { |
| 424 | let selected = [&args.turn, &args.intent, &args.change, &args.view] |
| 425 | .iter() |
| 426 | .filter(|value| value.is_some()) |
| 427 | .count() |
| 428 | + usize::from(args.from.is_some() || args.to.is_some()); |
| 429 | if selected > 1 { |
| 430 | return Err(invalid("review selectors are mutually exclusive")); |
| 431 | } |
| 432 | if args.from.is_some() != args.to.is_some() { |
| 433 | return Err(invalid("--from and --to must be supplied together")); |
| 434 | } |
| 435 | if args |
| 436 | .findings |
| 437 | .as_ref() |
| 438 | .is_some_and(|bytes| bytes.len() > 1024 * 1024) |
| 439 | { |
| 440 | return Err(invalid("review findings input exceeds 1 MiB")); |
| 441 | } |
| 442 | if args |
| 443 | .risk_profile |
| 444 | .as_ref() |
| 445 | .is_some_and(|bytes| bytes.len() > 64 * 1024) |
| 446 | { |
| 447 | return Err(invalid("risk profile exceeds 64 KiB")); |
| 448 | } |
| 449 | if args.from.is_some() || args.to.is_some() { |
| 450 | return super::view_comparison::resolve(repo, args); |
| 451 | } |
| 452 | if args.view.is_some() { |
| 453 | return super::view_snapshot::resolve(repo, args); |
| 454 | } |
| 455 | resolve_with_session(repo, args, args.session_id.as_deref()) |
| 456 | } |
| 457 | |
| 458 | fn resolve_with_session( |
| 459 | repo: &Repository, |
no test coverage detected