diff options
Diffstat (limited to 'src/pipeline')
| -rw-r--r-- | src/pipeline/mod.rs | 22 | ||||
| -rw-r--r-- | src/pipeline/steps.rs | 2 |
2 files changed, 7 insertions, 17 deletions
diff --git a/src/pipeline/mod.rs b/src/pipeline/mod.rs index 9ddfc65..c3a2cb3 100644 --- a/src/pipeline/mod.rs +++ b/src/pipeline/mod.rs @@ -212,7 +212,7 @@ pub fn run_with(ctx: &Ctx) -> Result<Outcome> { match steps::run_step(ctx, step) { Ok(StepResult::Done(digest)) => { builds::finish_step(&ctx.db, &ctx.build.id, step, StepState::Succeeded, digest.as_deref(), None)?; - builds::extend_lease(&ctx.db, &ctx.build.id, 90)?; + builds::extend_lease(&ctx.db, &ctx.build.id, ctx.cfg.lease_secs)?; } Ok(StepResult::Skipped(why)) => { ctx.log_line(&format!(" skipped: {why}")); @@ -234,13 +234,11 @@ pub fn run_with(ctx: &Ctx) -> Result<Outcome> { Some(&format!("{step}: {e}")), )?; ctx.log_line(&format!("!! {step} failed: {e}")); - // A failed build must not leave the old version looking healthy: - // the release stays approved_but_unbuilt and the UI says so. - if let Some(cid) = ctx.build.candidate_id { - if ctx.build.release_id.is_none() { - mark_approved_but_unbuilt(&ctx.db, cid)?; - } - } + // A failed build must not leave the old version looking healthy. + // Nothing has to *do* that: the accepted pointer was never moved, + // so "approved, build failed, index still serving the old + // version" is what the derived query reads back (§8.4). There is + // deliberately no state to set here — see `approved_but_unbuilt`. return Ok(Outcome::Failed { step: step.to_string(), error: e.to_string(), transient }); } } @@ -265,14 +263,6 @@ impl Ctx { } } -/// A failed build must not make the old version look healthy (§8.4). The -/// candidate stays `approved`; what the UI renders is the *absence* of a -/// published release behind it: "v2 approved, build failed, index still -/// serving v1". Nothing here mutates the accepted pointer. -fn mark_approved_but_unbuilt(_db: &Db, _candidate_id: i64) -> Result<()> { - Ok(()) -} - /// Enqueue the build an approval implies. Deterministic id, so calling this /// twice is a no-op (§8.2). pub fn enqueue_for_candidate(cfg: &Config, db: &Db, c: &CandidateRow) -> Result<String> { diff --git a/src/pipeline/steps.rs b/src/pipeline/steps.rs index 033093b..7187e13 100644 --- a/src/pipeline/steps.rs +++ b/src/pipeline/steps.rs @@ -438,7 +438,7 @@ fn publish(ctx: &Ctx) -> Result<StepResult> { use std::path::PathBuf; /// Read the recipe from a materialized tree, preferring `.SRCINFO`. -pub fn recipe_at(dir: &Path) -> Result<Recipe> { +pub(crate) fn recipe_at(dir: &Path) -> Result<Recipe> { let mut files = std::collections::BTreeMap::new(); for entry in walkdir::WalkDir::new(dir).max_depth(2).into_iter().filter_map(|e| e.ok()) { let p = entry.path(); |
