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/db/migrations.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/db/migrations.rs') diff --git a/src/db/migrations.rs b/src/db/migrations.rs index e0c1cb3..dddb301 100644 --- a/src/db/migrations.rs +++ b/src/db/migrations.rs @@ -274,11 +274,20 @@ BEGIN END; "#; +/// `artifact.build_id` lets the publish step find what `ingest` recorded without +/// re-scanning the disposable staging directory, so a worker that dies between +/// ingest and publish resumes cleanly (I5). +const M_0005_ARTIFACT_BUILD: &str = r#" +ALTER TABLE artifact ADD COLUMN build_id TEXT; +CREATE INDEX artifact_by_build ON artifact (build_id); +"#; + pub static MIGRATIONS: &[Migration] = &[ Migration { version: 1, name: "core", sql: M_0001_CORE }, Migration { version: 2, name: "build", sql: M_0002_BUILD }, Migration { version: 3, name: "notices", sql: M_0003_NOTICES }, Migration { version: 4, name: "audit-triggers", sql: M_0004_TRIGGERS }, + Migration { version: 5, name: "artifact-build", sql: M_0005_ARTIFACT_BUILD }, ]; /// Default settings seeded into `settings` (DESIGN.md ยง11). -- cgit v1.2.3