Skip to content

Build: Disable yarn npmMinimalAgeGate inside sandboxes#34846

Merged
valentinpalkovic merged 1 commit into
storybookjs:nextfrom
valentinpalkovic:valentin/yarn-npm-minimal-age-gate-disable
May 20, 2026
Merged

Build: Disable yarn npmMinimalAgeGate inside sandboxes#34846
valentinpalkovic merged 1 commit into
storybookjs:nextfrom
valentinpalkovic:valentin/yarn-npm-minimal-age-gate-disable

Conversation

@valentinpalkovic
Copy link
Copy Markdown
Contributor

@valentinpalkovic valentinpalkovic commented May 20, 2026

Summary

Yarn 4.15.0 enables npmMinimalAgeGate: 1d by default (yarnpkg/berry#7135), which quarantines freshly-published packages from the local Verdaccio registry and breaks every sandbox build on next:

SB_CLI_0002 (MinimumReleaseAgeHandledError): yarn blocked package installation
because your project uses npmMinimalAgeGate.

Failed package: create-storybook@10.5.0-alpha.0

This PR is a minimal, fast-track unblock for the team: set npmMinimalAgeGate 0 in the sandbox yarn config (scripts/utils/yarn.ts → installYarn2) so freshly-published packages from the local Verdaccio registry aren't quarantined.

A follow-up PR (#34842) replaces this with the proper preapproval-based approach (7-day gate for unknown third-party packages, monorepo + satellite packages preapproved). This PR exists so we can ship the unblock immediately without waiting for that one to go green.

Test plan

  • CI sandbox creation succeeds on previously-failing templates (e.g. lit-vite/default-ts)
  • Locally: yarn task sandbox --template react-vite/default-ts --start-from auto completes without YN0016

Summary by CodeRabbit

  • Chores
    • Updated Yarn configuration to improve installation compatibility and stability.

Review Change Stack

Yarn 4.15.0 enables `npmMinimalAgeGate: 1d` by default, which quarantines
freshly-published packages from the local Verdaccio registry and breaks
sandbox creation:

    YN0016: create-storybook@npm:10.5.0-alpha.0: All versions satisfying
    "10.5.0-alpha.0" are quarantined

Set `npmMinimalAgeGate 0` in the sandbox yarn config to unblock the team
while a more targeted preapproval-based fix is being worked on.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3081a879-7f0d-4a95-85bc-1a7434a8c6d5

📥 Commits

Reviewing files that changed from the base of the PR and between b15652a and da37018.

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

📝 Walkthrough

Walkthrough

This PR modifies scripts/utils/yarn.ts to configure Yarn Berry's npmMinimalAgeGate setting. The installYarn2 function now explicitly sets npmMinimalAgeGate 0 before running the Yarn installation command, disabling the default npm minimal age gate quarantine behavior for freshly published packages in Storybook sandboxes.

Changes

Yarn Configuration

Layer / File(s) Summary
Yarn npmMinimalAgeGate configuration
scripts/utils/yarn.ts
installYarn2 adds yarn config set npmMinimalAgeGate 0 with inline documentation explaining it disables npm package age gating in Yarn 4.15.0 for sandbox environments.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • storybookjs/storybook#32551: Modifies the same installYarn2 function in scripts/utils/yarn.ts to address npm package availability issues in Storybook sandboxes (removes .yarnrc.yml file).

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

@valentinpalkovic valentinpalkovic self-assigned this May 20, 2026
@valentinpalkovic valentinpalkovic added ci:normal maintenance User-facing maintenance tasks build Internal-facing build tooling & test updates and removed maintenance User-facing maintenance tasks labels May 20, 2026
@valentinpalkovic valentinpalkovic moved this to In Progress in Core Team Projects May 20, 2026
@storybook-app-bot
Copy link
Copy Markdown

storybook-app-bot Bot commented May 20, 2026

Package Benchmarks

Commit: da37018, ran on 21 May 2026 at 14:26:08 UTC

The following packages have significant changes to their size or dependencies:

storybook

Before After Difference
Dependency count 72 72 0
Self size 20.25 MB 20.30 MB 🚨 +50 KB 🚨
Dependency size 36.17 MB 36.17 MB 0 B
Bundle Size Analyzer Link Link

@storybook/cli

Before After Difference
Dependency count 203 203 0
Self size 908 KB 908 KB 🎉 -931 B 🎉
Dependency size 87.56 MB 87.61 MB 🚨 +50 KB 🚨
Bundle Size Analyzer Link Link

@storybook/codemod

Before After Difference
Dependency count 196 196 0
Self size 32 KB 32 KB 🚨 +36 B 🚨
Dependency size 86.05 MB 86.10 MB 🚨 +50 KB 🚨
Bundle Size Analyzer Link Link

create-storybook

Before After Difference
Dependency count 73 73 0
Self size 1.08 MB 1.08 MB 🎉 -222 B 🎉
Dependency size 56.43 MB 56.48 MB 🚨 +50 KB 🚨
Bundle Size Analyzer node node

@valentinpalkovic valentinpalkovic merged commit 630f521 into storybookjs:next May 20, 2026
136 of 147 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Core Team Projects May 20, 2026
@github-actions github-actions Bot mentioned this pull request May 20, 2026
13 tasks
@github-actions github-actions Bot mentioned this pull request May 21, 2026
29 tasks
@valentinpalkovic valentinpalkovic added the patch:yes Bugfix & documentation PR that need to be picked to main branch label May 21, 2026
@github-actions github-actions Bot mentioned this pull request May 21, 2026
14 tasks
@github-actions github-actions Bot added the patch:done Patch/release PRs already cherry-picked to main/release branch label May 22, 2026
RuBrock pushed a commit to RuBrock/storybook that referenced this pull request May 23, 2026
…arn-npm-minimal-age-gate-disable

Build: Disable yarn npmMinimalAgeGate inside sandboxes
(cherry picked from commit 630f521)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-scan:human build Internal-facing build tooling & test updates ci:normal patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants