Restores the CLI-side consumer of MOSAIC_GATEWAY_SKIP_NPM_INSTALL: the wizard's gateway stage now skips installGatewayPackage() (npm install -g @mosaicstack/gateway@latest) when the env is 1, plus two spec cases that pin the behavior.
Why
tools/install.sh --dev (on next) builds CLI and gateway from source at --ref and exports MOSAIC_GATEWAY_SKIP_NPM_INSTALL=1 — but the consumer was lost when #676 closed as superseded (#689 took the gateway-side Redis fix; the CLI-side env gate fell through the crack). Result today: every --dev run silently overwrites the source-built gateway with the published @latest, so a dev-test validates the wrong artifact. This unblocks the planned greenfield VM dev-test of the next lane.
Producer already on next (install.sh lines 124/493/673); this adds the missing consumer.
Verification
vitest: 12/12 pass (2 new cases; the env-gate case fails on revert — true behavioral pin)
## What
Restores the CLI-side consumer of `MOSAIC_GATEWAY_SKIP_NPM_INSTALL`: the wizard's gateway stage now skips `installGatewayPackage()` (`npm install -g @mosaicstack/gateway@latest`) when the env is `1`, plus two spec cases that pin the behavior.
## Why
`tools/install.sh --dev` (on `next`) builds CLI **and** gateway from source at `--ref` and exports `MOSAIC_GATEWAY_SKIP_NPM_INSTALL=1` — but the consumer was lost when #676 closed as superseded (#689 took the gateway-side Redis fix; the CLI-side env gate fell through the crack). Result today: every `--dev` run silently overwrites the source-built gateway with the published `@latest`, so a dev-test validates the wrong artifact. This unblocks the planned greenfield VM dev-test of the `next` lane.
Producer already on `next` (`install.sh` lines 124/493/673); this adds the missing consumer.
## Verification
- vitest: 12/12 pass (2 new cases; the env-gate case fails on revert — true behavioral pin)
- `tsc --noEmit` clean, eslint pass, prettier clean
- Non-dev installs: env unset ⇒ `undefined === '1'` is false ⇒ byte-identical behavior
- Independent review (author≠reviewer): **PASS** — gate logic, daemonRunning interaction, env conventions (`=== '1'` matches `MOSAIC_ASSUME_YES` et al.), test pinning all verified
## Companion
Enables: `install.sh --dev --ref <branch>` end-to-end gateway testing on the 0.0.49/`next` lane.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Lets dev/offline installs keep an already-present global @mosaicstack/gateway
(e.g. a build-from-source `install.sh --dev`) instead of overwriting it with
the registry @latest build during `mosaic wizard` / `mosaic gateway install`.
Refs #675
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RMoEx7hfdFGjUiCHuN1RRi
Two cases: fresh install without skipInstall calls installGatewayPackage
exactly once (baseline), and MOSAIC_GATEWAY_SKIP_NPM_INSTALL=1 suppresses
the registry install so a build-from-source gateway (install.sh --dev) is
not overwritten by @latest.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RMoEx7hfdFGjUiCHuN1RRi
VERIFIED APPROVE — reviewer-of-record [W-jarvis:reviewer] head 4b0137325b
Reviewed PR #698 against base next at exact head 4b0137325be6357c65b168ce9b97c9fc98b4e0ef.
Evidence:
Scope verified: diff is confined to packages/mosaic/src/stages/gateway-config.ts and packages/mosaic/src/stages/gateway-config.spec.ts; git diff --check origin/next...origin/pr/698 clean.
Claim verified: tools/install.sh on next already exports MOSAIC_GATEWAY_SKIP_NPM_INSTALL=1 for dev/source and next fallback paths, but origin/next had no gateway-config consumer. This PR restores the missing consumer in gatewayConfigStage.
Behavior verified: when env var is unset, skipNpmInstall is equivalent to existing opts.skipInstall; fresh install still calls installGatewayPackage() when skipInstall: false and daemon is not running. When MOSAIC_GATEWAY_SKIP_NPM_INSTALL=1, the stage skips the registry install and does not overwrite a source-built/global gateway.
Tests verified: new specs pin both default install behavior and env-gated skip behavior; env cleanup added in beforeEach. Local targeted run passed: pnpm --filter @mosaicstack/mosaic test -- src/stages/gateway-config.spec.ts (9/9).
CI verified: Woodpecker #1661 pull_request and #1660 push are overall success on this head.
No merge performed by reviewer.
VERIFIED APPROVE — reviewer-of-record [W-jarvis:reviewer] head 4b0137325be6357c65b168ce9b97c9fc98b4e0ef
Reviewed PR #698 against base `next` at exact head `4b0137325be6357c65b168ce9b97c9fc98b4e0ef`.
Evidence:
- Scope verified: diff is confined to `packages/mosaic/src/stages/gateway-config.ts` and `packages/mosaic/src/stages/gateway-config.spec.ts`; `git diff --check origin/next...origin/pr/698` clean.
- Claim verified: `tools/install.sh` on `next` already exports `MOSAIC_GATEWAY_SKIP_NPM_INSTALL=1` for dev/source and next fallback paths, but `origin/next` had no gateway-config consumer. This PR restores the missing consumer in `gatewayConfigStage`.
- Behavior verified: when env var is unset, `skipNpmInstall` is equivalent to existing `opts.skipInstall`; fresh install still calls `installGatewayPackage()` when `skipInstall: false` and daemon is not running. When `MOSAIC_GATEWAY_SKIP_NPM_INSTALL=1`, the stage skips the registry install and does not overwrite a source-built/global gateway.
- Tests verified: new specs pin both default install behavior and env-gated skip behavior; env cleanup added in `beforeEach`. Local targeted run passed: `pnpm --filter @mosaicstack/mosaic test -- src/stages/gateway-config.spec.ts` (`9/9`).
- CI verified: Woodpecker #1661 pull_request and #1660 push are overall success on this head.
No merge performed by reviewer.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What
Restores the CLI-side consumer of
MOSAIC_GATEWAY_SKIP_NPM_INSTALL: the wizard's gateway stage now skipsinstallGatewayPackage()(npm install -g @mosaicstack/gateway@latest) when the env is1, plus two spec cases that pin the behavior.Why
tools/install.sh --dev(onnext) builds CLI and gateway from source at--refand exportsMOSAIC_GATEWAY_SKIP_NPM_INSTALL=1— but the consumer was lost when #676 closed as superseded (#689 took the gateway-side Redis fix; the CLI-side env gate fell through the crack). Result today: every--devrun silently overwrites the source-built gateway with the published@latest, so a dev-test validates the wrong artifact. This unblocks the planned greenfield VM dev-test of thenextlane.Producer already on
next(install.shlines 124/493/673); this adds the missing consumer.Verification
tsc --noEmitclean, eslint pass, prettier cleanundefined === '1'is false ⇒ byte-identical behavior=== '1'matchesMOSAIC_ASSUME_YESet al.), test pinning all verifiedCompanion
Enables:
install.sh --dev --ref <branch>end-to-end gateway testing on the 0.0.49/nextlane.🤖 Generated with Claude Code
VERIFIED APPROVE — reviewer-of-record [W-jarvis:reviewer] head
4b0137325bReviewed PR #698 against base
nextat exact head4b0137325be6357c65b168ce9b97c9fc98b4e0ef.Evidence:
packages/mosaic/src/stages/gateway-config.tsandpackages/mosaic/src/stages/gateway-config.spec.ts;git diff --check origin/next...origin/pr/698clean.tools/install.shonnextalready exportsMOSAIC_GATEWAY_SKIP_NPM_INSTALL=1for dev/source and next fallback paths, butorigin/nexthad no gateway-config consumer. This PR restores the missing consumer ingatewayConfigStage.skipNpmInstallis equivalent to existingopts.skipInstall; fresh install still callsinstallGatewayPackage()whenskipInstall: falseand daemon is not running. WhenMOSAIC_GATEWAY_SKIP_NPM_INSTALL=1, the stage skips the registry install and does not overwrite a source-built/global gateway.beforeEach. Local targeted run passed:pnpm --filter @mosaicstack/mosaic test -- src/stages/gateway-config.spec.ts(9/9).No merge performed by reviewer.