Skip to content
Open
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ The command sends the exact 40-character lowercase SHA supplied by CI and does n

`proofline export reviews --from 2026-10-01T00:00:00Z --to 2026-10-25T00:00:00Z --format csv` writes one export page to stdout and requires `analytics:read`. The datasets are `reviews`, `findings`, `finding_outcomes`, `finding_validations`, and `spend`. The default format is NDJSON, while CSV repeats its header on every page. The settled horizon and optional next cursor go to stderr. Repeat with `--cursor` and the same window and `--group-by` to continue. A failed page exits nonzero; never treat partial output from several invocations as a complete export.

`proofline stats --from 2026-10-01T00:00:00Z --to 2026-10-25T00:00:00Z` answers how long reviews take and how often they finish, per repository. It reads every page of the `reviews` export for the window, so it needs `analytics:read` and the same window of at most 31 days. It counts pull-request reviews only; repeat `--kind` to choose others (`pull_request`, `deployment`, `patch`, `commit`, `files`, `merge_group`, `revision_scan`), so scans or deployments never skew how long pull requests wait. It then prints one row per repository, grouped by repository ID and shown by its current name, and an `all` row: the reviews counted by status (`completed`, `incomplete`, `failed`, `unfinished` for pending or running, and `other`) and the p50, p90, p99 and longest time from creation to completion of the completed reviews, by the nearest-rank method. A review that is incomplete, failed or stopped gave no usable result, so it has no turnaround. `--json` prints the same report with times in seconds. The settled horizon, page count, counted kinds and number of reviews left out go to stderr. The report appears only after the last page: a failed page, a horizon that changes between pages or a cursor that repeats exits 1 and prints no partial report.

## Development and publishing

Build from source with `cargo build --locked --release`. `rustup` installs the pinned Rust toolchain. Run `cargo fmt --check`, `cargo clippy --locked --all-targets -- -D warnings`, `cargo test --locked`, and `cargo deny check` before submitting a pull request. Adding an API operation exposes a CLI command only when a command in `src/` declares and uses it.
Expand Down
13 changes: 13 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ mod sarif;
mod scan;
mod setup;
mod severity;
mod stats;
pub mod text;
mod tls;
pub mod update;
Expand Down Expand Up @@ -140,6 +141,14 @@ enum Command {
FixPrompt { finding_id: Uuid },
/// Export one page of analytics as CSV or NDJSON.
Export(tools::ExportArgs),
/// Report each repository's review outcomes and turnaround over a window.
///
/// Reads every page of the `reviews` export for the window, then prints
/// per repository the reviews by status and the p50, p90, p99 and
/// longest time from creation to completion of its completed reviews.
/// It counts pull-request reviews unless `--kind` selects others. It
/// needs `analytics:read` and prints nothing unless every page reads.
Stats(stats::StatsArgs),
/// Print a shell completion script to standard output.
///
/// For example, add `source <(proofline completions zsh)` to `~/.zshrc`,
Expand Down Expand Up @@ -619,6 +628,10 @@ pub async fn run(cli: Cli, token: Option<SecretString>) -> anyhow::Result<Verdic
let api = connect(Http::new(origin)?, token, cli.org).await?;
tools::export(&api, &args).await
}
Command::Stats(args) => {
let api = connect(Http::new(origin)?, token, cli.org).await?;
stats::run(&api, &args).await
}
Command::Findings(args) => {
if let Some(head) = &args.selector.head {
git::commit_sha(head)?;
Expand Down
Loading