fix(ci): declare FORCE_REBUILD as a UI variable and make it take effect #12

Merged
pat-s merged 1 commit from fix/force-rebuild-effective into main 2026-09-18 07:18:09 +00:00
Owner

Motivation

Two asks: make FORCE_REBUILD selectable in the UI, and remove the Net debug step.

While wiring up the UI variable I found that #11 was necessary but not sufficient. Two further bugs stood between FORCE_REBUILD and an actual republish, and each would have silently wasted the multi-hour rebuild.

Declare it as a UI variable

The schema, read out of the crow binary (crow lint accepts unknown nested fields without complaint, so it is not authoritative here):

variables:
  <NAME>: { description, options[], default, required }

options is what gives the UI a dropdown. Declared with options: ["false", "true"] and default: "false".

Two bugs this exposed

1. A declared variable substitutes its default, which inverts the emptiness test.

default is a string. With a declared default, ${FORCE_REBUILD} expands to the literal false — which is non-empty. The [ -n "$FORCE_REBUILD_VAR" ] check merged in #11 would therefore have been true on every cron run, rebuilding every platform nightly. Now matches on the value, accepting true/1/yes and treating anything else as off.

2. overwrite: false on the upload would have discarded the entire rebuild.

From the plugin-s3 source:

if !p.Overwrite {
    // Object exists, write log message
    log.WithFields(...).Info("File already exists, skipping upload due to overwrite=false")
}

It skips the object and still exits green. A FORCE_REBUILD run would have recompiled all 24 Alpine packages over several hours and published none of them, with a passing pipeline and no error to notice.

Set to true. Normal runs are unaffected: dedup means only not-yet-published versions are ever built, so no overwrite occurs.

Cleanup

Removed the Net debug step, the commented-out Pull upstream step, and a stray # docker info.

Deliberately kept:

  • the ip link set ... mtu 1280 lines — the actual workaround the debug step was diagnosing, not debug scaffolding
  • the commented-out alpine-320 matrix entry — records a deliberately disabled platform
  • the B2 auth / crow-substitution comment in the dedup step, and the "pin specific versions for testing" hint

Verification

crow lint .crow/ passes. Truthiness across every input form:

cron, declared default substituted ("false")   -> dedup
UI dropdown set to true                        -> REBUILD ALL
no substitution at all (blank)                 -> dedup
pipeline start -p FORCE_REBUILD=true           -> REBUILD ALL
pipeline start -p FORCE_REBUILD=1              -> REBUILD ALL
pipeline start -p FORCE_REBUILD=false          -> dedup
garbage value                                  -> dedup

The first row is the one that matters most: it is the case #11 would have got wrong.

## Motivation Two asks: make `FORCE_REBUILD` selectable in the UI, and remove the `Net debug` step. While wiring up the UI variable I found that #11 was necessary but **not sufficient**. Two further bugs stood between `FORCE_REBUILD` and an actual republish, and each would have silently wasted the multi-hour rebuild. ## Declare it as a UI variable The schema, read out of the crow binary (`crow lint` accepts unknown nested fields without complaint, so it is not authoritative here): ``` variables: <NAME>: { description, options[], default, required } ``` `options` is what gives the UI a dropdown. Declared with `options: ["false", "true"]` and `default: "false"`. ## Two bugs this exposed **1. A declared variable substitutes its default, which inverts the emptiness test.** `default` is a **string**. With a declared default, `${FORCE_REBUILD}` expands to the literal `false` — which is non-empty. The `[ -n "$FORCE_REBUILD_VAR" ]` check merged in #11 would therefore have been true on **every cron run**, rebuilding every platform nightly. Now matches on the value, accepting `true`/`1`/`yes` and treating anything else as off. **2. `overwrite: false` on the upload would have discarded the entire rebuild.** From the plugin-s3 source: ```go if !p.Overwrite { // Object exists, write log message log.WithFields(...).Info("File already exists, skipping upload due to overwrite=false") } ``` It skips the object and still exits **green**. A `FORCE_REBUILD` run would have recompiled all 24 Alpine packages over several hours and published none of them, with a passing pipeline and no error to notice. Set to `true`. Normal runs are unaffected: dedup means only not-yet-published versions are ever built, so no overwrite occurs. ## Cleanup Removed the `Net debug` step, the commented-out `Pull upstream` step, and a stray `# docker info`. Deliberately kept: - the `ip link set ... mtu 1280` lines — the actual workaround the debug step was diagnosing, not debug scaffolding - the commented-out `alpine-320` matrix entry — records a deliberately disabled platform - the B2 auth / crow-substitution comment in the dedup step, and the "pin specific versions for testing" hint ## Verification `crow lint .crow/` passes. Truthiness across every input form: ``` cron, declared default substituted ("false") -> dedup UI dropdown set to true -> REBUILD ALL no substitution at all (blank) -> dedup pipeline start -p FORCE_REBUILD=true -> REBUILD ALL pipeline start -p FORCE_REBUILD=1 -> REBUILD ALL pipeline start -p FORCE_REBUILD=false -> dedup garbage value -> dedup ``` The first row is the one that matters most: it is the case #11 would have got wrong.
Follow-up to #11, which landed the trigger-form handling but not the rest.
Three things still stood between FORCE_REBUILD and an actual republish.

Declare FORCE_REBUILD as a top-level variable so the UI offers it as a
dropdown on a manual run, rather than requiring a hand-typed key.

Test the value rather than emptiness. A declared variable substitutes its
default, so the `[ -n ... ]` check from #11 would have seen the literal
string "false" and rebuilt every platform on every cron run.

Set overwrite: true on the upload. plugin-s3 skips an object that already
exists when overwrite is false, logging "File already exists, skipping
upload" and still exiting green, so a forced rebuild would have recompiled
every package and published none of them. Normal runs are unaffected, since
dedup means only not-yet-published versions are ever built.

Also drop the Net debug step, the commented-out Pull upstream step and a
stray `# docker info`. The MTU workaround the debug step was diagnosing
stays, as does the commented-out alpine-320 matrix entry, which records a
deliberately disabled platform rather than dead scaffolding.
pat-s merged commit 8c2e392587 into main 2026-09-18 07:18:09 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
devxy/r-builds!12
No description provided.