Skip to content

feat: pull resource names for provisioning from config if provided #7733

Merged
emily-shen merged 9 commits intomainfrom
emily/provisioning-defaults
Jan 15, 2025
Merged

feat: pull resource names for provisioning from config if provided #7733
emily-shen merged 9 commits intomainfrom
emily/provisioning-defaults

Conversation

@emily-shen
Copy link
Copy Markdown
Contributor

Fixes DEVX-1556


  • Tests
    • TODO (before merge)
    • Tests included
    • Tests not necessary because:
  • E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required
    • Not required because:
  • Public documentation
    • TODO (before merge)
    • Cloudflare docs PR(s):
    • Documentation not necessary because: still experimental

@emily-shen emily-shen requested review from a team as code owners January 10, 2025 18:18
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jan 10, 2025

🦋 Changeset detected

Latest commit: 918dd54

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

This PR includes changesets to release 2 packages
Name Type
wrangler 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

Comment thread packages/wrangler/src/d1/list.ts Outdated
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

tangential, but noticed that d1 list pagination seems to default to 10 per page, which seems quite low to me - is there a particular reason this is the case? KV is 100 per page for reference

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 10, 2025

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12773009455/npm-package-wrangler-7733

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/7733/npm-package-wrangler-7733

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12773009455/npm-package-wrangler-7733 dev path/to/script.js
Additional artifacts:

cloudflare-workers-bindings-extension:

wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12773009455/npm-package-cloudflare-workers-bindings-extension-7733 -O ./cloudflare-workers-bindings-extension.0.0.0-v6b12484ed.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-v6b12484ed.vsix

create-cloudflare:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12773009455/npm-package-create-cloudflare-7733 --no-auto-update

@cloudflare/kv-asset-handler:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12773009455/npm-package-cloudflare-kv-asset-handler-7733

miniflare:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12773009455/npm-package-miniflare-7733

@cloudflare/pages-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12773009455/npm-package-cloudflare-pages-shared-7733

@cloudflare/unenv-preset:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12773009455/npm-package-cloudflare-unenv-preset-7733

@cloudflare/vitest-pool-workers:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12773009455/npm-package-cloudflare-vitest-pool-workers-7733

@cloudflare/workers-editor-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12773009455/npm-package-cloudflare-workers-editor-shared-7733

@cloudflare/workers-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12773009455/npm-package-cloudflare-workers-shared-7733

@cloudflare/workflows-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/12773009455/npm-package-cloudflare-workflows-shared-7733

Note that these links will no longer work once the GitHub Actions artifact expires.


wrangler@3.101.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20241230.1
workerd 1.20241230.0 1.20241230.0
workerd --version 1.20241230.0 2024-12-30

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

Comment thread packages/wrangler/src/deployment-bundle/bindings.ts Outdated
@emily-shen emily-shen added the e2e Run wrangler + vite-plugin e2e tests on a PR label Jan 13, 2025
Comment thread packages/wrangler/src/deployment-bundle/bindings.ts Outdated
Comment thread packages/wrangler/src/deployment-bundle/bindings.ts Outdated
Comment thread packages/wrangler/src/deployment-bundle/bindings.ts Outdated
@emily-shen emily-shen force-pushed the emily/provisioning-defaults branch from b1fab1b to 758fae3 Compare January 13, 2025 20:52
@emily-shen emily-shen requested a review from penalosa January 14, 2025 11:36
Copy link
Copy Markdown
Contributor

@penalosa penalosa left a comment

Choose a reason for hiding this comment

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

Couple comments, but in general lgtm

Comment thread .changeset/smart-lions-suffer.md
Comment thread packages/wrangler/src/deployment-bundle/bindings.ts Outdated
Comment on lines +329 to +331
const foundResourceId = preExisting.find(
(r) => r.title === name
)?.value;
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.

What case is this catering for? Surely if the item has a name (D1 or R2) which maps to an existing resource we should have already bound to it further up? Why do we need to ask the user?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added a comment to explain.

Decided to keep searching preExisting for now since it is unlikely normal users will hit this, but will follow up to ask for a getD1ByName endpoint.

@emily-shen emily-shen merged commit dceb196 into main Jan 15, 2025
@emily-shen emily-shen deleted the emily/provisioning-defaults branch January 15, 2025 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e Run wrangler + vite-plugin e2e tests on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants