summaryrefslogtreecommitdiffstats
path: root/src/usecase/reviews.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/usecase/reviews.rs')
-rw-r--r--src/usecase/reviews.rs29
1 files changed, 9 insertions, 20 deletions
diff --git a/src/usecase/reviews.rs b/src/usecase/reviews.rs
index 8cbb534..31aa859 100644
--- a/src/usecase/reviews.rs
+++ b/src/usecase/reviews.rs
@@ -14,11 +14,8 @@ pub struct Prepared {
}
/// Render the current diff and store its digest, so the approval that follows
-/// can be checked against exactly what was shown rather than whatever the tree
-/// looked like a moment later.
-///
-/// `Ok(None)` means there is no such candidate; each front end says so in its
-/// own words.
+/// is checked against what was actually shown. `Ok(None)` means no such
+/// candidate.
pub fn prepare_review(cfg: &Config, db: &Db, candidate_id: i64) -> Result<Option<Prepared>> {
let Some(c) = candidates::candidate_by_id(db, candidate_id)? else {
return Ok(None);
@@ -28,10 +25,8 @@ pub fn prepare_review(cfg: &Config, db: &Db, candidate_id: i64) -> Result<Option
Ok(Some(Prepared { candidate: c, text, digest }))
}
-/// `prepare_review`, plus recording that a human actually looked at it.
-///
-/// The review queue uses "viewed" to stop surfacing candidates nobody is
-/// reading, so looking and approving are separate facts.
+/// `prepare_review`, plus recording that a human looked at it — looking and
+/// approving are separate facts.
pub fn view_review(cfg: &Config, db: &Db, candidate_id: i64) -> Result<Option<Prepared>> {
let Some(p) = prepare_review(cfg, db, candidate_id)? else {
return Ok(None);
@@ -43,10 +38,7 @@ pub fn view_review(cfg: &Config, db: &Db, candidate_id: i64) -> Result<Option<Pr
/// An approval that was recorded, and whether a build came out of it.
pub struct Approved {
pub approval: ap::Approval,
- /// Queuing is fatal in the CLI — an approved candidate with no build is a
- /// silent stall — and a soft failure in the UI, which has already committed
- /// the decision and can retry from the package page. So the workflow
- /// reports it rather than choosing for both.
+ /// Fatal in the CLI, soft in the UI: reported, not decided for both.
pub queued: Result<String>,
}
@@ -56,11 +48,8 @@ pub enum Approval {
Refused(ap::Stale),
}
-/// Record an approval and queue the build it authorises.
-///
-/// These are one workflow because an approval that never queues is the bug the
-/// whole review queue exists to prevent, and both front ends had to remember to
-/// pair them.
+/// Record an approval and queue the build it authorises; one workflow, so an
+/// approval can never fail to queue.
pub fn approve(
cfg: &Config,
db: &Db,
@@ -92,8 +81,8 @@ pub enum Decision {
}
/// Apply one decision to many candidates, queueing a build for each that
-/// passed. Items that were refused — high risk without a confirmation, say —
-/// come back with the reason rather than aborting the batch.
+/// passed. A refused item comes back with its reason rather than aborting the
+/// batch.
pub fn bulk(
cfg: &Config,
db: &Db,