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

[C3] Skip empty summary rows #5483

Merged
merged 4 commits into from
Apr 21, 2024
Merged

Conversation

DaniFoldi
Copy link
Contributor

@DaniFoldi DaniFoldi commented Apr 2, 2024

What this PR solves / how to test

Hi 👋,

Before getting side-tracked with #5482, I found that when using . as the project location, there was nowhere to cd to, so the first line in the next steps output summary was skipped. Instead of being properly skipped, undefined undefined was printed (see screenshot). This change should skip over these lines where a step is excluded.

image

Author has addressed the following

@DaniFoldi DaniFoldi requested a review from a team as a code owner April 2, 2024 20:33
Copy link

changeset-bot bot commented Apr 2, 2024

🦋 Changeset detected

Latest commit: 200ae27

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

This PR includes changesets to release 1 package
Name Type
create-cloudflare 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

Copy link
Contributor

github-actions bot commented Apr 2, 2024

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/8580168313/npm-package-wrangler-5483

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

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

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8580168313/npm-package-wrangler-5483 dev path/to/script.js
Additional artifacts:
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8580168313/npm-package-create-cloudflare-5483 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8580168313/npm-package-cloudflare-kv-asset-handler-5483
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8580168313/npm-package-miniflare-5483
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8580168313/npm-package-cloudflare-pages-shared-5483
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8580168313/npm-package-cloudflare-vitest-pool-workers-5483

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


wrangler@3.48.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20240404.0
workerd 1.20240404.0 1.20240404.0
workerd --version 1.20240404.0 2024-04-04

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

Copy link

codecov bot commented Apr 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.49%. Comparing base (80b8fcb) to head (200ae27).
Report is 29 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5483      +/-   ##
==========================================
+ Coverage   72.28%   72.49%   +0.21%     
==========================================
  Files         330      331       +1     
  Lines       16990    17298     +308     
  Branches     4325     4422      +97     
==========================================
+ Hits        12281    12541     +260     
- Misses       4709     4757      +48     

see 62 files with indirect coverage changes

@dario-piotrowicz
Copy link
Member

Hi @DaniFoldi 😄👋

Thanks a lot for the fix 🙂

but I feel like the change is not the right solution, I think that instead of filtering the thing out we should just not add it in the summary in the first place

I think that this code is slightly off:

dirRelativePath
? ["Navigate to the new directory", `cd ${dirRelativePath}`]
: [],

And changing it in the following way should fix the issue:

 
        const dirRelativePath = relative(ctx.originalCWD, ctx.project.path);
        const nextSteps = [
-               dirRelativePath
-                       ? ["Navigate to the new directory", `cd ${dirRelativePath}`]
-                       : [],
+               ...(dirRelativePath
+                       ? [["Navigate to the new directory", `cd ${dirRelativePath}`]]
+                       : []),
                [
                        "Run the development server",
                        quoteShellArgs([npm, "run", ctx.template.devScript ?? "start"]),

what do you think? 🙂

@DaniFoldi
Copy link
Contributor Author

Hey @dario-piotrowicz,

Thanks, good idea! I've pushed a new commit changing it to your suggestion, I agree it's cleaner. Looked at the option of adding an explicit type annotation to prevent future issues, but ts couldn't validate all of them as [string, string][], so it was going to require more type assertions than I'd be comfortable with for such a small change.

Copy link
Member

@dario-piotrowicz dario-piotrowicz left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks a bunch @DaniFoldi ❤️ 🙂

.changeset/quick-cheetahs-attack.md Outdated Show resolved Hide resolved
@dario-piotrowicz
Copy link
Member

Thanks, good idea! I've pushed a new commit changing it to your suggestion, I agree it's cleaner. Looked at the option of adding an explicit type annotation to prevent future issues, but ts couldn't validate all of them as [string, string][], so it was going to require more type assertions than I'd be comfortable with for such a small change.

yeah I agree, if it's going to add unnecessary complexity it doesn't really feel worth it 🙂

Co-authored-by: Dario Piotrowicz <dario.piotrowicz@gmail.com>
@petebacondarwin petebacondarwin self-assigned this Apr 21, 2024
@petebacondarwin petebacondarwin merged commit a55314c into cloudflare:main Apr 21, 2024
17 of 25 checks passed
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.

4 participants