Skip to content

ci(sdk): install TS SDK node deps before SDK Integration Tests#8702

Closed
scarmani wants to merge 1 commit into
mainfrom
claude/competent-cannon-063bad
Closed

ci(sdk): install TS SDK node deps before SDK Integration Tests#8702
scarmani wants to merge 1 commit into
mainfrom
claude/competent-cannon-063bad

Conversation

@scarmani

Copy link
Copy Markdown
Collaborator

Problem

The SDK Integration Tests CI job (sdk-integration in .github/workflows/sdk-test.yml) was failing on:

tests/sdk/test_typescript_exports.py::TestTypeScriptCompilation::test_sdk_compiles_cleanly

with:

src/typecheck/node26-consumer.ts(1,23): error TS2688: Cannot find type definition file for 'node'.
src/typecheck/node26-consumer.ts(4,59): error TS2591: Cannot find name 'node:stream/web'. ...

This is a pre-existing toolchain gap, not a product bug. It surfaced on #8701 but is unrelated to that PR's 2-line version change.

Root cause

test_sdk_compiles_cleanly shells out to npx tsc --noEmit inside sdk/typescript. The sdk-integration job sets up Python only — it never ran actions/setup-node or npm ci. With no node_modules:

  • npx resolved an unpinned tsc instead of the repo-pinned typescript@^6.0.3, and
  • @types/node (already a devDependency at ^26.0.0) was absent, so the /// <reference types="node" /> and node:stream/web import in src/typecheck/node26-consumer.ts could not resolve → TS2688 / TS5103.

The sibling typescript-sdk-run job already does setup-node + npm ci; the integration job that actually runs the pytest compile check did not.

Fix

Add actions/setup-node@v4 + npm ci (scoped to sdk/typescript) to the sdk-integration job, before the pytest step. tsconfig.json needs no change — with @types/node present in node_modules, the triple-slash node reference resolves via the default @types auto-include.

Verification

Reproduced locally via the exact failing path:

  • Before (node_modules absent): test_sdk_compiles_cleanly fails (unpinned tsc → TS5103 / TS2688).
  • After (npm ci in sdk/typescript): 1 passed.
$ python -m pytest tests/sdk/test_typescript_exports.py::TestTypeScriptCompilation::test_sdk_compiles_cleanly -q
1 passed

🤖 Generated with Claude Code

The `sdk-integration` job runs `pytest tests/sdk/`, which includes
`test_typescript_exports.py::TestTypeScriptCompilation::test_sdk_compiles_cleanly`.
That test shells out to `npx tsc --noEmit` in `sdk/typescript`, but the job
never set up Node or ran `npm ci`. With no `node_modules`, npx resolved an
unpinned `tsc` and `@types/node` was absent, producing TS2688
("Cannot find type definition file for 'node'") / TS5103.

Add `actions/setup-node` + `npm ci` (mirroring the `typescript-sdk-run` job)
so the compile test gets the pinned TypeScript and `@types/node`. Verified
locally: the test fails without `node_modules` and passes after `npm ci`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@scarmani

Copy link
Copy Markdown
Collaborator Author

Closing for queue drain as a duplicate/superseded workflow fix. The functional SDK integration change here (adding setup-node + npm ci for sdk/typescript before the SDK integration pytest step) is already carried in PR #8691, which remains open as the active required-context repair path. Branch preserved: claude/competent-cannon-063bad at 9adf200; this close is reversible if #8691 is abandoned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant