From 2bb94cbc78e54001d38d899f0e7a7feaf1f59f31 Mon Sep 17 00:00:00 2001 From: aarroyo Date: Sun, 16 Aug 2026 22:44:07 -0500 Subject: [PATCH] fix(ci): the CLI release type-checks against siblings it never built MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit THIRD FAILURE ON THE SAME JOB, THIRD DIFFERENT CAUSE. `build-and-test` in sdk-cli-release has now failed on every tag it ever ran on: v1 / v1.3.0 Generate SBOM (CycloneDX) — npm ls exit code (fixed, #568) v1.3.3 Architecture Boundary Lint — pre-existing debt (fixed, #600) v1.3.4 Type Check and Build — this Each fix uncovered the next, because the job only ever executes on a tag: it is gated on `release_created`, which `release-gate` sets only for `refs/tags/v*`. On every branch push it is SKIPPED and the workflow reports success. Five green runs on `main` tonight told us nothing about it. WHAT FAILED `Type Check and Build` runs `npm run build` inside `src/sdk/cli`, which compiles the CLI and nothing else. In a workspace, `@beyondnet/*` resolve to the local packages by symlink, but a SUBPATH import needs that package's `dist/` to exist, and it does not after a bare `npm ci`. 100+ errors, all the same shape: src/app.module.ts(12,29): error TS2307: Cannot find module '@beyondnet/evolith-core-domain/application/sync/sync.service' src/commands/agents/agents.command.ts(5,40): error TS2307: Cannot find module '@beyondnet/evolith-infra-providers' THE FIX ALREADY EXISTS, ONE WORKFLOW OVER `npm-release.yml` has a step called "Build every workspace" that runs the root `npm run build` (`tsc -b tsconfig.json` over all projects). sdk-cli-release never had it. Added, immediately after `npm ci` and before the lint and type-check that depend on it. VERIFIED, INCLUDING THE PART THAT LOOKED LIKE A PROBLEM Locally, the root build exits 2 — but for a reason that does not exist on the runner, and the distinction was measured rather than assumed: root `npm run build` here -> exit 2, 4 × TS2307, all '@nestjs/cache-manager' is it declared? -> yes, in src/packages/mcp-server/package.json is it in the lockfile? -> yes, @3.1.3 under src/packages/mcp-server/node_modules and src/apps/core-api/node_modules so `npm ci` installs it -> and the SAME step in npm-release.yml ran tonight on main with conclusion=success and 0 TS2307 errors (run 31991739387) My local tree has a symlinked node_modules without those nested installs. On the runner the root build passes, which is the only place this step will run. And after a root build, the CLI's own type-check is clean: cli `npm run build` -> exit 0, TS2307 errors: 0 NOT FIXED The reason all three of these survived: `build-and-test` never runs on a pull request. Fixing that is a larger change than a release-night fix and is not attempted here — but it is the actual defect, and each of these three is a symptom of it. Signed-off-by: aarroyo --- .github/workflows/sdk-cli-release.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/sdk-cli-release.yml b/.github/workflows/sdk-cli-release.yml index 7996984d..7a44bec3 100644 --- a/.github/workflows/sdk-cli-release.yml +++ b/.github/workflows/sdk-cli-release.yml @@ -125,6 +125,24 @@ jobs: - name: Install Dependencies run: npm ci + # BUILD THE SIBLINGS BEFORE TYPE-CHECKING THE THING THAT IMPORTS THEM. + # + # "Type Check and Build" below runs `npm run build` inside src/sdk/cli, which compiles + # the CLI and nothing else. In a workspace, `@beyondnet/*` resolve to the local packages + # by symlink — but a subpath import needs that package's `dist/` to exist. It does not + # after a bare `npm ci`, so the tag run died with 100+ of these: + # + # error TS2307: Cannot find module '@beyondnet/evolith-core-domain/domain/interfaces' + # error TS2307: Cannot find module '@beyondnet/evolith-infra-providers' + # + # npm-release.yml has always had this step — it is called "Build every workspace" there. + # This workflow never did, and nothing noticed because `build-and-test` is gated on + # `release_created`: it is SKIPPED on every branch push and only executes on a `v*` tag, + # where it has now failed three times for three different reasons (SBOM on v1.3.0, lint + # on v1.3.3, this on v1.3.4). Each fix uncovered the next. + - name: Build every workspace + run: npm run build + # `cyclonedx-npm` shells out to `npm ls --json --long --all`, and npm exits # NON-ZERO (`ELSPROBLEMS`) for benign tree observations as well as for real # breakage. This tree has several that are expected and not going away: