Skip to content

Build: Sanitize publish-time .yarnrc.yml in after-storybook sandboxes#34851

Draft
valentinpalkovic wants to merge 1 commit into
nextfrom
valentin/sandbox-publish-yarnrc-filter
Draft

Build: Sanitize publish-time .yarnrc.yml in after-storybook sandboxes#34851
valentinpalkovic wants to merge 1 commit into
nextfrom
valentin/sandbox-publish-yarnrc-filter

Conversation

@valentinpalkovic
Copy link
Copy Markdown
Contributor

Summary

Strip Verdaccio / host-local Yarn settings from */after-storybook/.yarnrc.yml before the sandbox tree is pushed to storybookjs/sandboxes. Drop install artifacts (.yarn/cache, node_modules, .pnp.cjs, storybook-static, etc.) from the published copy.

This is Phase 1 of the agreed sandbox-yarn-quarantine plan: ship the supply-chain-leak fix (consumers should not inherit npmRegistryServer: http://localhost:6001/, npmMinimalAgeGate: 0, or other Verdaccio bootstrap settings) without requiring the larger Yarn 4 migration. Phase 0 already shipped via #34846; Phase 2 (Yarn 4 + before-storybook lockfile commit + post-bootstrap yarn up) follows in #STACKED.

What's stripped from after-storybook/.yarnrc.yml

Key Why
npmRegistryServer Points at localhost:6001
unsafeHttpWhitelist Verdaccio-local; security regression if leaked
enableImmutableInstalls Bootstrap setting
enableMirror Verdaccio-local
logFilters CI-noise suppression
npmMinimalAgeGate Host policy
pnpFallbackMode Bootstrap convenience
enableGlobalCache Host-local cache perf
checksumBehavior Local convenience

What's excluded from the published copy

.yarn/cache/**, .yarn/install-state.gz, .yarn/build-state.yml, .yarn/unplugged/**, .pnp.cjs, .pnp.loader.mjs, node_modules/**, .cache/**, storybook-static/**

What's intentionally NOT touched

  • before-storybook/.yarnrc.yml — that's the user-facing Yarn setup we want consumers to reproduce.
  • before-storybook/yarn.lock — Phase 2 will commit these to the sandboxes repo for reproducibility.
  • After-storybook lockfile / yarn config (beyond the strip list) — left as the current shape; full Yarn 4 migration is Phase 2.

Test plan

  • Unit tests for STRIP_KEYS integrity, EXCLUDE_GLOBS integrity, before-storybook untouched, idempotency (7 tests passing locally)
  • CI sandbox publish runs cleanly against storybookjs/sandboxes
  • Manually verify a published sandbox in Stackblitz still installs (grep for localhost:6001 in committed .yarnrc.yml → expect zero)

Strip Verdaccio / host-local Yarn settings (npmRegistryServer pointing at
localhost:6001, unsafeHttpWhitelist, enableImmutableInstalls, logFilters,
npmMinimalAgeGate, etc.) from `*\/after-storybook\/.yarnrc.yml` before the
sandbox tree is pushed to `storybookjs/sandboxes`. Also drop install
artifacts (`.yarn/cache`, `node_modules`, `.pnp.cjs`, `storybook-static`)
from the published copy.

`before-storybook/.yarnrc.yml` is intentionally untouched — its contents
are the user-facing Yarn setup we want consumers to reproduce.

Includes a regression test asserting the exact STRIP_KEYS / EXCLUDE_GLOBS
contracts so mutations require a deliberate review.
@github-actions
Copy link
Copy Markdown
Contributor

Fails
🚫

PR is not labeled with one of: ["cleanup","BREAKING CHANGE","feature request","bug","documentation","maintenance","build","dependencies"]

🚫

PR is not labeled with one of: ["ci:normal","ci:merged","ci:daily","ci:docs"]

🚫 PR description is missing the mandatory "#### Manual testing" section. Please add it so that reviewers know how to manually test your changes.

Generated by 🚫 dangerJS against a938d7f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant