From cdaec872bd6699f7a68ce64b9525fa88c9f4ce00 Mon Sep 17 00:00:00 2001 From: Sawyer Date: Thu, 17 Sep 2026 19:04:24 -0700 Subject: [PATCH] feat(web): publish tools/* into the tenant registry before deploying Myra (CL-8403) --- apps/web/src/pages/onboarding-page.tsx | 36 ++++++++++++++++---------- apps/web/src/tools/registry-publish.ts | 2 +- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/apps/web/src/pages/onboarding-page.tsx b/apps/web/src/pages/onboarding-page.tsx index 8c68b88aae..00d407d786 100644 --- a/apps/web/src/pages/onboarding-page.tsx +++ b/apps/web/src/pages/onboarding-page.tsx @@ -26,6 +26,7 @@ import { useCallback, useEffect, useState } from "react"; import { ensurePrimaryTenant, runPortableClientBootstrap } from "../client-bootstrap"; import { createFetchStockHub, findOwnedTenants } from "../needs-converge"; import { deployMyraSource } from "../myra-deploy"; +import { publishToolPackageRegistry } from "../tools/registry-publish"; import { useNavigate } from "../navigation"; import { triggerFirstLoginProvisioning } from "../onboarding"; import { OnboardingLayout } from "../onboarding/onboarding-layout"; @@ -152,20 +153,27 @@ export function OnboardingPage({ user }: { readonly user: SessionUser }) { tenantDomain: string, offering: ExistingOffering, ): Promise { - return deployMyraSource({ - tenantId, - tenantDomain, - sourceOfferingIds: offering.sourceOfferingIds, - defaultSourceOfferingId: offering.defaultSourceOfferingId, - }).then( - (myraDeploy) => setState({ phase: "installing", myraDeploy }), - (error: unknown) => { - setState({ - phase: "error", - message: error instanceof Error ? error.message : "Publishing Myra's source hit a snag.", - }); - }, - ); + // Myra's pins resolve from the tenant registry, so the tool packages + // must be there before her definition deploys. + return publishToolPackageRegistry(tenantId) + .then(() => + deployMyraSource({ + tenantId, + tenantDomain, + sourceOfferingIds: offering.sourceOfferingIds, + defaultSourceOfferingId: offering.defaultSourceOfferingId, + }), + ) + .then( + (myraDeploy) => setState({ phase: "installing", myraDeploy }), + (error: unknown) => { + setState({ + phase: "error", + message: + error instanceof Error ? error.message : "Publishing Myra's source hit a snag.", + }); + }, + ); } // Step 4: the installer itself, run once a `myraDeploy` is in hand. A diff --git a/apps/web/src/tools/registry-publish.ts b/apps/web/src/tools/registry-publish.ts index abab8a6f78..1c399d750e 100644 --- a/apps/web/src/tools/registry-publish.ts +++ b/apps/web/src/tools/registry-publish.ts @@ -164,7 +164,7 @@ function buildToolPackageTree( ), }; for (const [sourcePath, contents] of Object.entries(TOOL_PACKAGE_SOURCE_FILES)) { - if (!sourcePath.startsWith(prefix)) continue; + if (!sourcePath.startsWith(prefix) || /\.test\.tsx?$/.test(sourcePath)) continue; tree[sourcePath.slice(prefix.length)] = contents; } return { name: manifest.name, version: manifest.version, tree };