From bc543e4182d51917fe6bfa608af2c09c8b578671 Mon Sep 17 00:00:00 2001 From: aur-build Date: Wed, 18 Nov 2026 09:25:13 +0000 Subject: =?UTF-8?q?staleness:=20blocked=20builds=20wait=20properly,=20and?= =?UTF-8?q?=20the=20review=20answers=20=C2=A710.3=20before=20you=20approve?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three real defects, all found while writing the tests that pin §10 down: - **requeue_blocked requeued everything blocked.** The dispatcher sweeps it every pass, so a build waiting on a package that has not arrived was put back on the queue, claimed, blocked again, and repeated — a busy loop burning a claim and a plan step each tick. It now only requeues a build whose every blocking name is actually in the index. The old pipeline test asserted the broken behaviour and has been rewritten to assert the correct one. - **The review page could not warn about missing dependencies, because nothing ever computed them.** candidates::set_missing_deps existed and was never called; missing deps were discovered at plan time, i.e. after a human had already approved. Detection now records them with the same rule the plan step uses, so the reviewer sees 'the build will block until these are published' before deciding, and the CLI and the page agree because both read the row. - **The dependents question was unanswered.** §10.3 asks 'approving this marks N packages stale'. The review page now says exactly that and names them, from the same derivation the Attention page uses. tests/staleness.rs (6 tests) also pins the claims that were easy to fake: staleness is derived on read — a schema scan asserts no column anywhere stores it, and withdrawing a dependency flips a dependent from Outdated to Missing without a single write to the dependent; a blocked build names its blocker on Attention and is not counted as a failure; a dependency we stopped publishing reads as missing rather than outdated. dep-partner added to the corpus so blocked builds are testable end to end. 149 tests pass, clippy clean. --- tests/pipeline.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests/pipeline.rs') diff --git a/tests/pipeline.rs b/tests/pipeline.rs index 1ad1dfd..5a2fa5a 100644 --- a/tests/pipeline.rs +++ b/tests/pipeline.rs @@ -307,18 +307,18 @@ fn an_unresolvable_dependency_blocks_instead_of_failing() { } #[test] -fn publishing_a_dependency_requeues_what_it_unblocks() { +fn a_blocked_build_waits_until_its_dependency_actually_arrives() { let (env, _fx) = env_with_fixture("missing-dep"); env.subscribe("dep-partner"); let c = approve_fixture(&env, "missing-dep"); assert!(matches!(run_for(&env, &c), pipeline::Outcome::Blocked { .. })); assert_eq!(builds::blocked_builds(&env.db).unwrap().len(), 1); - // Something lands in the index: blocked builds get another look (§10.4). - let n = publish::reconcile(&env.cfg, &env.db).unwrap_or(0); - let _ = n; - let requeued = builds::requeue_blocked(&env.db).unwrap(); - assert_eq!(requeued, 1); - assert_eq!(builds::blocked_builds(&env.db).unwrap().len(), 0); + // The dispatcher sweeps blocked builds every pass. Requeueing one whose + // blocker is still missing would block again immediately — a busy loop that + // burns a claim and a plan step each tick — so it must stay put. + let _ = publish::reconcile(&env.cfg, &env.db); + assert_eq!(builds::requeue_blocked(&env.db).unwrap(), 0, "requeued while still blocked"); + assert_eq!(builds::blocked_builds(&env.db).unwrap().len(), 1); } #[test] -- cgit v1.2.3