-
Notifications
You must be signed in to change notification settings - Fork 790
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: create d1 dir on wrangler d1 execute command with --yes/-y option #2623
fix: create d1 dir on wrangler d1 execute command with --yes/-y option #2623
Conversation
🦋 Changeset detectedLatest commit: 240c1b2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
1b23117
to
15f29e9
Compare
15f29e9
to
240c1b2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Codecov Report
@@ Coverage Diff @@
## main #2623 +/- ##
==========================================
- Coverage 73.19% 73.19% -0.01%
==========================================
Files 159 159
Lines 9847 9848 +1
Branches 2622 2624 +2
==========================================
Hits 7208 7208
- Misses 2639 2640 +1
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The confirm
infers automation environments, CI/CD, non-TTY, etc... Then does an automatic skip of prompts. Is there another reason besides those for this flag?
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/runs/4006950162/npm-package-wrangler-2623 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/prs/2623/npm-package-wrangler-2623 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/runs/4006950162/npm-package-wrangler-2623 dev path/to/script.js Additional artifacts:npm install https://prerelease-registry.devprod.cloudflare.dev/runs/4006950162/npm-package-cloudflare-pages-shared-2623 |
the same as |
@JacobMGEvans yeah that's like @rozenmd mentioned, specifically I have some d1 apps I want to share, they have a but yeah it boils down to the fact that I am providing the command to execute and I know that it's going to create the db, there is no reason to ask me (of the devs I share the apps with) to confirm |
Thank you for the elaboration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the clarification that this is more to handle User workflows and not automation environments, the implementation makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs an associated Uses preexisting --yes flagcloudflare-docs
PR
Any particular reason there isn't a test, like it's hard to test?
@JacobMGEvans no it doesn't? it's a bug fix |
Ah I see you're using an existing top --yes not adding one for the fix. Not sure why I thought it was adding one 😆 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a simple fix, if we can write a test that covers the scenario that was previously breaking to help prevent the same bug or similar in the future that would be awesome 😃
!shouldPrompt || | ||
(await confirm(`About to create ${readableRelative(dbPath)}, ok?`)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we please get a test that covers the bug, for posterity 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I considered that and asked @rozenmd about it, if I understood correctly he did mention that there isn't a proper test suite for d1 commands and that we could go with the fix as is.
If you want I could look into adding a test now but I'd have to set up the test suite (to some degree at least) I guess but since I am not familiar with things in this codebase nor I am really involved in d1 I'd imagine that it would be better for someone else to start (and I can add the test at that point?).
or I can give it a shot now if you think that'd be ok, I would be up for it 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I considered that and asked @rozenmd about it, if I understood correctly he did mention that there isn't a proper test suite for d1 commands and that we could go with the fix as is.
If you want I could look into adding a test now but I'd have to set up the test suite (to some degree at least) I guess but since I am not familiar with things in this codebase nor I am really involved in d1 I'd imagine that it would be better for someone else to start (and I can add the test at that point?).
or I can give it a shot now if you think that'd be ok, I would be up for it 🙂
If you are willing to try, I am willing to help as well. Anything we both can't figure out we can kick towards Max 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally if you want to just get this fix in and do a fast follow Test PR (since none previously existed) I would support that in this particular case given the circumstances.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah sorry, I just now say the comment about merging the PR anyways, thanks 🙂👍
Additionally if you want to just get this fix in and do a fast follow Test PR (since none previously existed) I would support that in this particular case given the circumstances.
What this PR solves / how to test:
Associated docs issues/PR:
Author has included the following, where applicable:
Reviewer has performed the following, where applicable:
Fixes # [insert issue number].