Skip to content

fix(build): WIGOLO_SKIP_PREPARE honours 0/false/off instead of skipping on them - #520

Merged
KnockOutEZ merged 2 commits into
studio-handoff-corefrom
sd-192-fix-build-wigolo-skip-prepare-is
Aug 29, 2026
Merged

fix(build): WIGOLO_SKIP_PREPARE honours 0/false/off instead of skipping on them#520
KnockOutEZ merged 2 commits into
studio-handoff-corefrom
sd-192-fix-build-wigolo-skip-prepare-is

Conversation

@KnockOutEZ

@KnockOutEZ KnockOutEZ commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Closes wigolo-studio-run#192.

scripts/prepare-build.mjs gated its opt-out on bare truthiness — if (process.env.WIGOLO_SKIP_PREPARE) — so WIGOLO_SKIP_PREPARE=0, =false and =off all meant skip, the inverse of what the operator wrote. The same phase established the opposite rule one file over: autoLaunchDisabled (src/studio/auto-launch.ts) trims, lowercases and compares against {'0','false','off'} for exactly this class. The two flags this program ships disagreed about what 0 means.

The fail direction is quiet rather than loud: a local npm ci under a leaked WIGOLO_SKIP_PREPARE=0 exits 0 with an unbuilt tree, and the absent dist/ surfaces much later as module-not-found in whatever consumes the package.

skipRequested() now trims, lowercases, and treats 0/false/off as off; any other non-empty value still skips, so =1 — the only spelling CI and the Dockerfile set — is unchanged and still prints the line those legs grep. A whitespace-only value falls back to the unset default and builds (recorded as A-192-1 with its reversal condition).

Demo — the off spellings driven through the hook, before and after

=== BEFORE — tip 11b58f3a (bare truthiness) ===================================
  VALUE        BUILT?   HOOK SAID
  "0"          skipped  prepare: no build — WIGOLO_SKIP_PREPARE is set; the caller builds explicitly.
  "false"      skipped  prepare: no build — WIGOLO_SKIP_PREPARE is set; the caller builds explicitly.
  "off"        skipped  prepare: no build — WIGOLO_SKIP_PREPARE is set; the caller builds explicitly.
  " 0 "        skipped  prepare: no build — WIGOLO_SKIP_PREPARE is set; the caller builds explicitly.
  "1"          skipped  prepare: no build — WIGOLO_SKIP_PREPARE is set; the caller builds explicitly.

=== AFTER — this branch (off-values normalized) ==============================
  VALUE        BUILT?   HOOK SAID
  "0"          BUILT     > probe@0.0.0 build > node fake-build.mjs
  "false"      BUILT     > probe@0.0.0 build > node fake-build.mjs
  "off"        BUILT     > probe@0.0.0 build > node fake-build.mjs
  " 0 "        BUILT     > probe@0.0.0 build > node fake-build.mjs
  "1"          skipped  prepare: no build — WIGOLO_SKIP_PREPARE is set; the caller builds explicitly.

Tests

Two arms extend tests/unit/prepare-build.test.ts rather than forking it. Red-then-green is a commit boundary: 81fc6022 (tests) is the direct parent of 4ad94c78 (fix), and against unfixed source the off-spelling arm reds with "0": expected false to be true.

Both arms are mutation-proved to have teeth: inverting the guard to SKIP_OFF_VALUES.has(value) reds 3 arms — the new off-spelling arm ("0": expected false to be true), the new on-spelling anti-vacuity twin ("1": expected true to be false) and the pre-existing skip arm — restored by reverse-edit and re-verified green.

CI deferred — quota.

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 170002ad-799e-4881-ae2e-7446125af07d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

WIGOLO_SKIP_PREPARE is gated on bare truthiness, so =0/=false/=off all mean
SKIP — the inverse of the operator's intent, and the opposite of the rule
autoLaunchDisabled establishes one file over for the same class. Two arms:
the off spellings must BUILD and must not print the skip line, and the
values CI actually sets must still skip and still print it.
…ng on them

The opt-out read any non-empty value as "skip", so a leaked
WIGOLO_SKIP_PREPARE=0 made a local npm ci exit 0 with an unbuilt tree and
surfaced weeks later as module-not-found. Normalize the way the phase's own
rule does: trim, lowercase, and treat 0/false/off as off. Every value CI sets
still skips, and still prints the line those legs grep.
@KnockOutEZ
KnockOutEZ force-pushed the sd-192-fix-build-wigolo-skip-prepare-is branch from 03211e9 to 4ad94c7 Compare August 29, 2026 00:14
@KnockOutEZ
KnockOutEZ merged commit d19c427 into studio-handoff-core Aug 29, 2026
20 checks passed
@KnockOutEZ
KnockOutEZ deleted the sd-192-fix-build-wigolo-skip-prepare-is branch August 29, 2026 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant