From 4ac1d19ca5dc540db0478943a0cd70a5353307da Mon Sep 17 00:00:00 2001 From: aur-build Date: Tue, 17 Nov 2026 21:57:58 +0000 Subject: pipeline: ten-step build machine with atomic signed publish materialize -> plan -> chroot -> sources -> pkgver -> build -> collect -> verify -> ingest -> publish, each checkpointed in build_step so a worker that dies resumes at the next incomplete step without repeating the expensive one (I5). Step 0 materializes from the local mirror only and re-hashes the tree: there is no path from 'AUR moved since the review' to 'we built it anyway' (I3). Step 4 re-resolves a VCS pkgver and refuses when it no longer matches the approved identity. Publish renders the index to .tmp, fsyncs, commits release + package rows and the accepted pointer under a compare-and-swap, then renames over the served database and signs it, so a crash leaves the old index byte-for-byte intact (I4) and every index entry traces back to an approval (I1). Ingest records the world snapshot as the BUILDINFO installed set intersected with our own packages, which is what keeps staleness meaningful (I12). 17 shim-driven end-to-end tests, including kill-mid-publish and crash-resume, with no root, network, or real chroot. --- src/review/diff.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/review/diff.rs') diff --git a/src/review/diff.rs b/src/review/diff.rs index cfce3fe..df6318c 100644 --- a/src/review/diff.rs +++ b/src/review/diff.rs @@ -154,3 +154,27 @@ pub fn full_recipe_text(db: &Db, c: &CandidateRow) -> Result { let r: Recipe = serde_json::from_str(&snap.srcinfo_json).unwrap_or_default(); Ok(r.pkgbuild) } + +/// Render the panels, store the resulting `diff_digest` on the candidate, and +/// hand it back. The approve POST must echo this value, which is what makes +/// "we build exactly what was displayed" checkable (ยง7.1a). +pub fn render_and_store(db: &Db, cfg: &Config, c: &CandidateRow) -> Result { + let base = match c.base_release_id { + Some(id) => db::release_by_id(db, id)?, + None => None, + }; + let ps = panels(cfg, db, c, base.as_ref())?; + let digest = diff_digest(&ps); + crate::review::candidates::set_diff_digest(db, c.id, &digest)?; + Ok(digest) +} + +/// Re-render for a 409 response: show the reviewer what the candidate is now. +pub fn render_current(db: &Db, cfg: &Config, c: &CandidateRow) -> Result<(String, String)> { + let base = match c.base_release_id { + Some(id) => db::release_by_id(db, id)?, + None => None, + }; + let ps = panels(cfg, db, c, base.as_ref())?; + Ok((render_text(&ps), diff_digest(&ps))) +} -- cgit v1.2.3