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

Add new invalid sb base dir error message and validator function #921

Merged

Conversation

andrewortwein
Copy link
Contributor

@andrewortwein andrewortwein commented Feb 13, 2024

We will now check if the storybookBaseDir is valid before letting the build continue. If it is not defined but needs to be, or is defined but does not point to the correct location, the build will fail and an error will be displayed.

QA

  1. Use an app that has TurboSnap enabled
  2. Commit a visual change
  3. Using the canary build, run a build with --only-changed and an invalid --storybook-base-dir
    • e.g. npx chromatic@<CANARY_VERSION> --only-changed --storybook-base-dir "src/foobar"
  4. Verify that the build fails with an error message indicating that the Storybook base dir is invalid
    • Prior to this change, the build would complete successfully, incorrectly detecting no visual changes
📦 Published PR as canary version: 12.0.0--canary.921.8007225252.0

✨ Test out this PR locally via:

npm install chromatic@12.0.0--canary.921.8007225252.0
# or 
yarn add chromatic@12.0.0--canary.921.8007225252.0

@andrewortwein andrewortwein marked this pull request as ready for review February 15, 2024 02:28
@andrewortwein
Copy link
Contributor Author

@ghengeveld some unrelated tests are now breaking because of the check I put in upload.ts. Am I making assumptions about stats.modules that might not always be true?

Copy link
Member

@ghengeveld ghengeveld left a comment

Choose a reason for hiding this comment

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

Nice. Needs a little work to safeguard performance but otherwise looks good.

node-src/tasks/upload.ts Outdated Show resolved Hide resolved
node-src/lib/checkStorybookBaseDir.ts Outdated Show resolved Hide resolved
node-src/lib/checkStorybookBaseDir.ts Outdated Show resolved Hide resolved
node-src/ui/messages/errors/invalidStorybookBaseDir.ts Outdated Show resolved Hide resolved
node-src/ui/messages/errors/missingStorybookBaseDir.ts Outdated Show resolved Hide resolved
node-src/lib/checkStorybookBaseDir.test.ts Outdated Show resolved Hide resolved
Copy link
Member

@thafryer thafryer left a comment

Choose a reason for hiding this comment

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

LGTM

node-src/lib/checkStorybookBaseDir.ts Outdated Show resolved Hide resolved
node-src/lib/checkStorybookBaseDir.ts Outdated Show resolved Hide resolved
@ethriel3695 ethriel3695 added release Auto: Create a `latest` release when merged major Auto: Increment the major version when merged labels Feb 22, 2024
@andrewortwein andrewortwein added this pull request to the merge queue Feb 22, 2024
Merged via the queue into main with commit ae81b71 Feb 22, 2024
21 of 23 checks passed
@andrewortwein andrewortwein deleted the andrew/ap-4211-cli-block-turbosnap-builds-with-misconfigured branch February 22, 2024 15:47
@ghengeveld
Copy link
Member

🚀 PR was released in v11.0.0 🚀

@ghengeveld ghengeveld added the released Verdict: This issue/pull request has been released label Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major Auto: Increment the major version when merged release Auto: Create a `latest` release when merged released Verdict: This issue/pull request has been released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants