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

use shell-quote.quote(args) instead of args.join(" ") #4215

Merged
merged 4 commits into from
Oct 23, 2023

Conversation

RamIdeas
Copy link
Contributor

@RamIdeas RamIdeas commented Oct 18, 2023

What this PR solves / how to test:

Follow-up to #4080, prompted by #4211 (comment)

In my previous PR introducing shell-quote, I searched for instances of split(" ") and changed them to shellquote.parse(cmd)

In this PR, I searched for instances of join(" ") and changed them to shellquote.quote(args)

Author has included the following, where applicable:

Reviewer is to perform the following, as 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

Note for PR author:

We want to celebrate and highlight awesome PR review! If you think this PR received a particularly high-caliber review, please assign it the label highlight pr review so future reviewers can take inspiration and learn from it.

@RamIdeas RamIdeas requested review from a team as code owners October 18, 2023 10:45
@changeset-bot
Copy link

changeset-bot bot commented Oct 18, 2023

🦋 Changeset detected

Latest commit: bd08fa0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
create-cloudflare Patch
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

@RamIdeas RamIdeas changed the title use shell-quote.quote(cmd) instead of cmd.join(" ") use shell-quote.quote(args) instead of args.join(" ") Oct 18, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Oct 18, 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/6612943814/npm-package-wrangler-4215

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

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

Or you can use npx with this latest build directly:

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

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


wrangler@3.14.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare 3.20231016.0 3.20231016.0
workerd 1.20231016.0 1.20231016.0
workerd --version 1.20231016.0 2023-10-16

|

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

@@ -43,7 +43,7 @@ describe("generate", () => {
`"✨ Created no-template/wrangler.toml"`
);
expect(std.warn).toMatchInlineSnapshot(`
"▲ [WARNING] The \`init\` command is no longer supported. Please use \`mockpm create cloudflare@2 no-template\` instead.
"▲ [WARNING] The \`init\` command is no longer supported. Please use \`mockpm create cloudflare/@2 no-template\` instead.
Copy link
Contributor Author

@RamIdeas RamIdeas Oct 18, 2023

Choose a reason for hiding this comment

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

something weird is going on with jest snapshot encoding

  • double backslash \\ is changed into a forward slash /
  • this doesn't effect real usage: \\@ is what is actually returned from shell-quote and that works

You can confirm by running wrangler init (with this PRs build) and seeing the C3 command logged out correctly

something weird is going on with jest snapshot encoding
- double backslash \\ is changed into a forward slash /
- this doesn't effect real usage \\@ is what is actually returned from shell-quote and that works
@RamIdeas
Copy link
Contributor Author

Noticed the C3 E2E pnpm test failings with the Nuxt framework. I'm rebasing from main in hopes the test is fixed there

@RamIdeas RamIdeas added the e2e Run e2e tests on a PR label Oct 23, 2023
@codecov
Copy link

codecov bot commented Oct 23, 2023

Codecov Report

Merging #4215 (bd08fa0) into main (d74c35f) will increase coverage by 75.36%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff            @@
##           main    #4215       +/-   ##
=========================================
+ Coverage      0   75.36%   +75.36%     
=========================================
  Files         0      223      +223     
  Lines         0    12259    +12259     
  Branches      0     3171     +3171     
=========================================
+ Hits          0     9239     +9239     
- Misses        0     3020     +3020     
Files Coverage Δ
packages/wrangler/src/init.ts 92.01% <100.00%> (ø)
packages/wrangler/src/utils/shell-quote.ts 85.00% <100.00%> (ø)
packages/wrangler/src/pages/dev.ts 16.26% <50.00%> (ø)

... and 220 files with indirect coverage changes

@RamIdeas RamIdeas merged commit 950bc40 into main Oct 23, 2023
35 of 38 checks passed
@RamIdeas RamIdeas deleted the shell-quote-insteadof-join branch October 23, 2023 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Run e2e tests on a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants