Skip to content

feat: add common API:s along with fetch#1773

Open
nytamin wants to merge 1 commit into
mainfrom
feat/blueprint-api-fetch
Open

feat: add common API:s along with fetch#1773
nytamin wants to merge 1 commit into
mainfrom
feat/blueprint-api-fetch

Conversation

@nytamin

@nytamin nytamin commented Jun 15, 2026

Copy link
Copy Markdown
Member

About the Contributor

This pull request is posted on behalf of SuperFly.

Type of Contribution

This is a: Feature

Current Behavior

Core exposes the fetch api to Blueprints, but not, for example, URL.

New Behavior

This PR adds some more APIs that are commonly used together with fetch:

  • URL
  • URLSearchParams
  • AbortController
  • AbortSignal

The URL api is expecially useful when working with urls and fetch.

Testing

  • I have added one or more unit tests for this PR
  • I have updated the relevant unit tests
  • No unit test changes are needed for this PR

Affected areas

Time Frame

Other Information

Status

  • PR is ready to be reviewed.
  • The functionality has been tested by the author.
  • Relevant unit tests has been added / updated.
  • Relevant documentation (code comments, system documentation) has been added / updated.

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ce428e58-ec6b-45c2-8e5c-130ec9b29d80

📥 Commits

Reviewing files that changed from the base of the PR and between 5fe6213 and 4116554.

📒 Files selected for processing (1)
  • packages/job-worker/src/blueprints/cache.ts

Walkthrough

parseBlueprintDocument in packages/job-worker/src/blueprints/cache.ts adds URL, URLSearchParams, AbortController, and AbortSignal to the vm.createContext sandbox object used when evaluating blueprint code, alongside the previously injected fetch.

Changes

Blueprint VM Sandbox Web Globals

Layer / File(s) Summary
VM sandbox context extension
packages/job-worker/src/blueprints/cache.ts
URL, URLSearchParams, AbortController, and AbortSignal are added to the vm.createContext sandbox object in parseBlueprintDocument, making these web APIs available to evaluated blueprint code.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: add common API:s along with fetch' accurately and concisely describes the main change: exposing additional common APIs (URL, URLSearchParams, AbortController, AbortSignal) alongside the existing fetch API.
Description check ✅ Passed The description is directly related to the changeset, clearly explaining the current behavior, new APIs being added, and their purpose for Blueprint developers.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/blueprint-api-fetch

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.

@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@sonarqubecloud

Copy link
Copy Markdown

@jstarpl jstarpl added the Contribution from SuperFly.tv Contributions sponsored by SuperFly.tv label Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Contribution from SuperFly.tv Contributions sponsored by SuperFly.tv

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants