Skip to content

[wrangler] Use dedicated secrets-bulk PATCH endpoint for secrets#13964

Merged
petebacondarwin merged 2 commits into
cloudflare:mainfrom
danielrs:drivas/WC-5169-wrangler-secret-bulk-api
May 20, 2026
Merged

[wrangler] Use dedicated secrets-bulk PATCH endpoint for secrets#13964
petebacondarwin merged 2 commits into
cloudflare:mainfrom
danielrs:drivas/WC-5169-wrangler-secret-bulk-api

Conversation

@danielrs
Copy link
Copy Markdown
Contributor

@danielrs danielrs commented May 18, 2026

Tracked internally: https://jira.cfdata.org/browse/WC-5169

Describe your change...

Replace the workaround that fetched all script settings (GET /settings) and re-patched the full bindings array (PATCH /settings with FormData) with a single PATCH to the new /secrets-bulk endpoint using JSON Merge Patch (RFC 7396).

This eliminates the need to read and re-send non-secret bindings, reducing the operation from 2 API calls to 1, removing risk of accidentally disrupting non-secret bindings, and simplifying the implementation from ~100 lines to ~30.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: implementation changed, behavior is the same.

A picture of a cute animal (not mandatory, but encouraged)


Open in Devin Review

@danielrs danielrs requested a review from workers-devprod as a code owner May 18, 2026 21:56
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 18, 2026

🦋 Changeset detected

Latest commit: 2fdd042

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
wrangler Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-pool-workers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk May 18, 2026
@workers-devprod workers-devprod requested review from a team and james-elicx and removed request for a team May 18, 2026 21:57
@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented May 18, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@danielrs danielrs force-pushed the drivas/WC-5169-wrangler-secret-bulk-api branch from a923def to 1edecd9 Compare May 18, 2026 21:58
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 18, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@13964

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@13964

miniflare

npm i https://pkg.pr.new/miniflare@13964

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@13964

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@13964

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@13964

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@13964

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@13964

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@13964

wrangler

npm i https://pkg.pr.new/wrangler@13964

commit: cba8c70

Comment thread packages/wrangler/src/secret/index.ts
Comment thread packages/wrangler/src/secret/index.ts Outdated
Copy link
Copy Markdown
Contributor

@workers-devprod workers-devprod left a comment

Choose a reason for hiding this comment

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

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk May 19, 2026
@petebacondarwin petebacondarwin removed the request for review from james-elicx May 19, 2026 15:06
@danielrs danielrs force-pushed the drivas/WC-5169-wrangler-secret-bulk-api branch from 1edecd9 to 234c760 Compare May 19, 2026 17:55
@petebacondarwin petebacondarwin force-pushed the drivas/WC-5169-wrangler-secret-bulk-api branch from a58f3f2 to 6a9201f Compare May 20, 2026 14:50
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

…cret bulk`

Replace the workaround that fetched all script settings (GET /settings)
and re-patched the full bindings array (PATCH /settings with FormData)
with a single PATCH to the new /secrets-bulk endpoint using JSON Merge
Patch (RFC 7396).

This eliminates the need to read and re-send non-secret bindings,
reducing the operation from 2 API calls to 1, removing risk of
accidentally disrupting non-secret bindings, and simplifying the
implementation from ~100 lines to ~30.
@danielrs danielrs force-pushed the drivas/WC-5169-wrangler-secret-bulk-api branch from 6a9201f to cba8c70 Compare May 20, 2026 16:48
devin-ai-integration[bot]

This comment was marked as resolved.

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@petebacondarwin petebacondarwin merged commit a5c9365 into cloudflare:main May 20, 2026
48 of 49 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants