diff options
Diffstat (limited to 'src/review')
| -rw-r--r-- | src/review/approve.rs | 26 | ||||
| -rw-r--r-- | src/review/diff.rs | 12 | ||||
| -rw-r--r-- | src/review/intake.rs | 23 | ||||
| -rw-r--r-- | src/review/reads.rs | 8 |
4 files changed, 14 insertions, 55 deletions
diff --git a/src/review/approve.rs b/src/review/approve.rs index 26963d6..afda51b 100644 --- a/src/review/approve.rs +++ b/src/review/approve.rs @@ -142,7 +142,6 @@ pub fn reject(db: &Db, actor: &str, candidate_id: i64, note: &str) -> Result<()> } #[derive(Debug)] -// BulkItem stays `pub`: one outcome of `approve::bulk`, which tests/approve.rs drives directly. pub struct BulkItem { pub candidate: Option<CandidateRow>, pub outcome: BulkOutcome, @@ -161,10 +160,7 @@ pub enum BulkOutcome { Refused(BulkRefusal), } -/// The real definition. The module is private, so this `pub` -/// is not a nameable path from outside; the alias below is the -/// only way to reach it, and the alias is what carries the -/// feature-conditional visibility. +/// The real definition; the alias below carries the visibility. mod bulk_refusal { use super::{Error, Stale}; @@ -183,11 +179,7 @@ mod bulk_refusal { } } -/// The payload of one `BulkOutcome::Refused` arm. The bulk tests construct it to assert which approval was refused. -/// -/// `pub` only under `test-support`. Production reaches the type -/// through its own module and never names it from outside; the -/// outside reader that needs the name is a test. +/// The payload of one `BulkOutcome::Refused` arm. #[cfg(feature = "test-support")] pub use bulk_refusal::BulkRefusal; @@ -229,17 +221,9 @@ pub fn bulk( Ok(out) } -/// Withdraw a published release and unpublish its files. -/// -/// Nothing in production reaches this today: the CLI and the web UI both go -/// through `usecase::withdraw_package`, which withdraws a *package* and -/// republishes the repo. This is the single-release operation underneath what -/// that path will eventually use, and `tests/pipeline.rs` is what pins its -/// invariants — a second withdraw is refused, an unknown release is refused. -/// -/// So it is compiled only under `test-support`. A release build does not carry -/// an operation nothing invokes; when production grows the call, the gate comes -/// off and the test that already exists becomes the regression cover. +/// Withdraw a published release and unpublish its files. The user-facing path +/// is `usecase::withdraw_package`; this is the single-release operation under +/// it, and nothing in production calls it yet. #[cfg(feature = "test-support")] pub fn withdraw(db: &Db, actor: &str, release_id: i64, reason: &str) -> Result<()> { let actor = actor.to_string(); diff --git a/src/review/diff.rs b/src/review/diff.rs index f997b3c..afe2a43 100644 --- a/src/review/diff.rs +++ b/src/review/diff.rs @@ -293,17 +293,7 @@ pub fn diff_digest(ps: &[Panel]) -> String { } /// Render a candidate's diff, store its digest on the row, and return it. -/// -/// Test-tier only, and that is worth stating plainly because the number says -/// something alarming at first glance: zero callers in `src/`, seventeen test -/// files. Intake renders through `review::intake::record`, which is the single -/// entry point the pipeline and both front ends use; this is the older, -/// uncomposed form that says "render and store" in two steps. It stays because -/// a test that wants a digest without running intake wants exactly this, and it -/// is gated rather than moved to `tests/common` because it needs this module's -/// private `panels`/`render_text` and `candidates::set_diff_digest` — widening -/// those to let a test out would undo the narrowing this crate just spent a -/// dozen commits doing. +/// Production renders through `review::intake::record`. #[cfg(feature = "test-support")] pub fn render_and_store(db: &Db, cfg: &Config, c: &CandidateRow) -> Result<String> { let base = match c.base_release_id { diff --git a/src/review/intake.rs b/src/review/intake.rs index 78e4eb6..48620aa 100644 --- a/src/review/intake.rs +++ b/src/review/intake.rs @@ -1,14 +1,5 @@ -//! Turning a detected change into a scored candidate is one operation. -//! -//! The watcher used to perform review's write protocol itself: look up the -//! accepted release, upsert the candidate, assess the risk, store the risk, -//! work out the missing dependencies, store those. Six calls that only make -//! sense in that order, issued by a module that has no business knowing the -//! order — and if it got the order wrong, or skipped the scoring because it was -//! in a hurry, nothing would have complained. -//! -//! `record` is the protocol. The watcher calls it once with what it observed, -//! and review decides what a candidate means. +//! Turning a detected change into a scored candidate is one operation: +//! `record`, so the watcher never has to know the order of review's writes. use crate::config::Config; use crate::db::{ @@ -20,9 +11,8 @@ use crate::error::Result; use crate::review::candidates::{self, NewCandidate, Upsert}; use crate::review::risk; -/// Record a detected change as a candidate, scored. Returns what the upsert -/// decided so the caller can report it; a change that collapsed or was already -/// rejected is recorded as such and scored only when a candidate row exists. +/// Record a detected change as a candidate, scored. A change that collapsed or +/// was already rejected is recorded as such and scored only if a row exists. pub fn record( db: &Db, cfg: &Config, @@ -47,9 +37,8 @@ pub fn record( Ok(up) } -/// Dependencies this recipe needs that we build ourselves but have not -/// published yet — the reason a build would fail on a missing dep, said before -/// it runs. +/// Dependencies we build ourselves but have not published yet, so a build that +/// would fail on one says so before it runs. fn missing_deps(db: &Db, pb: &Pkgbase, recipe: &Recipe) -> Vec<String> { let Ok(ours) = db::our_package_names(db) else { return Vec::new() }; let mut out = Vec::new(); diff --git a/src/review/reads.rs b/src/review/reads.rs index 0f91f74..c82d90b 100644 --- a/src/review/reads.rs +++ b/src/review/reads.rs @@ -1,9 +1,5 @@ -//! Reading review's state without reaching into its tables. -//! -//! The pipeline needs two facts about a candidate: the row itself, and whether -//! a human approved it. It used to fetch them by calling through review's -//! re-exports of db's query functions, which meant the step machine knew the -//! shape of review's storage. These two calls are the whole of what it needs. +//! The two facts the pipeline needs about a candidate: the row, and whether a +//! human approved it. use crate::db::{self, approvals, model::CandidateRow, Db}; use crate::error::Result; |
