Conversation
🦋 Changeset detectedLatest commit: 638387e The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
a868cc2 to
9ae60ad
Compare
|
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/8472555798/npm-package-wrangler-5426You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/5426/npm-package-wrangler-5426Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8472555798/npm-package-wrangler-5426 dev path/to/script.jsAdditional artifacts:npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8472555798/npm-package-create-cloudflare-5426 --no-auto-updatenpm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8472555798/npm-package-cloudflare-kv-asset-handler-5426npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8472555798/npm-package-miniflare-5426npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8472555798/npm-package-cloudflare-pages-shared-5426npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8472555798/npm-package-cloudflare-vitest-pool-workers-5426Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5426 +/- ##
=========================================
+ Coverage 0 72.29% +72.29%
=========================================
Files 0 325 +325
Lines 0 16765 +16765
Branches 0 4290 +4290
=========================================
+ Hits 0 12120 +12120
- Misses 0 4645 +4645
|
f5f793d to
44c2f27
Compare
… `wrangler deploy` but different in `wrangler triggers deploy`
|
|
||
| This command extracts the trigger deployment logic from `wrangler deploy` and allows users to update their currently deployed Worker's triggers without doing another deployment. This is primarily useful for users of `wrangler versions upload` and `wrangler versions deploy` who can then run `wrangler triggers deploy` to apply trigger changes to their currently deployed Worker Versions. | ||
|
|
||
| The command can also be used even if not using the `wrangler versions ...` commands. And, in fact, are already using it implicitly when running `wrangler deploy`. |
There was a problem hiding this comment.
This is missing a word. Maybe "developers are already using it implicitly when running wrangler deploy?
There was a problem hiding this comment.
These snapshots should not be changed, but I assume this has been fixed in a followup?
There was a problem hiding this comment.
Same comment as for deploy.test.ts
| .option("dispatch-namespace", { | ||
| describe: | ||
| "Name of a dispatch namespace to deploy the Worker to (Workers for Platforms)", | ||
| type: "string", | ||
| }); |
There was a problem hiding this comment.
I realise these options are copied from deploy, but this argument doesn't make sense for triggers
| const configPath = args.config || findWranglerToml(); | ||
| const config = readConfig(configPath, args); |
There was a problem hiding this comment.
You don't need to resolve the config path outside of readConfig(). The first argument should be undefined here
| for (const route of routes) { | ||
| if (typeof route !== "string" && route.custom_domain) { | ||
| if (route.pattern.includes("*")) { | ||
| throw new UserError( | ||
| `Cannot use "${route.pattern}" as a Custom Domain; wildcard operators (*) are not allowed` | ||
| ); | ||
| } | ||
| if (route.pattern.includes("/")) { | ||
| throw new UserError( | ||
| `Cannot use "${route.pattern}" as a Custom Domain; paths are not allowed` | ||
| ); | ||
| } | ||
| customDomainsOnly.push(route); | ||
| } else { | ||
| routesOnly.push(route); | ||
| } | ||
| } |
There was a problem hiding this comment.
You've added logic for publishing routes here, but haven't removed it from wrangler deploy. Are you sure this won't cause duplicate deploys?
There was a problem hiding this comment.
Definitely not causing duplicate deploys. This was left for the validation. The arrays are dead code which have been removed in #5436
|
for posterity, i am approving this PR -- the concerns raised are addressed in the linked PRs/commits, which themselves have been approved |
What this PR solves / how to test
This PR implements the
wrangler triggers deploycommand behind the--experimental-versionsflag.I extracted the logic from
wrangler deploywhich I've now made call into the extracted function. The test coverage forwrangler deployshould coverwrangler triggers deploy.The only difference this makes to
wrangler deployis:the log lineno longer different"Published <worker-name> (<timing>)"is now"Deployed <worker-name> triggers (<timing>)"available_on_subdomainfrom the response of the PUT script call, it now makes an additional GET call to ".../subdomain" to get the valueIt is possible to mitigate these two differences but I don't think the log line change or minimal added latency necessitates it. But I'm open to others' opinions :)The only difference is the latencyCR: https://jira.cfdata.org/browse/CR-850334
Author has addressed the following