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

Addon Test: Improve postinstall script #29479

Merged
merged 3 commits into from
Oct 30, 2024
Merged

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Oct 29, 2024

Closes #

What I did

This PR achieves a few things:

  • Add box on the “addon interactions exists” error in addon test postinstall:
    image
  • Respect --config-dir flag in postinstall
  • Make postinstall fail if Vitest is < 2.1.0
  • Move addon interactions check down
  • Changes a few wordings

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This pull request has been released as version 0.0.0-pr-29479-sha-9aac063c. Try it out in a new sandbox by running npx [email protected] sandbox or in an existing project with npx [email protected] upgrade.

More information
Published version 0.0.0-pr-29479-sha-9aac063c
Triggered by @yannbf
Repository storybookjs/storybook
Branch yann/addon-test-postinstall-fixes
Commit 9aac063c
Datetime Wed Oct 30 09:58:12 UTC 2024 (1730282292)
Workflow run 11590829067

To request a new release of this pull request, mention the @storybookjs/core team.

core team members can create a new canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=29479

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 77.7 MB 77.7 MB 0 B 1 0%
initSize 143 MB 143 MB -34 B -0.99 0%
diffSize 65.1 MB 65.1 MB -34 B -1 0%
buildSize 6.87 MB 6.87 MB 0 B 1.1 0%
buildSbAddonsSize 1.51 MB 1.51 MB 0 B 1 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.9 MB 1.9 MB 0 B 1.11 0%
buildSbPreviewSize 271 kB 271 kB 0 B - 0%
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.88 MB 3.88 MB 0 B 1.1 0%
buildPreviewSize 3 MB 3 MB 0 B - 0%
testBuildSize 0 B 0 B 0 B - -
testBuildSbAddonsSize 0 B 0 B 0 B - -
testBuildSbCommonSize 0 B 0 B 0 B - -
testBuildSbManagerSize 0 B 0 B 0 B - -
testBuildSbPreviewSize 0 B 0 B 0 B - -
testBuildStaticSize 0 B 0 B 0 B - -
testBuildPrebuildSize 0 B 0 B 0 B - -
testBuildPreviewSize 0 B 0 B 0 B - -
name before after diff z %
createTime 8.8s 23.6s 14.8s 1.41 🔺62.8%
generateTime 26s 24.1s -1s -914ms 0.76 -7.9%
initTime 18.5s 15.5s -3s -12ms -0.04 -19.3%
buildTime 8s 9s 962ms -0.39 10.7%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 6s 6.1s 103ms -0.8 1.7%
devManagerResponsive 3.9s 3.8s -84ms -0.85 -2.2%
devManagerHeaderVisible 654ms 664ms 10ms 0.06 1.5%
devManagerIndexVisible 720ms 742ms 22ms 0.1 3%
devStoryVisibleUncached 1.2s 1.2s -68ms 0.05 -5.6%
devStoryVisible 717ms 739ms 22ms 0.17 3%
devAutodocsVisible 640ms 656ms 16ms 0.42 2.4%
devMDXVisible 577ms 586ms 9ms -0.06 1.5%
buildManagerHeaderVisible 765ms 685ms -80ms 0.48 -11.7%
buildManagerIndexVisible 777ms 696ms -81ms 0.41 -11.6%
buildStoryVisible 758ms 683ms -75ms 0.52 -11%
buildAutodocsVisible 568ms 543ms -25ms -0.01 -4.6%
buildMDXVisible 616ms 495ms -121ms -0.4 -24.4%

Greptile Summary

Here's my concise review of the changes to the postinstall script for the Storybook addon test:

Improves the postinstall script for the addon test with better error handling, dependency checks, and configuration generation.

  • Enforces Vitest version >= 2.1.0 with proper version checking and error messaging
  • Moves addon-interactions compatibility check after prerequisite validation to avoid unnecessary prompts
  • Adds proper handling of configDir option when generating Vitest config files
  • Fixes relative path handling for setup files in Vitest configs
  • Improves UX with clearer error messages and formatted output boxes

The changes focus on making the installation process more robust and user-friendly while ensuring proper configuration of the testing environment.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

return addonName.includes(addonInteractionsName);
});

if (!!interactionsAddon) {
Copy link
Contributor

Choose a reason for hiding this comment

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

style: double negation could be simplified to just if (interactionsAddon)

@yannbf yannbf changed the title Improve postinstall script for addon test Addon Test: Improve postinstall script Oct 29, 2024
Copy link

nx-cloud bot commented Oct 29, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 9aac063. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@yannbf yannbf merged commit ed1ea98 into next Oct 30, 2024
60 checks passed
@yannbf yannbf deleted the yann/addon-test-postinstall-fixes branch October 30, 2024 11:04
@github-actions github-actions bot mentioned this pull request Oct 30, 2024
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant