Skip to content

Default-deny npm lifecycle scripts; add release cooldown (.npmrc) - #2760

Merged
chalin merged 12 commits into
docsy:mainfrom
chalin:chalin-m24-ignore-scripts-2026-0829
Aug 29, 2026
Merged

chalin merged 12 commits into
docsy:mainfrom
chalin:chalin-m24-ignore-scripts-2026-0829

Conversation

@chalin

@chalin chalin commented Aug 29, 2026 •

Copy link
Copy Markdown
Collaborator
  • Closes the last script-enabled install path, contributor installs: CI, Netlify, and install:safe already install script-less; the theme's own pack lifecycle stays explicitly re-enabled at both pack call sites, so publish and the pack contract are unaffected.
  • Adds the npm-side release cooldown, matching Renovate's: a vulnerability-alert lock bump inside the window now fails until the release ages; maintainer notes document the deliberate env override for fixes that can't wait.
  • Repoints .npmrc rationale at the otel.io supply-chain design page, the cross-repo home for these controls; only docsy-specific notes stay inline.

- Closes the one residual script-enabled path, contributor installs: CI, Netlify, and install:safe already install script-less, and both own-pack call sites re-enable the theme pack lifecycle explicitly
- Aligns the npm-side cooldown with Renovate's minimumReleaseAge
- Points .npmrc rationale at the otel.io supply-chain design page, the cross-repo one-home; keeps only docsy-specific notes inline
- Updates the audit's .npmrc pin red-first (bare npm ci leaves hugo unbuilt; install:safe restores it; pack contract stays green)
@chalin chalin added this to the 0.17.0 milestone Aug 29, 2026
@chalin
chalin marked this pull request as ready for review August 29, 2026 14:32
@chalin chalin changed the title Commit ignore-scripts=true and min-release-age=7 in .npmrc ci(.npmrc): set ignore-scripts=true and min-release-age=7 Aug 29, 2026
- Documents that npm's cooldown now gates vulnerability-alert lock bumps, with the per-invocation env override as the emergency path
- Moves the audit comment's detection story to where detection now lives: scripts-enabled installs and the inventory assertion (behavior probed: plain npm ci skips the strict preflight; the rebuild path stays fail-closed)
@chalin chalin changed the title ci(.npmrc): set ignore-scripts=true and min-release-age=7 Default-deny npm lifecycle scripts; add release cooldown (.npmrc) Aug 29, 2026
chalin added 10 commits August 29, 2026 11:55
- _sync:theme-lock resolves under --prefix, which reads no root .npmrc: carry the cooldown as a CLI flag (probed: without it, a 0-day release locks; with it, resolution picks the aged version)
- Attributes the cooldown-gates-alert-bumps claim to Renovate only; Dependabot regenerates locks with its own toolchain, outside npm's project config
- Smoke's pre-publish tarball packed hook-free under the committed ignore-scripts (no LICENSE, unstamped version) while staying green: force the pack lifecycle like publish.yaml does
- The theme-lock resolve's literal cooldown flag outranked the documented emergency env override: compute it from the override with 7 as the fallback (red-green probed both arms)
- Scopes the Netlify comment's is:clean claim to what git can see; node_modules residue is handled by install:safe's wholesale npm ci
- --prefix/-C suppresses the workspace walk-up, so prefix runs read only the target directory's .npmrc: mirror the root file in theme/ (the .nvmrc-pair pattern) instead of hand-carrying flags per script
- Reverts _sync:theme-lock to its flagless form; the emergency env override now works by npm precedence (env > project), red-green probed under a pinned-empty userconfig
- Audit: theme/.npmrc pinned as assignment-set mirror of root; docsy.dev stays absent
- npm pack excludes nested .npmrc, so no package channel ships it (probed)
- Replaces the assignment-set mirror with an exact copy of the root file (the agreed design): one sync rule, `cp .npmrc theme/.npmrc`, enforced by a byte-equality audit assert (red-proven on a perturbed copy)
- Root .npmrc header names the mirror and the edit-together rule
- Documents the two-homes pattern in the maintainer notes beside its .nvmrc precedent
@chalin
chalin merged commit 45b042a into docsy:main Aug 29, 2026
17 checks passed
chalin added a commit to docsy/docsy-example that referenced this pull request Sep 26, 2026
- **Scope**, Docsy's shape per docsy/docsy#2821:
  - **Preserves Renovate config comments through migrations** (renovatebot/renovate#38646)
  - **Hardens GitHub Actions bumps** per Docsy's [maintainer notes](https://main--docsydocs.netlify.app/project/about/maintainer-notes/#dependency-updates)
  - **Keeps Renovate's schedule consistent across hosts**
  - **Makes `CONTRIBUTING.md` a delta doc**: its Docsy-overlapping sections point at Docsy's notes and keep only what differs here
  - **Closes the toolchain drift**: the npm release cooldown (docsy/docsy#2760) and a Renovate-updatable Node pin
  - **Keeps CI's script-approval check live**: Docsy's `ignore-scripts=true` is not copied (§ Install configuration)
  - **Makes `approve:hugo` work from a fresh checkout** and makes its version pin explicit
  - **Requires a reviewed Hugo version for manual updates**: `update:hugo` dropped
- **Out of scope**:
  - a pin-comment audit test like Docsy's: this repo has no supply-chain audit; `CONTRIBUTING.md` names the PR reviewer as the check
  - Docsy's own `renovate.jsonc` (no explicit `timezone`): a follow-up on the Docsy side
  - enabling the Renovate app on the `docsy` org: owner step after this lands
  - dependency bumps of any kind; the pending ones arrive as Renovate PRs
- **Verified** (renovate 44.82.5, npm 11.19.0, empty user config):
  - passes the strict config validator
  - proves the approval check red-first: a CI-shaped `npm ci` with scripts on and the hugo-extended approval wrong fails
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