Skip to content

build: add lightweight npm supply chain guardrails#11360

Merged
julian-risch merged 4 commits into
mainfrom
build/npm-supply-chain-guardrails
May 21, 2026
Merged

build: add lightweight npm supply chain guardrails#11360
julian-risch merged 4 commits into
mainfrom
build/npm-supply-chain-guardrails

Conversation

@julian-risch
Copy link
Copy Markdown
Member

@julian-risch julian-risch commented May 21, 2026

Related Issues

Changes

check_api_ref.yml — pin npx docusaurus-mdx-checker to @3.0.0:

docs_search_sync.yml — add --ignore-scripts to npm install, then explicitly rebuild sharp:

  • npm install --ignore-scripts blocks preinstall/install/postinstall lifecycle hooks across all packages which is a common supply chain attack vectors. Risk here is that there are any hooks that are required and this change will make them fail. We'll see.
  • We add one exception: npm rebuild sharp then re-runs only sharp's install script. Sharp is a native module (libvips bindings) that downloads a platform-specific prebuilt binary in its install script — without it, @docusaurus/plugin-ideal-image and other Docusaurus image code would fail at build time.

.github/dependabot.yml — add npm ecosystem entry:

  • Adds an npm entry for /docs-website on a daily cadence with cooldown.default-days: 1, matching what we use for GitHub actions and pip. Dependabot will open bump PRs for direct dependencies in package.json.

Notes for the reviewer

I chose to not commit docs-website/package-lock.json or switch to npm ci. The lockfile is ~900KB and would generate frequent Dependabot bumps touching it because that would include all transitive dependencies. Not just direct dependencies.

Checklist

  • I have read the contributors guidelines and the code of conduct.
  • I have updated the related issue with new insights and changes.
  • I have added unit tests and updated the docstrings.
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I have documented my code.
  • I have added a release note file, following the contributors guidelines.
  • I have run pre-commit hooks and fixed any issue.

🤖 Generated with Claude Code

@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
haystack-docs Ignored Ignored Preview May 21, 2026 11:32am

Request Review

@julian-risch julian-risch added the ignore-for-release-notes PRs with this flag won't be included in the release notes. label May 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Coverage report

This PR does not seem to contain any modification to coverable code.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@julian-risch julian-risch force-pushed the build/npm-supply-chain-guardrails branch from 1336505 to 8cb34ce Compare May 21, 2026 11:12
@julian-risch julian-risch changed the title build: harden npm supply chain via lockfile, npm ci, and pinned npx build: pin npx docusaurus-mdx-checker to a specific version May 21, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@julian-risch julian-risch changed the title build: pin npx docusaurus-mdx-checker to a specific version build: add lightweight npm supply chain guardrails May 21, 2026
julian-risch and others added 2 commits May 21, 2026 13:26
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@julian-risch julian-risch marked this pull request as ready for review May 21, 2026 11:36
@julian-risch julian-risch requested a review from a team as a code owner May 21, 2026 11:36
@julian-risch julian-risch requested review from sjrl and removed request for a team May 21, 2026 11:36
@julian-risch julian-risch enabled auto-merge (squash) May 21, 2026 11:36
@sjrl
Copy link
Copy Markdown
Contributor

sjrl commented May 21, 2026

@julian-risch I think this looks good. Did you have a chance to test to see if this build works or will we see next time the docs website is rebuilt?

@claude
Copy link
Copy Markdown

claude Bot commented May 21, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@julian-risch
Copy link
Copy Markdown
Member Author

@julian-risch I think this looks good. Did you have a chance to test to see if this build works or will we see next time the docs website is rebuilt?

I reproduced the workflow steps locally, particularly the npm install --ignore-scripts part and the npm rebuild sharp. Looks good to me. Can't rule out any surprises in the CI but I am confident it will work fine.

@julian-risch julian-risch merged commit b15180f into main May 21, 2026
23 checks passed
@julian-risch julian-risch deleted the build/npm-supply-chain-guardrails branch May 21, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ignore-for-release-notes PRs with this flag won't be included in the release notes. topic:build/distribution topic:CI topic:DX Developer Experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants