Repository navigation
ci(desktop): boot the packaged cloud and enterprise flavors on a fresh profile - #4696
Conversation
…reen Since #4482 mounted DesktopUpdaterProvider at the outermost AppRoot layer, its useUpdater() hook reads the Local and DesktopConfig contexts during render. The pre-activation branch of EnterpriseAwareAppProviders (#3185) mounts neither, so an enterprise build crashed with "Local context is missing" (then "useDesktopConfig must be used within a DesktopConfigProvider") before the activation gate could render — a blank window on first launch of an unactivated install, with no ErrorBoundary to recover. Mount DesktopConfigProvider and LocalProvider in the pre-activation branch so AppRoot-level consumers keep working; ConnectLinkProvider stays outermost so the branded connect-link consumer keeps its place. Tested with a behaviour test that renders the real DesktopUpdaterProvider inside the pre-activation branch (TDD: watched it fail with both crash messages before the fix), and updated the providers source-shape assertion in tests/enterprise-activation.test.ts to the new contract. Full apps/app suite: no new failures against the pre-change baseline.
…h profile The cloud and enterprise artifacts render a gate above the routes on first launch. That path never ran in CI: packaged-smoke booted only the public flavor, and the enterprise gate was checked by source-string assertions. 0.18.43 and 0.18.44 shipped with the enterprise gate throwing "Local context is missing" during render, so every fresh self-hosted install opened to a blank window. packaged-smoke now packages electron-builder.enterprise.yml and electron-builder.cloud.yml and boots each on a fresh profile through the new packaged-first-launch journey. The world attaches without the signed-in readiness gate and records Runtime.exceptionThrown from a second CDP session so boot-time render crashes fail the run by name. Against the shipped 0.18.44 enterprise build this spec fails in seconds naming the crash; against 0.18.42 and against dev with #4606 it passes.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Warden review summary — ClearNative findings: 0. Blocking policy matches before consolidation: 0. Full finding text remains in Warden's native checks and review threads. This comment retains only native IDs, severity, skill attribution, and safe locations. Analysis run Reported trigger coverage (not proof of complete repository or context coverage): diff-security-review (25692 ms), confidentiality-review (44540 ms), spec-provenance-review (68923 ms), desktop-den-sync-review (51119 ms). Blockers
Advisories
Needs recheck
Observed review-thread metrics
Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority. |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (647e71866cd1f3fdd13efc0b926858bc70b2b33f). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
|
Passed · 3/3 tests · 4/4 assertions · 2 images Commit |
…catches the crash (#4699) #4697 mounted a root error boundary, so a first-launch render crash now renders "OpenWork hit an unexpected error" instead of unmounting the tree. React reports caught errors through console.error, not Runtime.exceptionThrown, so packaged-first-launch no longer stopped on the crash: it waited the full 60 s for the gate heading and failed with a timeout whose message buried the cause in the last-value dump. Treat the recovery heading as a terminal state, assert it is absent by name, and check for it instead of the stale "Something went wrong" text. Local lane, macOS arm64, electron-builder.enterprise.yml --mac --dir: - dev: passed (11.2 s) - dev with providers.tsx reverted to pre-#4696: failed in 8.0 s, "the root error boundary caught a first-launch render crash ... Local context is missing" (before this change: failed after 65.8 s with "Timed out waiting for enterprise first-launch gate")
* fix(desktop): keep the updater inert until enterprise activation Since #4482 the updater provider mounts above the enterprise activation gate, and #4606/#4696 made the contexts it needs available there. A fresh enterprise install therefore checked the enterprise release feed and started staging the newest release within ~2 s of first launch, before any Den (and so any allowed-versions policy) was known. Renderer: automatic and menu-requested checks wait until activation is complete and the desktop config has resolved once, so the first check already honours allowedDesktopVersions. Main process: openwork:updater:check/download/ installAndRestart reject through assertDesktopActivation while activation is required, so no renderer path can reach electron-updater early. Proof: unit test for the IPC guard, and the packaged-preactivation-updater journey (red on the unfixed enterprise build, green after) wired into the packaged smoke gate. * test(evals): count electron-updater's AppImage refusal as a check attempt On the unpacked Linux directory the packaged smoke gate boots, electron-updater answers checkForUpdates() with "APPIMAGE env is not defined" instead of "Checking for update", so the positive control never saw the attempt in CI.
EnterpriseAwareAppProviders forked into two trees: a reduced pre-activation tree and the full tree after activation. AppRoot-level consumers could not see which branch they rendered under, which is how #4606/#4696's "Local context is missing" blank window shipped in 0.18.43-0.18.44. Mount the full tree unconditionally. DesktopRuntimeBoot, BrowserLoginSyncAccessBridge, AutomationRunnerBridge and GlobalQueueDrainerBridge now gate themselves on useEnterpriseActivationRequired(): they render nothing and run no effects until Den activation completes, so no privileged runtime work starts early and the providers above the children never remount when activation lands. DesktopUpdaterProvider keeps its updatePolicyKnown guard. Move providers.test.tsx under apps/app/tests so the app test script actually runs it, and extend it: pre-activation render still supplies the updater contexts, none of the gated bridges runs before activation (no boot or Automation-runner IPC, no queue drainer, no browser-login observation), all of them run after activation in the same mounted tree, and the providers above the children mount exactly once across the transition. Replace the source-slicing assertion in enterprise-activation.test.ts that depended on the removed branch.
Problem
The cloud and enterprise desktop artifacts render a gate above the routes on first launch (sign-in, or "Link this app to your organization"). That code path never ran in CI:
packaged-smoke.mjsbooted only the public flavor, and the enterprise gate was covered byreadFileSync(...).toContain(...)assertions on source text.0.18.43 and 0.18.44 shipped with
DesktopUpdaterProvider(#4482) readingLocalandDesktopConfigcontexts that the pre-activation branch ofEnterpriseAwareAppProvidersnever mounted. Every fresh self-hosted install (Airwallex report, 2026-09-09) opened to a blank window withError: Local context is missing. Our telemetry cannot see this by design (Sentry only sends after sign-in), so CI is the only place it can be caught.What this PR does
devwithout the fix, so they land together. This gives the fix the runtime proof AGENTS.md requires.packaged-first-launch.e2e.test.tswith worldevals/worlds/packaged-first-launch.ts: boots the packaged binary on a fresh profile (no bootstrap, no activation), attaches without the signed-in readiness gate, opens a second CDP session forRuntime.exceptionThrown, and asserts the flavor's gate heading is mounted in#rootwith zero synchronous render crashes (unhandled promise rejections are recorded, not gating; the pre-activationopenwork:desktopIPC rejection predates this and is harmless).packaged-smoke.mjsnow packageselectron-builder.enterprise.ymlandelectron-builder.cloud.ymland boots each through that journey, in the sameopenwork-tests-buildstep that already blocks merges. No workflow file changes; package ≈ 9 s and boot ≈ 10 s per flavor on the warm runner.journey-catalog.mjswithplacement: local(only packaged-smoke has the binaries).Proof (local lane, macOS arm64)
openwork-enterprise-mac-arm64-0.18.44a provider context was missing during first launch … Error: Local context is missing at Sb (app-DqZb8wH-.js:1082)openwork-enterprise-mac-arm64-0.18.42electron-builder.enterprise.yml --mac --direlectron-builder.cloud.yml --mac --dirCommands:
Also:
apps/appbun test src/react-app/shell/providers.test.tsx tests/enterprise-activation.test.ts11 pass (the new unit test fails whenproviders.tsxis reverted todev);evalstypecheck,lint:layers, channel and boundary ratchets report nothing for the new files (remaining findings are pre-existing ondev);node --test evals/scripts/journey-ci.test.mjs12 pass.The Linux packaged-smoke lane runs in this PR's
openwork-tests-buildjob and is the authoritative evidence.Follow-ups (not in this PR)
EnterpriseAwareAppProvidersso AppRoot-level consumers cannot depend on a branch they cannot see.apps/app/tests/enterprise-activation.test.tswith render tests.Closes #4606.