Expand description
Application orchestration for covguard.
This crate provides the high-level check function that orchestrates
the entire diff coverage analysis pipeline:
- Parse the diff to extract changed line ranges
- Parse LCOV coverage data
- Detect ignore directives in source files
- Evaluate coverage against the policy
- Build and return a report with markdown and annotations
§Example
ⓘ
use covguard_orchestrator::{check, CheckRequest};
use covguard_types::Scope;
let request = CheckRequest {
diff_text: "...".to_string(),
diff_file_path: Some("test.patch".to_string()),
lcov_texts: vec!["...".to_string()],
lcov_paths: vec!["coverage.info".to_string()],
threshold_pct: 80.0,
scope: Scope::Added,
..Default::default()
};
let result = check(request)?;
println!("Exit code: {}", result.exit_code);Structs§
- Check
Request - Request for a coverage check operation.
- Check
Result - Result of a coverage check operation.
- System
Clock - System clock implementation that returns the actual current time.
Enums§
- AppError
- Errors that can occur during the check operation.
- FailOn
- Determines when the evaluation should fail.
- Missing
Behavior - How to handle missing coverage data.
Constants§
- DEFAULT_
MAX_ ANNOTATIONS - Backward-compatible constant aliases for output budgets.
- DEFAULT_
MAX_ LINES - DEFAULT_
MAX_ SARIF_ RESULTS
Traits§
- Clock
- Port for obtaining the current UTC time.
- Coverage
Provider - Port for loading and merging LCOV coverage data.
- Diff
Provider - Port for obtaining changed ranges from diff input.
- Repo
Reader - Port for reading source lines from the repository.
Functions§
- build_
report - Build a Report from evaluation output.
- check
- Run a diff coverage check.
- check_
with_ clock - Run a diff coverage check with a custom clock.
- check_
with_ clock_ and_ reader - Run a diff coverage check with a custom clock and repo reader.
- check_
with_ providers_ and_ reader - Run a diff coverage check with pluggable diff and coverage providers.
- detect_
ignored_ lines - Detect lines with
covguard: ignoredirectives in changed ranges. - render_
annotations - Backward-compatible annotation renderer with project-wide default limit.
- render_
annotations_ with_ limit - Annotation renderer with configurable budget.
- render_
markdown - Backward-compatible markdown renderer with project-wide default limit.
- render_
markdown_ with_ limit - Markdown renderer with configurable budget.
- render_
sarif - Backward-compatible SARIF renderer with project-wide default limit.
- render_
sarif_ with_ limit - SARIF renderer with configurable budget.
Type Aliases§
- Coverage
Map - Canonical line-hit representation used at the port boundary.