ci: add dedicated edge-safe runtime check#126
Conversation
The runtime edge import guard already existed as a harness test, but it was buried inside the broad test job. Add a root script and a separate CI job so browser-condition/runtime import regressions show up as their own check on every PR. Constraint: Keep the guard structural and cheap; do not add a Cloudflare/Wrangler runtime dependency for this signal Rejected: Rely only on the full test job | failures would be less visible and easier to miss during runtime changes Confidence: high Scope-risk: narrow Directive: Keep this job focused on static runtime import and process-less browser-condition smoke checks Tested: pnpm run test:edge-safe; pnpm run check; git diff --check
|
Important Review skippedAuto reviews are disabled on this repository. To trigger a review, include ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces a new test:edge-safe script to the package.json file to execute edge-safe runtime import tests. Feedback indicates that the file path provided in the script likely contains a typo and should be updated to reflect the correct directory structure.
| "typecheck:root": "pnpm -F @ai-sdk-tool/harness exec tsc --noEmit -p ../../tsconfig.root.json", | ||
| "check": "pnpm exec ultracite check .", | ||
| "lint": "pnpm exec ultracite fix .", | ||
| "test:edge-safe": "pnpm -F @ai-sdk-tool/harness exec vitest run src/runtime/runtime-edge-imports.test.ts", |
There was a problem hiding this comment.
The path src/runtime/runtime-edge-imports.test.ts appears to be incorrect. Based on the packages/harness/package.json exports, the runtime-related source files are located in the src/subpath/ directory (e.g., src/subpath/runtime.ts). It is highly likely that this test file is also located in src/subpath/ or that src/runtime/ is a typo for src/subpath/.
| "test:edge-safe": "pnpm -F @ai-sdk-tool/harness exec vitest run src/runtime/runtime-edge-imports.test.ts", | |
| "test:edge-safe": "pnpm -F @ai-sdk-tool/harness exec vitest run src/subpath/runtime-edge-imports.test.ts", |
|
Closing this one because it only promoted an existing test into a separate CI signal without adding new edge-safety coverage. A follow-up should verify the published/dist runtime contract instead, and we can separately evaluate a Wrangler/workerd-based CI check if we want true Cloudflare Worker runtime coverage. |
Summary
test:edge-safescript that runs the existing harness runtime edge import guard directly.edge-safeCI job so runtime/browser-condition regressions are visible as their own PR check.What this checks
@ai-sdk-tool/harness/runtimehas no staticnode:*imports in its source graph.processglobal.Verification
pnpm run test:edge-safepnpm run checkgit diff --checkNo changeset: CI-only change.
Summary by cubic
Add a dedicated edge-safe runtime CI check to catch Node-only import and browser-condition regressions in
@ai-sdk-tool/harness/runtime. This makes edge safety a visible, separate PR signal.test:edge-safescript to run the existing import guard test.edge-safeGitHub Actions job to run the script on PRs, verifying no staticnode:*imports and that runtime subpaths import without aprocessglobal.Written for commit 14c5b57. Summary will update on new commits. Review in cubic