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

fix: only send durable object migrations when required #728

Merged
merged 1 commit into from
Mar 31, 2022

Conversation

threepointone
Copy link
Contributor

We had a bug where even if you'd published a script with migrations, we would still send a blank set of migrations on the next round. The api doesn't accept this, so the fix is to not do so. I also expanded test coverage for migrations.

Fixes #705


This is the first in a set of a few PRs I'll send for durable objects. Next, more validations based on exports.

@changeset-bot
Copy link

changeset-bot bot commented Mar 30, 2022

🦋 Changeset detected

Latest commit: 47ed919

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

@github-actions
Copy link
Contributor

github-actions bot commented Mar 30, 2022

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

npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/2071558805/npm-package-wrangler-728

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

npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/728/npm-package-wrangler-728

Or you can use npx with this latest build directly:

npx https://prerelease-registry.developers.workers.dev/runs/2071558805/npm-package-wrangler-728 dev path/to/script.js

).length > 0 &&
config.migrations.length === 0
) {
console.warn(
Copy link
Contributor Author

@threepointone threepointone Mar 30, 2022

Choose a reason for hiding this comment

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

This is a warning and not an error because folks may have purposely deleted the [migrations] section from their wrangler.toml altogether. That's not great, but it's not something we can prevent.

@threepointone
Copy link
Contributor Author

I'm going to remove the exports validation from this PR and send it in the next one

@threepointone
Copy link
Contributor Author

Ok done, this is ready for review.

packages/wrangler/src/dev/dev.tsx Outdated Show resolved Hide resolved
packages/wrangler/src/publish.ts Outdated Show resolved Hide resolved
packages/wrangler/src/publish.ts Outdated Show resolved Hide resolved
We had a bug where even if you'd published a script with migrations, we would still send a blank set of migrations on the next round. The api doesn't accept this, so the fix is to not do so. I also expanded test coverage for migrations.

Fixes #705
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.

Ship it!

@petebacondarwin petebacondarwin merged commit 0873049 into main Mar 31, 2022
@petebacondarwin petebacondarwin deleted the durable-envs branch March 31, 2022 17:00
@github-actions github-actions bot mentioned this pull request Mar 31, 2022
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.

🐛 BUG: nonactionable error about migration
2 participants