Skip to content

fix(cli): build Node UI bundle during blue-green update#354

Open
Jurij89 wants to merge 1 commit intomainfrom
codex/fix-blue-green-ui-build-347
Open

fix(cli): build Node UI bundle during blue-green update#354
Jurij89 wants to merge 1 commit intomainfrom
codex/fix-blue-green-ui-build-347

Conversation

@Jurij89
Copy link
Copy Markdown
Contributor

@Jurij89 Jurij89 commented Apr 30, 2026

Summary

  • Builds the Node UI Vite static bundle in git blue-green target slots before update activation, resolving the Node UI workspace name from the target ref with current and legacy package-name fallbacks.
  • Requires the correct Node UI dist-ui/index.html artifact before update/rollback activation can swap: git-layout slots require freshly rebuilt packages/node-ui/dist-ui/index.html, while npm-layout slots require the UI package candidate declared by installed CLI metadata when readable.
  • Keeps rollback activation safe and available for git slots by lazily building missing UI assets before stopping the daemon or swapping; existing npm slots are check-only and fail readiness if their packaged UI bundle is missing.
  • Keeps startup live-slot UI repair best-effort with clear fallback-page logging, and keeps dkg update from mutating the currently served slot during migration preflight.

Related

Fixes #347

Files changed

File What
packages/cli/src/daemon/auto-update.ts Adds target-slot Node UI build command resolution, clears stale git dist-ui, strict git UI artifact gating, and npm-layout UI gating before pending state/swap.
packages/cli/src/migration.ts Builds/repairs git Node UI assets during slot bootstrap with layout-specific readiness, caller-specific live-slot repair behavior, and no-current repair ordering.
packages/cli/src/cli.ts Routes rollback through the shared Node UI readiness helper before stopping the daemon or swapping slots.
packages/cli/src/node-ui-static.ts Centralizes Node UI package names, build commands, git artifact paths, npm artifact candidates, slot layout detection, and installed-package metadata resolution.
packages/cli/src/rollback-node-ui.ts Encapsulates rollback UI readiness: git slots can repair with build:ui; npm slots are packaged-assets check-only.
packages/cli/test/auto-update.test.ts Covers UI build ordering, stale dist-ui cleanup, legacy package-name refs, missing git/npm UI artifacts, mixed npm package artifacts, and UI build failure before swap.
packages/cli/test/migration.test.ts Covers migration UI build/repair behavior, npm-layout check-only failure, legacy package-name refs, best-effort live repair, and no-current fail-closed/recovery behavior.
packages/cli/test/node-ui-static.test.ts Covers git, npm, nested npm, and package-scoped Node UI artifact candidates.
packages/cli/test/rollback-node-ui.test.ts Covers git rollback repair, git UI build failure, npm packaged UI success, and npm missing-UI fail-closed behavior.
RELEASE_PROCESS.md Documents UI-inclusive blue-green release-slot requirements.
docs/testing/AUTO_UPDATE_LOCAL_TESTING.md Updates local auto-update testing expectations for Node UI static assets.

Test plan

  • pnpm install --frozen-lockfile completed successfully.
  • pnpm build:runtime passes after the latest changes.
  • pnpm --filter @origintrail-official/dkg-node-ui run build:ui passes and packages/node-ui/dist-ui/index.html exists.
  • pnpm --dir packages/cli exec vitest run --config ..\..\vitest.evm-integration.ts test\auto-update.test.ts -t "npm Node UI static bundle|legacy npm UI bundle|Node UI workspace package name|Node UI static build after|git Node UI static bundle is missing|Node UI static build fails" passes 6 focused auto-update tests.
  • pnpm --dir packages/cli exec vitest run --config ..\..\vitest.evm-integration.ts test\migration.test.ts -t "npm-layout slots" passes 2 focused migration npm-layout tests.
  • pnpm --dir packages/cli exec vitest run --config ..\..\vitest.evm-integration.ts test\node-ui-static.test.ts passes 3 helper tests.
  • pnpm --dir packages/cli exec vitest run --config ..\..\vitest.evm-integration.ts test\rollback-node-ui.test.ts passes 4 rollback readiness tests.
  • git diff --check -- packages/cli/src/daemon/auto-update.ts packages/cli/src/node-ui-static.ts packages/cli/src/migration.ts packages/cli/src/cli.ts packages/cli/src/rollback-node-ui.ts packages/cli/test/auto-update.test.ts packages/cli/test/migration.test.ts packages/cli/test/node-ui-static.test.ts packages/cli/test/rollback-node-ui.test.ts passes.
  • Full local migration/blue-green integration suites are blocked on this Windows machine by existing symlink EPERM limitations; broader symlink-based focused migration tests hit the same local setup issue after reaching or creating releases/current.

Comment thread packages/cli/src/migration.ts Outdated
@Jurij89 Jurij89 force-pushed the codex/fix-blue-green-ui-build-347 branch from 60c60f2 to b077625 Compare April 30, 2026 17:43
Comment thread packages/cli/src/daemon/auto-update.ts Outdated
Comment thread packages/cli/src/migration.ts Outdated
@Jurij89 Jurij89 force-pushed the codex/fix-blue-green-ui-build-347 branch from b077625 to 6a65ff1 Compare April 30, 2026 17:57
Comment thread packages/cli/src/migration.ts Outdated
Comment thread packages/cli/src/migration.ts Outdated
@Jurij89 Jurij89 force-pushed the codex/fix-blue-green-ui-build-347 branch from 6a65ff1 to a4ed4c3 Compare April 30, 2026 18:13
Comment thread packages/cli/src/node-ui-static.ts Outdated
Comment thread packages/cli/src/cli.ts
Comment thread packages/cli/src/daemon/auto-update.ts
@Jurij89 Jurij89 force-pushed the codex/fix-blue-green-ui-build-347 branch from a4ed4c3 to 0ff5c44 Compare April 30, 2026 18:42
Comment thread packages/cli/src/cli.ts Outdated
@Jurij89 Jurij89 force-pushed the codex/fix-blue-green-ui-build-347 branch from 0ff5c44 to 687882d Compare April 30, 2026 18:56
Comment thread packages/cli/src/migration.ts Outdated
Comment thread packages/cli/src/cli.ts Outdated
@Jurij89 Jurij89 force-pushed the codex/fix-blue-green-ui-build-347 branch from 687882d to fb750f9 Compare April 30, 2026 19:12
Comment thread packages/cli/src/migration.ts Outdated
@Jurij89 Jurij89 force-pushed the codex/fix-blue-green-ui-build-347 branch from fb750f9 to a693a71 Compare April 30, 2026 19:42
Comment thread packages/cli/src/node-ui-static.ts Outdated
Comment thread packages/cli/src/daemon/auto-update.ts
@Jurij89 Jurij89 force-pushed the codex/fix-blue-green-ui-build-347 branch from a693a71 to 51b12d5 Compare April 30, 2026 19:58
Comment thread packages/cli/src/cli.ts
Comment thread packages/cli/src/cli.ts Outdated
@Jurij89 Jurij89 force-pushed the codex/fix-blue-green-ui-build-347 branch from 51b12d5 to c7b1cd8 Compare April 30, 2026 20:14
Comment thread packages/cli/src/cli.ts
@Jurij89 Jurij89 force-pushed the codex/fix-blue-green-ui-build-347 branch from c7b1cd8 to 293980a Compare April 30, 2026 20:25
Comment thread packages/cli/src/cli.ts
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.

fix(cli): blue-green update does not build Node UI static bundle

1 participant