diff options
| author | aur-build <aur-build@localhost> | 2026-11-18 18:02:43 +0000 |
|---|---|---|
| committer | aur-build <aur-build@localhost> | 2026-11-18 18:02:43 +0000 |
| commit | c712124f214fc53a57b23c10ed98e8e869cbf7c2 (patch) | |
| tree | 0f117b9643ffeaba883913a5e4e64609dd26c5d2 /src/pipeline/mod.rs | |
| parent | 7587284ae48fb59c59da33af928322e8a621f4b0 (diff) | |
| download | aur-build-c712124f214fc53a57b23c10ed98e8e869cbf7c2.tar.gz aur-build-c712124f214fc53a57b23c10ed98e8e869cbf7c2.zip | |
watch, review, config: the clarity minors — no-ops, dead params, one error type
m-5. `mark_approved_but_unbuilt` was a function that did nothing, called from
the failure path with a comment explaining that it did nothing. The mechanism is
real — a failed build leaves the accepted pointer alone, and "approved, build
failed, index still serving the old version" is what the derived query reads
back — but a no-op in the failure path is a trap for whoever traces a build
failure at 3am. Deleted; the explanation moved to the call site that needs it.
m-6. The step loop extended the lease by a hardcoded 90 seconds while `Config`
carried `lease_secs`, so an operator who raised the lease got leases that were
silently reset to 90s after the first step.
m-8. Dead parameters and `let _ =` debris: `upstream::run` took a `Db` it never
used (and a `let _ = local;` after the value's only use), `risk::assess` took a
`Pkgbase` it never used, `accepted_pins` took a `Db`, `detect::schedule_next`
took a `Pkgbase` it discarded, `diff::version_delta` computed a `vercmp` and
threw the answer away, and two HTTP handlers took arguments they ignored. All
gone, with the callers following.
m-11. `schedule_next` re-queried the subscription for `poll_interval_secs` that
its caller had read moments earlier to decide whether the pkgbase was paused —
two queries, and two chances to get different answers. The interval is now an
argument, and the scheduler's own tick (which already holds the row) was already
doing it the right way.
m-15. `Config::load`/`save`/`ensure_dirs` returned `anyhow::Result` while the
rest of the crate returns `error::Error`, which put two vocabularies on either
side of one boundary and turned "there is no config yet, run init" — the one
thing a caller can branch on — into an opaque string. They return the crate's
error now; `main` keeps `anyhow` at the CLI edge, where it belongs.
m-19. `skip_declared` was hardcoded `true` for VCS entries, so the field that
means "the recipe gave us no checksum to trust" also meant "this is a git
source", and a new `-git` source was rendered to a reviewer as
`sha256sums=SKIP` — a warning about a recipe that had done nothing wrong. The
field now means one thing everywhere, `SourceDigest::is_vcs()` says which
integrity mechanism protects an entry, and the diff panel prints "pinned commit"
for those.
n-6. `recipe_at` was `pub` for no reason; it is `pub(crate)`.
Diffstat (limited to 'src/pipeline/mod.rs')
| -rw-r--r-- | src/pipeline/mod.rs | 22 |
1 files changed, 6 insertions, 16 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> { |
