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

Build: Add flag to skip nx cache #30433

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open

Build: Add flag to skip nx cache #30433

wants to merge 1 commit into from

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Jan 31, 2025

Closes #

What I did

This PR introduces a flag to skip nx cache.

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-storybook/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 PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

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

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 77.9 MB 77.9 MB 0 B 0.72 0%
initSize 131 MB 131 MB 0 B 2.02 0%
diffSize 53 MB 53 MB 0 B 2.08 0%
buildSize 7.17 MB 7.17 MB 0 B -0.47 0%
buildSbAddonsSize 1.85 MB 1.85 MB 0 B 1.04 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.86 MB 1.86 MB 0 B -0.58 0%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.91 MB 3.91 MB 0 B -0.51 0%
buildPreviewSize 3.27 MB 3.27 MB 0 B -0.45 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 23.5s 7.9s -15s -552ms -1.44 🔰-195%
generateTime 18.3s 19.5s 1.1s -0.44 6%
initTime 11.7s 12.7s 1s -0.5 8.3%
buildTime 7.8s 9s 1.1s -0.25 12.7%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 5.5s 5.8s 387ms 0.27 6.6%
devManagerResponsive 4s 4.5s 508ms 0.5 11.2%
devManagerHeaderVisible 820ms 762ms -58ms 0.43 -7.6%
devManagerIndexVisible 909ms 771ms -138ms 0.17 -17.9%
devStoryVisibleUncached 1.9s 3.4s 1.4s 0.76 42.7%
devStoryVisible 909ms 792ms -117ms 0.26 -14.8%
devAutodocsVisible 741ms 771ms 30ms 0.85 3.9%
devMDXVisible 697ms 681ms -16ms 0.34 -2.3%
buildManagerHeaderVisible 759ms 697ms -62ms -0.11 -8.9%
buildManagerIndexVisible 866ms 831ms -35ms 0 -4.2%
buildStoryVisible 692ms 687ms -5ms -0.08 -0.7%
buildAutodocsVisible 607ms 671ms 64ms -0.13 9.5%
buildMDXVisible 597ms 677ms 80ms 0.81 11.8%

Greptile Summary

Based on the provided information, I'll create a concise summary of the PR changes focusing on the addition of the NX cache skip functionality:

Added a new skipCache flag to bypass NX caching during Storybook builds, with implementation in core task runner scripts.

  • Added skipCache boolean option in scripts/task.ts with description "Skip NX remote cache"
  • Modified compile commands in scripts/tasks/compile.ts to append --skip-nx-cache when flag is enabled
  • Integrated flag into both link and no-link command variants for consistent behavior
  • Implementation lacks documentation updates and test coverage for verifying cache bypass functionality
  • No migration notes provided for this new feature

The changes are focused on build optimization but would benefit from additional documentation and testing to ensure proper usage and reliability.

@yannbf yannbf added build Internal-facing build tooling & test updates ci:normal labels Jan 31, 2025
@yannbf yannbf self-assigned this Jan 31, 2025
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.

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

Comment on lines +162 to +166
skipCache: {
type: 'boolean',
description: 'Skip NX remote cache?',
promptType: false,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: The skipCache option is added but not used anywhere in the task execution code. Need to implement the actual cache skipping logic.

Copy link

nx-cloud bot commented Jan 31, 2025

View your CI Pipeline Execution ↗ for commit 4aec7ef.

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 1m 53s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-31 16:35:27 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Internal-facing build tooling & test updates ci:normal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant