Repository navigation
feat: site-build-gate as external pkg - #3143
Conversation
✅ Deploy Preview for netdata-docusaurus ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
1 issue found across 14 files
Confidence score: 3/5
- The
package.jsonbuild gate is pinned to10.1.0-test.0, which the PR says must not ship. Update it to10.1.0after that release is published before merging.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="package.json">
<violation number="1" location="package.json:76">
P2: This pins the build gate to the prerelease `10.1.0-test.0`, which the PR description explicitly says must not ship. Update the pin to `10.1.0` after that release is published before merging.</violation>
</file>
Architecture diagram
sequenceDiagram
participant CI as Netlify Build
participant NPM as npm Registry
participant Yarn as yarn.lock
participant Gate as @netdata/site-build-gate
participant Baseline as config/site-build-gate-baseline.json
participant PostGate as run-post-build-gates.mjs
participant Docusaurus as Docusaurus Build
Note over CI,PostGate: Site Build Gate Flow
CI->>CI: verify-git-history.js
CI->>CI: verify-indexnow-vendor.js
CI->>Yarn: install dependencies (--frozen-lockfile)
Yarn-->>CI: node_modules ready
CI->>Docusaurus: docusaurus build
Docusaurus-->>CI: build/ output
CI->>PostGate: node scripts/run-post-build-gates.mjs
PostGate->>Gate: run gate with args (--build-dir, --site-origin, --baseline, --integration-route-prefix)
Gate->>Gate: validate Node 22.x
Gate->>Docusaurus: scan build output (2030 pages)
alt Gate major version matches baseline ruleset
Gate->>Baseline: read ruleset_version
Baseline-->>Gate: ruleset_version = 10
Gate->>Gate: run ruleset 10 checks
Gate-->>PostGate: JSON report (0 regressions)
PostGate-->>CI: exit 0
else Gate major version mismatch
Gate->>Baseline: read ruleset_version
Baseline-->>Gate: ruleset_version = 10
Gate-->>PostGate: contract error (exit 2)
PostGate-->>CI: build fails
end
Note over NPM,Yarn: NEW: Gate installed from npm as devDependency
NPM-->>Yarn: @netdata/site-build-gate@10.1.0-test.0
Yarn-->>CI: resolves gate + parser deps (css-tree, parse5, saxes)
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Summary
Learn runs the published
@netdata/site-build-gatepackage instead of a copy of the gate checked in underscripts/site-build-gate/. A Dependabot security update to one of the gate's dependencies is then an ordinaryyarn.lockchange. It no longer fails the Netlify build on a checksum mismatch.The gate's rules, baseline (
config/site-build-gate-baseline.json) and command-line arguments are unchanged.netdata-labs/seo(vendor/site-build-gate/). Its major version is the ruleset version, so10.xmeans ruleset 10.ruleset_version.AGENTS.md(static build gate contract) andREADME.md(dependency authority, and the local setup step that mentioned the nested gate install) describe the package instead of the copy.Evidence
Before: a lockfile-only update to a gate dependency, the shape of a Dependabot security PR, fails after the full Docusaurus build:
Bump source-map-js from 1.2.1 to 1.2.2 in /scripts/site-build-gate #3121 (source-map-js 1.2.1 → 1.2.2) shows this in practice: all GitHub checks were green,
netlify/netdata-docusaurus/deploy-previewwas red, and the PR was closed. The fix needed coordinated changes in seo, website and Learn (Consolidate Learn dependencies and runtime updates #3136).After: the same kind of change, only
yarn.lock(entities8.1.0 → 8.0.0, within^8.0.0), installed with--frozen-lockfile:Full Netlify build (
npm run build:netlify, Node 22.23.2): passes. The site build gate scanned 2,030 pages with 0 regressions, the Cloudflare analytics gate passed, and there are 297 broken-anchor warnings, the same asmaster.Tests:
yarn test:runpasses: Vitest 494 passed and 1 skipped, plus the first-touch (26), IndexNow (64), Swagger UI assets (3), dependency-authority (3) and site-build-gate (4) suites.Pull request checks on
b1eebcd0f(^10.1.0): the Netlify deploy preview, header and redirect rules, the required same-site links job, the advisory cross-site and new third-party link jobs,verifyand the dependency-impact check all pass.Published package (
10.1.0on registry.npmjs.org, released by the seo publish workflow through npm trusted publishing): all four files are byte-identical tovendor/site-build-gate/at seomain@7b3e6d83. Installed from the registry, it givessite build gate v10: 2030 pages, 0 regression(s), 0 accepted finding(s)on the same build.Merge Danger
Door: two-way
Reverting this PR restores the vendored copy and its
npm cistep exactly. The published package stays on npm either way; nothing else depends on it yet.Blast Radius: deploys
^10.1.0lets Dependabot propose later 10.x releases as their own PRs;.github/dependabot.ymlneeds no change. A new major is a ruleset change: its Dependabot PR fails the Netlify build by design (baseline ruleset 10 does not match 11) until the PR also updatesconfig/site-build-gate-baseline.jsonand any new findings are reviewed.^ranges in Learn'syarn.lockinstead of matching seo byte for byte.config/seo-remediation-contract.jsonstill namesscripts/site-build-gate, because it's a frozen historical acceptance record.Summary by CodeRabbit
Build and Dependency Management
Documentation