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]: fix missing error on failed d1 migrations #3124

Merged

Conversation

verokarhu
Copy link
Contributor

@verokarhu verokarhu commented May 2, 2023

Fixes #2358.

What this PR solves / how to test:

Returns error code from failed d1 migrations.

Associated docs issue(s)/PR(s):

Author has included the following, where applicable:

Reviewer has performed the following, where 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

@verokarhu verokarhu requested a review from a team as a code owner May 2, 2023 19:26
@changeset-bot
Copy link

changeset-bot bot commented May 2, 2023

🦋 Changeset detected

Latest commit: 69e4f85

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

@verokarhu verokarhu force-pushed the return-error-on-failed-d1-migrations branch from dffad5c to 5a19379 Compare May 3, 2023 06:35
@verokarhu verokarhu requested a review from Skye-31 May 4, 2023 17:42
@Skye-31
Copy link
Contributor

Skye-31 commented May 4, 2023

I'm not actually a maintainer, just someone pretty familiar with the repo 😅
Looks good as far as I can tell though!

@github-actions
Copy link
Contributor

github-actions bot commented May 5, 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/5119831012/npm-package-wrangler-3124

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

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

Or you can use npx with this latest build directly:

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

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

@codecov
Copy link

codecov bot commented May 5, 2023

Codecov Report

Merging #3124 (69e4f85) into main (c32f514) will increase coverage by 0.58%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3124      +/-   ##
==========================================
+ Coverage   74.83%   75.42%   +0.58%     
==========================================
  Files         179      182       +3     
  Lines       10813    11063     +250     
  Branches     2853     2902      +49     
==========================================
+ Hits         8092     8344     +252     
+ Misses       2721     2719       -2     
Impacted Files Coverage Δ
packages/wrangler/src/d1/migrations/helpers.ts 94.64% <ø> (ø)
packages/wrangler/src/d1/migrations/apply.tsx 57.77% <40.00%> (-1.53%) ⬇️
packages/wrangler/src/d1/execute.tsx 55.10% <66.66%> (-2.15%) ⬇️

... and 52 files with indirect coverage changes

rozenmd
rozenmd previously approved these changes May 24, 2023
@rozenmd rozenmd dismissed their stale review May 24, 2023 16:37

Didn't mean to approve

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.

We do set the exit code directly in other parts of Wrangler but that is probably not ideal.

packages/wrangler/src/d1/migrations/apply.tsx Outdated Show resolved Hide resolved
@petebacondarwin
Copy link
Contributor

LGTM.

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: wrangler d1 migrations apply fails with the incorrect exit code
5 participants