Skip to content

Update non-versioned script settings on deploy#6605

Merged
WalshyDev merged 1 commit intomainfrom
walshy/versioned-deploy-tail-logpush-update
Aug 30, 2024
Merged

Update non-versioned script settings on deploy#6605
WalshyDev merged 1 commit intomainfrom
walshy/versioned-deploy-tail-logpush-update

Conversation

@WalshyDev
Copy link
Copy Markdown
Member

@WalshyDev WalshyDev commented Aug 30, 2024

What this PR solves / how to test

Fixes tail consumer + logpush not updating in new deploy path

Author has addressed the following

  • Tests
    • TODO (before merge)
    • Included
    • Not necessary because:
  • E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required / Maybe required
    • Not required because: No change to output or anything
  • Changeset (Changeset guidelines)
    • TODO (before merge)
    • Included
    • Not necessary because:
  • Public documentation
    • TODO (before merge)
    • Cloudflare docs PR(s):
    • Not necessary because: no change

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Aug 30, 2024

🦋 Changeset detected

Latest commit: 6a82bcc

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

@WalshyDev WalshyDev force-pushed the walshy/versioned-deploy-tail-logpush-update branch from c5da324 to 5ed75a8 Compare August 30, 2024 14:49
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Aug 30, 2024

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/10635013839/npm-package-wrangler-6605

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

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

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10635013839/npm-package-wrangler-6605 dev path/to/script.js
Additional artifacts:
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10635013839/npm-package-create-cloudflare-6605 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10635013839/npm-package-cloudflare-kv-asset-handler-6605
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10635013839/npm-package-miniflare-6605
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10635013839/npm-package-cloudflare-pages-shared-6605
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10635013839/npm-package-cloudflare-vitest-pool-workers-6605
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10635013839/npm-package-cloudflare-workers-editor-shared-6605
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10635013839/npm-package-cloudflare-workers-shared-6605

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


wrangler@3.73.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20240821.0
workerd 1.20240821.1 1.20240821.1
workerd --version 1.20240821.1 2024-08-21

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

@WalshyDev WalshyDev force-pushed the walshy/versioned-deploy-tail-logpush-update branch from 5ed75a8 to 19f630c Compare August 30, 2024 14:57
@WalshyDev WalshyDev force-pushed the walshy/versioned-deploy-tail-logpush-update branch from 19f630c to 6a82bcc Compare August 30, 2024 15:10
@WalshyDev WalshyDev marked this pull request as ready for review August 30, 2024 15:20
@WalshyDev WalshyDev requested a review from a team as a code owner August 30, 2024 15:20
if (props.dryRun) {
printBindings({ ...withoutStaticAssets, vars: maskedVars });
} else {
assert(accountId, "Missing accountId");
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.

This shouldn't be an assertion. If a user can get themselves in this situation, throw a UserError. An AssertionError is a mistake in our logic and will be sent to Sentry whereas a UserError won't.

Copy link
Copy Markdown
Member Author

@WalshyDev WalshyDev Aug 30, 2024

Choose a reason for hiding this comment

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

The assertion was just moved from the bottom to fix the type - it probably is something we want in Sentry tbf. Users shouldn't be able to get to the deploy path without an account ID -- we should be prompting or accepting the config value
It is an us issue if neither of those happen

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.

I see, sorry I thought you introduced it. It should've been an UserError already. The config is already considered. It can only be undefined if not specified in args OR config.

);

// Update tail consumers and logpush settings
await patchNonVersionedScriptSettings(accountId, scriptName, {
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.

Can/should we run the deploy and patch requests in parallel?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Since this does a deploy we'd have concurrency issues sadly where they'd try to block on eachother and probably more often than not timeout

@WalshyDev WalshyDev merged commit c4f0d9e into main Aug 30, 2024
@WalshyDev WalshyDev deleted the walshy/versioned-deploy-tail-logpush-update branch August 30, 2024 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants