Skip to content

ci: add dedicated edge-safe runtime check#126

Closed
minpeter wants to merge 1 commit into
mainfrom
codex/add-edge-safe-ci
Closed

ci: add dedicated edge-safe runtime check#126
minpeter wants to merge 1 commit into
mainfrom
codex/add-edge-safe-ci

Conversation

@minpeter
Copy link
Copy Markdown
Owner

@minpeter minpeter commented Apr 27, 2026

Summary

  • Add a root test:edge-safe script that runs the existing harness runtime edge import guard directly.
  • Add a dedicated edge-safe CI job so runtime/browser-condition regressions are visible as their own PR check.

What this checks

  • @ai-sdk-tool/harness/runtime has no static node:* imports in its source graph.
  • The runtime subpath imports under browser conditions without a process global.

Verification

  • pnpm run test:edge-safe
  • pnpm run check
  • git diff --check

No 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.

  • New Features
    • Added root test:edge-safe script to run the existing import guard test.
    • Added edge-safe GitHub Actions job to run the script on PRs, verifying no static node:* imports and that runtime subpaths import without a process global.

Written for commit 14c5b57. Summary will update on new commits. Review in cubic

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
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

Important

Review skipped

Auto reviews are disabled on this repository. To trigger a review, include @crb review in the PR description. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b8381008-4657-4e8a-8521-d0a1efad0c78

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/add-edge-safe-ci

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread package.json
"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",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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/.

Suggested change
"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",

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

@minpeter
Copy link
Copy Markdown
Owner Author

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.

@minpeter minpeter closed this Apr 27, 2026
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