fix(build): skip a bake whose head is already contained in main #2043
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/build-skip-if-built"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Cutting a branch through the API/UI pushes the BRANCH POINT, so the sensor started a second 25-minute kernel bake of an already-released commit — and because the operator projects builds onto the PipelineBuild keyed by sha, the RELEASED build record (linux-build-22875a8f484a) was re-opened to Running with no workflow.
Guard tests git containment (main is release-only, so a contained head is built+released+immutable) rather than the build record, which the operator re-opens the instant the workflow starts. Fail-closed; force=true overrides.
submit-lint caught that {{workflow.parameters.force}} would be rejected at submit on the release path (it would have broken every kernel release); param-injection caught pasting params into a token-mounting script body. Both fixed. 130/130 guards green, new contract test has a negative control.
Creating a branch through the Forgejo API or web UI emits a push whose `after` is the BRANCH POINT, not new work. The CI sensor cannot tell that apart from a real commit, so cutting fix/input-evdev off main today started a second 25-minute kernel bake of 22875a8f -- a commit already built and released as v6.18.44-seanfarm31. The waste was the smaller half. The operator projects a build workflow onto the PipelineBuild keyed by its sha, so the rebuild RE-OPENED the released build's record: linux-build-22875a8f484a went to Running with an empty workflow name. Had it failed, the record behind a shipped release would read Failed. The guard tests git containment, not the build record. main is release-only fleet-wide, so a head contained in main is built, released and immutable. The record cannot answer this question: the operator re-opens it the instant the workflow starts, so every step sees Running and never Succeeded. Fail-closed throughout -- an API error, an unparseable answer or an unresolved sha builds. force=true overrides for a deliberate cache bust. Two guards shaped this and are worth recording: - submit-lint refused {{workflow.parameters.force}}: the release path submits these templates in a workflow that declares no such parameter, and an unresolvable reference is rejected AT SUBMIT. It would have broken every kernel release. force is now an input with a default at both levels. - param-injection refused pasting parameters into a script body that mounts the Forgejo token; they travel in env: instead, which kubelet sets verbatim. The matrix outputs gained defaults so a skipped bake leaves them resolvable.