summaryrefslogtreecommitdiffstats
path: root/src/watch/detect.rs
diff options
context:
space:
mode:
authoraur-build <aur-build@localhost>2026-11-18 08:23:14 +0000
committeraur-build <aur-build@localhost>2026-11-18 08:23:14 +0000
commiteefbefed9cbea6b2edef65900fbe6cb6da0b48e4 (patch)
tree1249788a49812fc15b644687af7c1384f94ba236 /src/watch/detect.rs
parenta6b652985f40cf022d6c522415c36fad13bc663d (diff)
downloadaur-build-eefbefed9cbea6b2edef65900fbe6cb6da0b48e4.tar.gz
aur-build-eefbefed9cbea6b2edef65900fbe6cb6da0b48e4.zip
http: surfaces driven by live state — staleness, downgrades, deps, rebuild (I6)
Attention, the package page and the builds page now answer real questions instead of rendering empty tables: - Attention lists outdated dependencies derived from the recorded world snapshots, naming the dependency that moved, what the artifact was built against and what the index holds now; also missing dependencies and downgrades (AUR offering a lower version than we serve), which is an announcement for a human, not a build request. - The package page shows depends-on from the recipe we actually serve and needed-by from the packages whose recipes name it, plus staleness and the aur_commit timeline, each release linking into cgit at that exact commit. - Builds rows carry the version they are about, in both the live and the recently-finished table. - A manual rebuild reuses the approved source identity and mints no approval (I6); the test asserts the approval count is unchanged before and after the rebuild runs. - A paused subscription is not observed at all: detection returns Paused without polling, so pausing a broken package stops it opening reviews. - Staleness stays computed on read (§10.2). Nothing stores a stale flag, so nothing can serve a stale lie. Also: dep-client fixture added for dependency pairs.
Diffstat (limited to 'src/watch/detect.rs')
-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 084052f..55b7543 100644
--- a/src/watch/detect.rs
+++ b/src/watch/detect.rs
@@ -20,6 +20,8 @@ use crate::watch::mirror::{read_tree, sync_mirror, Sync};
pub enum Outcome {
/// Nothing moved at all.
NoChange,
+ /// The subscription is paused: we look at nothing and change nothing.
+ Paused,
/// A new review was opened.
Candidate { id: i64, kind: String },
/// The open review was updated in place (I7).
@@ -47,6 +49,16 @@ pub struct CheckReport {
pub fn check_pkgbase(cfg: &Config, db: &Db, name: &str) -> Result<CheckReport> {
let pb = get_pkgbase(db, name)?
.ok_or_else(|| crate::error::Error::not_found(format!("pkgbase {name}")))?;
+ // A paused subscription is not observed at all. Pausing because a package is
+ // broken must not keep opening reviews nobody is going to act on, and it
+ // must not keep polling AUR either. The pause lives on the subscription, so
+ // that is what we consult.
+ let paused = db::get_subscription(db, name)?
+ .map(|s| s.state == subscription_state::PAUSED)
+ .unwrap_or(false);
+ if paused {
+ return Ok(CheckReport { pkgbase: name.into(), head: String::new(), outcome: Outcome::Paused });
+ }
let sync = sync_mirror(cfg, db, name, &pb.aur_url)?;
let head = match &sync {
Sync::Gone => {