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: fails to publish due to empty migrations #1937

Merged
merged 2 commits into from Sep 28, 2022

Conversation

JacobMGEvans
Copy link
Contributor

The Durable Objects migrations will no longer show in the auto generated config file.

@JacobMGEvans JacobMGEvans added the bug Something that isn't working label Sep 27, 2022
@changeset-bot
Copy link

changeset-bot bot commented Sep 27, 2022

🦋 Changeset detected

Latest commit: 62d2792

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

Comment on lines +2638 to +2660
`/accounts/:accountId/workers/services/:scriptName/environments/:environment/bindings`,
"GET",
() => []
);
setMockResponse(
`/accounts/:accountId/workers/services/:scriptName/environments/:environment/routes`,
"GET",
() => []
);
setMockResponse(
`/accounts/:accountId/workers/services/:scriptName/environments/:environment`,
"GET",
() => mockServiceMetadata.default_environment
);
setMockResponse(
`/accounts/:accountId/workers/scripts/:scriptName/schedules`,
"GET",
() => {
return {
schedules: [],
};
}
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Follow up: I noticed that if these endpoints return anything other than an array, empty or otherwise, it is not handled well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Has this been resolved? Can we handle this better?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently the API returns empty arrays if there is nothing. An API error itself is handled higher up the functionality, before it hits the config generator.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 27, 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/3144516609/npm-package-wrangler-1937

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

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

Or you can use npx with this latest build directly:

npx https://prerelease-registry.developers.workers.dev/runs/3144516609/npm-package-wrangler-1937 dev path/to/script.js
Additional artifacts:
npm install https://prerelease-registry.developers.workers.dev/runs/3144516609/npm-package-cloudflare-pages-shared-1937

@codecov
Copy link

codecov bot commented Sep 27, 2022

Codecov Report

Merging #1937 (62d2792) into main (7ebaec1) will decrease coverage by 0.10%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1937      +/-   ##
==========================================
- Coverage   75.22%   75.12%   -0.11%     
==========================================
  Files         116      116              
  Lines        7907     7931      +24     
  Branches     2057     2067      +10     
==========================================
+ Hits         5948     5958      +10     
- Misses       1959     1973      +14     
Impacted Files Coverage Δ
packages/wrangler/src/init.ts 96.05% <100.00%> (+0.02%) ⬆️
packages/wrangler/src/proxy.ts 16.58% <0.00%> (-1.27%) ⬇️
packages/wrangler/src/config/index.ts 92.30% <0.00%> (+0.55%) ⬆️
...ackages/wrangler/src/__tests__/helpers/mock-bin.ts 100.00% <0.00%> (+5.26%) ⬆️

The Durable Objects migrations will no longer show in the auto generated config file.
@JacobMGEvans JacobMGEvans force-pushed the jacobmgevans/fix-empty-migration-from-dash branch from 61c1734 to 42cfd8d Compare September 28, 2022 13:59
@JacobMGEvans
Copy link
Contributor Author

Oops the Date needs to be mocked.

@JacobMGEvans JacobMGEvans merged commit 905fce4 into main Sep 28, 2022
@JacobMGEvans JacobMGEvans deleted the jacobmgevans/fix-empty-migration-from-dash branch September 28, 2022 17:40
@github-actions github-actions bot mentioned this pull request Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 BUG: A worker set up with init --from-dash fails to publish due to empty migrations
3 participants