summaryrefslogtreecommitdiffstats
path: root/src/watch
diff options
context:
space:
mode:
authoraur-build <aur-build@localhost>2026-11-18 18:34:16 +0000
committeraur-build <aur-build@localhost>2026-11-18 18:34:16 +0000
commit1abce8ba992353bca3d7b64b2633a15136e9303b (patch)
treec265088f9968e1e540402a155d08a5b16c59fac0 /src/watch
parentfdd004c50de6131be193044ae40424d691425a81 (diff)
downloadaur-build-1abce8ba992353bca3d7b64b2633a15136e9303b.tar.gz
aur-build-1abce8ba992353bca3d7b64b2633a15136e9303b.zip
pipeline, watch: a source identity that is complete when it exists
n-1. `SourceIdentity::from_candidate` returned a value with `aur_commit` and `recipe_hash` set to empty strings, which `Ctx::new` overwrote afterwards if it found the snapshot row. So the type had two meanings for "" — not filled in yet, and genuinely absent — and the second half of the construction was a convention rather than a requirement: a new call site could produce a build that recorded empty provenance and never noticed. The snapshot is an argument now, a candidate without its snapshot is an error rather than a quieter build, and the field `identity_hash`, which nothing ever read, is gone. n-2. `detect::Outcome` mirrors four of `candidates::Upsert`'s variants. Kept, with the reason in the code: `Upsert` answers "what did the candidate write do" and `Outcome` answers "what should the watcher do next", including the outcomes that never reach the candidate table (paused, gone, blocked, notice). Merging them would move watcher concerns into the review module and put storage vocabulary in the scheduler's matches. The converter is total and compiler-checked, which is what makes the mirror safe.
Diffstat (limited to 'src/watch')
-rw-r--r--src/watch/detect.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/watch/detect.rs b/src/watch/detect.rs
index d2ffd4e..6271dae 100644
--- a/src/watch/detect.rs
+++ b/src/watch/detect.rs
@@ -16,6 +16,18 @@ use crate::time;
use crate::watch::digests::resolve_sources;
use crate::watch::mirror::{read_tree, sync_mirror, Sync};
+/// What one check of one pkgbase resulted in.
+///
+/// Four variants mirror [`Upsert`], and that is deliberate rather than lazy
+/// duplication (n-2). `Upsert` answers a storage question — what did the
+/// candidate write do — and belongs to `review::candidates`; `Outcome` answers
+/// the watcher's question — what should happen next, including the cases that
+/// never reach the candidate table at all (paused, gone, blocked, a
+/// non-publishable notice). Folding them into one enum would put
+/// `Paused`/`Blocked` next to `Collapsed` in the review module, where they mean
+/// nothing, and would make every caller in the scheduler match on storage
+/// vocabulary. `outcome_of` is the total, compiler-checked translation between
+/// the two, and it is the only place that knows both.
#[derive(Debug, Clone)]
pub enum Outcome {
/// Nothing moved at all.