Skip to content

Sandboxes: Fix yarn utility#32551

Merged
ndelangen merged 4 commits into
nextfrom
norbert/improve-sandboxes-yarn-script
Sep 24, 2025
Merged

Sandboxes: Fix yarn utility#32551
ndelangen merged 4 commits into
nextfrom
norbert/improve-sandboxes-yarn-script

Conversation

@ndelangen
Copy link
Copy Markdown
Member

@ndelangen ndelangen commented Sep 24, 2025

What I did

During assisting @gossi with getting Storybook for Ember back on track, we discovered that the sandboxes contains a .yarnrc.yml file which points to a non-existent path.

Somehow that's never been a problem, but somehow it was on his.

Deleting the file solves it.

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>

Summary by CodeRabbit

  • Bug Fixes
    • Yarn 2 installation is now more reliable: the process automatically removes any legacy .yarnrc.yml before installing, preventing config conflicts and setup failures.
    • Runs silently with no required user action, ensuring smoother installs and re-runs in local and CI environments. No behavior changes to commands or outputs.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Sep 24, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The change updates scripts/utils/yarn.ts to unconditionally remove .yarnrc.yml before installing Yarn 2. An rm import from node:fs/promises is added and invoked at the start of installYarn2 with { force: true } and a .catch(() => {}) to treat absence as a no-op. This deletion runs before the rest of the Yarn 2 installation logic. No public exports or function signatures were modified.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Caller
    participant Y as installYarn2 (scripts/utils/yarn.ts)
    participant FS as rm(".yarnrc.yml")
    participant I as Yarn v2 Installer

    Caller->>Y: invoke installYarn2()
    rect rgba(200, 230, 255, 0.30)
    note right of Y: Pre-install cleanup (new)
    Y->>FS: rm(join(cwd, '.yarnrc.yml'), { force: true })
    FS-->>Y: resolve (no-op if absent)
    end
    Y->>I: proceed with Yarn 2 installation
    I-->>Y: installation complete
    Y-->>Caller: resolve
Loading

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Sandboxes: Fix yarn utility" succinctly and accurately describes the primary change shown in the diff (an update to scripts/utils/yarn.ts to fix the yarn utility by removing .yarnrc.yml before installing Yarn 2). It is concise, specific to the change, and understandable to a reviewer scanning PR history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9dcda7b and 90f8bd8.

📒 Files selected for processing (1)
  • scripts/utils/yarn.ts (2 hunks)

Comment @coderabbitai help to get the list of available commands and usage tips.

@ndelangen ndelangen added build Internal-facing build tooling & test updates ci:docs Run the CI jobs for documentation checks only. labels Sep 24, 2025
@ndelangen ndelangen self-assigned this Sep 24, 2025
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6b9ff97 and 9dcda7b.

📒 Files selected for processing (1)
  • scripts/utils/yarn.ts (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: docs
  • GitHub Check: Danger JS
  • GitHub Check: Core Unit Tests, windows-latest
🔇 Additional comments (1)
scripts/utils/yarn.ts (1)

1-1: LGTM: Use native fs.rm

Importing rm from node:fs/promises is appropriate here.

Comment thread scripts/utils/yarn.ts Outdated
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Sep 24, 2025

View your CI Pipeline Execution ↗ for commit 90f8bd8

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

☁️ Nx Cloud last updated this comment at 2025-09-24 15:18:45 UTC

@ndelangen ndelangen merged commit b6e340a into next Sep 24, 2025
8 of 9 checks passed
@ndelangen ndelangen deleted the norbert/improve-sandboxes-yarn-script branch September 24, 2025 14:56
@github-actions github-actions Bot mentioned this pull request Sep 24, 2025
18 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Oct 6, 2025
8 tasks
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:docs Run the CI jobs for documentation checks only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant