Repository navigation
Pin the device checkout to the Server's revision (#435, HUABU-CLOUD-07) - #439
Yuge Zhang (ultmaster) wants to merge 4 commits into
Conversation
…crosoft#435) A device has to run Huabu source that matches the Server, but nothing told it which commit the Server runs. The image already bakes the commit into `HUABU_DEPLOYED_SHA` (from `SOURCE_REVISION`), and a source checkout fills it from `git rev-parse HEAD`; only the owner-only Canary status read it. `deployedSha()` now owns reading that variable, and the readiness response every signed-in person's Settings already loads carries it as `revision` (null when unknown, absent from older servers). Part of microsoft#435 (HUABU-CLOUD-07). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#435) Connect device asked for source matching the Server but showed an unpinned clone, and its shell picker always started on Bash/Zsh, even in a Windows browser. - When readiness reports the Server's commit, the setup commands check out exactly that revision before `pnpm install`, and the text names it. When the Server does not report one, the commands stay unpinned and the text says the revision is unknown. Before readiness loads, the generic text is unchanged. - The shell picker starts on PowerShell in a Windows browser and on Bash/Zsh elsewhere; it can still be switched. Part of microsoft#435 (HUABU-CLOUD-07). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Fresh non-owner sessions show unpinned Connect device commands despite a valid server SHA because readiness is loaded only for deployment managers.
1 open issue
What changed in this PR
Addresses the device-onboarding portion of HUABU-CLOUD-07 by using the Server’s deployed revision for matching source checkouts. The standalone device client remains out of scope.
Changes:
- Exposes an optional full commit SHA through deployment readiness, reusing Canary’s revision validation.
- Adds pinned checkout instructions and localized fallback text when the revision is unknown.
- Defaults the shell picker to PowerShell on Windows and adds revision and platform coverage.
| File | Description |
|---|---|
packages/shared/src/types/api/deployment.ts |
Adds the optional, nullable revision contract. |
docs/architecture/canary-deployment.md |
Documents revision reporting and device checkout behavior. |
apps/web/src/utils/platform.ts |
Adds Windows platform detection. |
apps/web/src/i18n/resources/zh-CN/common.json |
Adds Chinese revision guidance. |
apps/web/src/i18n/resources/en/common.json |
Adds English revision guidance. |
apps/web/src/components/Settings/sections/ExternalAgentRuntimeSettings.tsx |
Displays pinned checkout commands and selects the default shell. |
apps/web/src/components/Settings/sections/ExternalAgentRuntimeSettings.test.tsx |
Covers revision states and platform-specific shell defaults. |
apps/server/src/modules/security/deployment.route.ts |
Includes the deployed revision in readiness responses. |
apps/server/src/modules/security/deployment.route.test.ts |
Tests revision reporting and SHA validation. |
apps/server/src/modules/security/canary-redeploy.ts |
Shares the deployed-SHA reader between Canary and readiness. |
Review effort: Balanced
…t#435) Settings loads deployment readiness only for people who manage the deployment, so a Bubble member opening Connect device never received the Server's revision and got the unpinned checkout. Found signing in a real Auth0 member against a local Bubble server. The Connect device section now loads readiness once on mount when nothing else has. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Connection instructions retain a stale server revision for Bubble members across reopening, potentially recommending an outdated git checkout as the exact running revision after a server update.
1 open issue
1 resolved since last review
Review effort: Balanced
Test coverageHead tested: Automated
Real browserPlaywright/Chromium against a local server on this branch: Bubble identity with the real Auth0 and Entra authenticators, Postgres in a disposable container, and
Not covered
🤖 Generated with Claude Code |
…rosoft#435) The readiness store outlives the Settings page and only owners refresh it, so a member who opened Connect device before a redeploy kept being told to check out the old commit as "the exact revision this server runs". Connect device now asks again on every open, joining a load already in flight, and shows the generic text rather than a possibly stale SHA while it waits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Summary
The easy half of HUABU-CLOUD-07 from #435: Connect device now tells a device to check out the exact revision the Server runs, and the shell picker defaults to the viewer's platform. Split out of #438 on request. The versioned standalone device client (the architecture half of 07) is not in scope.
HUABU_DEPLOYED_SHA, which until now only the owner-only Canary status read. Docker images set it from theSOURCE_REVISIONbuild argument, andscripts/start-web.mjsfills it fromgit rev-parse HEADwhen unset. A singledeployedSha()incanary-redeploy.tsreads it for both Canary and readiness.GET /api/deployment/readinessgains an optionalrevision: the full 40-character commit, or null when unset or not a full SHA. Older servers leave it out, which reads as unknown.git clone …,cd Huabu,git checkout <full sha>,pnpm install, and the text names the short SHA. Without one, the commands stay unpinned and the text says the Server doesn't report its exact revision.Behaviour changes to review
microsoft/Huabu. An image built from an unpushed fork commit shows a SHA that can't be checked out.Verification
pnpm run lint(0 errors),format:check,typecheck,check:i18n,check-headers, andpnpm run testacross all packages pass.HUABU_DEPLOYED_SHAset to a real upstream commit. Readiness returned the revision. Connect device showed "the exact revision this server runs (0b4438c)" andgit checkout 0b4438c81f7fb5562dac8f96b19a80302c7f5d15beforepnpm install. With the platform reported as Win32 the picker started on PowerShell, otherwise on Bash/Zsh. With readiness stubbed torevision: null, the commands were unpinned with the unknown-revision explanation.HUABU_DEPLOYED_SHAset to this branch's head. The member's readiness returned the revision, but Connect device showed the unpinned commands, because only owners loaded readiness. That is fixed in 56546ef: the member now seesgit checkout <sha>, and the owner still does with a single readiness request.Not verified
SOURCE_REVISION, and an actual device connecting from a pinned checkout.Refs #435
🤖 Generated with Claude Code