The site is currently serving a frontend that asks for `window=3600` from an API that only knows `six_hours`, and every step behaved as designed: run 51ef367d5rust + web BUILD FAILED — nothing deployed run 522594190web only web deployed, deploy-api skipped run 5349f50bddocs only nothing deployed Run 52 diffed against `github.event.before`, which is run 51's commit — a commit whose Rust half never shipped. It correctly saw only `web/src/lib/routes.ts` and correctly skipped the API. The frontend went out alone. The gate was asking the wrong question. "What changed since the previous push" is only the same as "what changed since what is deployed" while every push deploys, and a failed run breaks that quietly — the workflow's own comment warns about "a binary on bob that does not match this commit, which nothing would report", and this is that case arriving by a route the path list cannot see. So ask the API. `/v1/healthz` now carries the commit it was built from, stamped via `GIT_SHA` at build time, and the gate diffs from there. `build.rs` exists only to make cargo notice the value changed, since `option_env!` is read at compile time and a warm cache would otherwise keep a stale stamp. Best effort throughout: an unreachable API, a binary too old to carry a stamp, or a commit this clone does not have all fall back to `github.event.before`, which is exactly today's behaviour. The gate only ever widens — a false positive costs a slow deploy, and that trade is already written down beside it. This commit touches `.gitea/` and `crates/`, so it deploys the API and unbreaks the site as it lands. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jp6a8EDar9ueEhAxzep4V5
10 lines
409 B
Rust
10 lines
409 B
Rust
//! Stamp the commit into the binary, so the deploy gate can ask what is running.
|
|
//!
|
|
//! `option_env!("GIT_SHA")` is read at compile time, and cargo has no way to
|
|
//! know that value changed unless it is told — without this, a rebuild in a
|
|
//! warm cache would keep the previous commit's stamp and the gate would trust
|
|
//! a stale answer.
|
|
fn main() {
|
|
println!("cargo::rerun-if-env-changed=GIT_SHA");
|
|
}
|