Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wrangler] Prevents uploads with both cron triggers and smart placement enabled #3390

Conversation

shahsimpson
Copy link
Contributor

Fixes # [insert GH or internal issue number(s)].

What this PR solves / how to test:
This PR prevents uploads that enable smart placement and include cron triggers. Cron triggers are currently unsupported with smart placement.

Author has included the following, where applicable:

Reviewer is to perform the following, as applicable:

  • Checked for inclusion of relevant tests
  • Checked for inclusion of a relevant changeset
  • Checked for creation of associated docs updates
  • Manually pulled down the changes and spot-tested

@changeset-bot
Copy link

changeset-bot bot commented Jun 1, 2023

🦋 Changeset detected

Latest commit: 609a118

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

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

@Skye-31
Copy link
Contributor

Skye-31 commented Jun 1, 2023

Wouldn't it make more sense to do this validation in the API? If it becomes supported in future, it won't require people to update their wrangler versions

@github-actions
Copy link
Contributor

github-actions bot commented Jun 2, 2023

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/5158640018/npm-package-wrangler-3390

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

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

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/5158640018/npm-package-wrangler-3390 dev path/to/script.js
Additional artifacts:
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/5158640018/npm-package-cloudflare-pages-shared-3390

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

Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

Tidy work for someone who doesn't know the code base.
Nice one @shahsimpson.

Just a couple of NITs and one minor request about ensuring test-coverage. Otherwise LGTM.

@codecov
Copy link

codecov bot commented Jun 2, 2023

Codecov Report

Merging #3390 (609a118) into main (a728876) will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3390      +/-   ##
==========================================
+ Coverage   75.42%   75.47%   +0.05%     
==========================================
  Files         182      182              
  Lines       11063    11070       +7     
  Branches     2902     2903       +1     
==========================================
+ Hits         8344     8355      +11     
+ Misses       2719     2715       -4     
Impacted Files Coverage Δ
packages/wrangler/src/config/validation-helpers.ts 99.01% <100.00%> (+0.02%) ⬆️
packages/wrangler/src/config/validation.ts 90.43% <100.00%> (+0.01%) ⬆️

... and 3 files with indirect coverage changes

@shahsimpson shahsimpson force-pushed the validate-placement-and-triggers-config branch 2 times, most recently from 8250a5c to 297ccfb Compare June 2, 2023 18:21
@shahsimpson shahsimpson force-pushed the validate-placement-and-triggers-config branch from 297ccfb to 609a118 Compare June 2, 2023 18:34
@shahsimpson
Copy link
Contributor Author

Wouldn't it make more sense to do this validation in the API? If it becomes supported in future, it won't require people to update their wrangler versions

Hi @Skye-31! This validation is done in the API as well. Since the calls to deploy a worker and update cron triggers go to separate endpoints, we want to allow for users that had already deployed workers with both configured (before we added that validation) to continue to deploy via Wrangler while also being pushed to update their config.

Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

Love it! Nice work @shahsimpson - LGTM.

@petebacondarwin petebacondarwin merged commit b5b46b4 into cloudflare:main Jun 3, 2023
11 checks passed
@github-actions github-actions bot mentioned this pull request Jun 3, 2023
@shahsimpson shahsimpson deleted the validate-placement-and-triggers-config branch June 5, 2023 14:19
maxwellpeterson pushed a commit to maxwellpeterson/workers-sdk that referenced this pull request Oct 16, 2023
Revert "Prevents uploads with both cron triggers and smart placement enabled (cloudflare#3390)"

This reverts commit b5b46b4.
maxwellpeterson pushed a commit to maxwellpeterson/workers-sdk that referenced this pull request Oct 19, 2023
Revert "Prevents uploads with both cron triggers and smart placement enabled (cloudflare#3390)"

This reverts commit b5b46b4.
maxwellpeterson pushed a commit to maxwellpeterson/workers-sdk that referenced this pull request Oct 25, 2023
Revert "Prevents uploads with both cron triggers and smart placement enabled (cloudflare#3390)"

This reverts commit b5b46b4.
penalosa pushed a commit that referenced this pull request Oct 27, 2023
…4219)

Revert "Prevents uploads with both cron triggers and smart placement enabled (#3390)"

This reverts commit b5b46b4.

Co-authored-by: Max Peterson <mpeterson@cloudflare.com>
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.

None yet

3 participants