Repository navigation
fix(deploy): declare @sap-ai-sdk externals in srv-qa + srv-mcp (boot crash) - #2531
Merged
Merged
Conversation
srv-qa/package.json was missing @sap-ai-sdk/orchestration, causing a boot crash on DEV (ERR_MODULE_NOT_FOUND) because content.bundle.mjs imports it transitively via packages/content/category-classifier-llm.js. srv-mcp was missing @sap-ai-sdk/foundation-models for the same reason. Also adds scripts/check-bundle-externals-declared.cjs: a static guard that parses every *.bundle.mjs in srv/srv-qa/srv-mcp and asserts each bare @sap-ai-sdk/* and @sap/* external is declared in that module's package.json. Wired into static-guards. 18 new Vitest tests covering the guard + a regression test that would fail if the orchestration fix were reverted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After srv-qa staging was fixed (#2530), srv-qa CRASHED at CF boot:
Root cause (general class)
bundle-shared.cjsmarks@sap-ai-sdk/*+@sap/*as external (correct — large CF-runtime SDKs, not inlined). Externals must exist in the consuming module's node_modules at CF. The content bundle transitively imports@sap-ai-sdk/orchestration+@sap-ai-sdk/foundation-models(viapackages/content/category-classifier-llm.js), so every module shipping that bundle must declare them.foundation-modelsbut was missingorchestration→ boot crash.foundation-models→ would crash the same way on the mcp-MTA deploy.Fix
srv-qa/package.json: +@sap-ai-sdk/orchestration@^2.12.0srv-mcp/package.json: +@sap-ai-sdk/foundation-models@^2.12.0(
@sap-ai-sdkis published — installs at CF staging; unlike@tutorials/*which is stripped.)New gate
scripts/check-bundle-externals-declared.cjs+ 18 tests: for each module shipping a*.bundle.mjs, parses the bundle's bare external imports and asserts each is in that module'spackage.jsondeps. Includes a regression test modelling the exact pre-fix srv-qa state. Wired into static-guards. This is the class behind the last several DEV crashes (workspace/externals must be present-or-bundled per module).Verified
check-bundle-externals-declaredpasses live; 29/29 new tests pass.@sap-ai-sdk/*+@sap/*a bundle imports is now declared.4th deploy blocker for the carve → DEV. Backend healthy; srv-qa staged (#2530); this fixes srv-qa (and pre-empts srv-mcp) boot.