Repository navigation
Description
Finding
lib/getBuildContext.ts, lib/getCurrentBranch.ts, and lib/getGitHubRepoUrl.ts are each 100% unit-covered in isolation (npm run test:coverage, HEAD). docusaurus.config.ts wires their combined output (assetBaseUrl) into the beforeDefaultRemarkPlugins rewrite plugin that produces the .csv-asset GitHub blob URLs.
The only end-to-end suite, e2e/linkRewrite.test.mjs, runs a single real docusaurus build with BUILD_ENV=dev and DEPLOY_PRIME_URL='' — i.e. always the non-deploy-preview branch of getBuildContext(). The deploy-preview branch (where getCurrentBranch()/getGitHubRepoUrl() actually run and their return values get wired into the rewritten link) was never exercised by any build, so a regression there (e.g. assetBaseUrl silently falling back to main/the canonical repo during an actual Netlify deploy preview) would pass both the unit suite and the existing e2e suite.
Unit evidence: 100% stmt/branch/func/line coverage for all three helpers (c8, npm run test:coverage, HEAD).
End-to-end evidence (before this fix): zero — e2e/linkRewrite.test.mjs's single build never set DEPLOY_PRIME_URL to a truthy value, so isDeployPreview was always false and getCurrentBranch()/getGitHubRepoUrl() were never invoked by any build in the repo.
Priority 2 (unit-covered, not end-to-end covered) per the quality-agent coverage-evidence policy.
Recommendation
Add a second docusaurus build in e2e/linkRewrite.test.mjs with BUILD_ENV=deploy-preview, a truthy DEPLOY_PRIME_URL, and deterministic GITHUB_REF_NAME/REPOSITORY_URL env vars (the same env vars getCurrentBranch()/getGitHubRepoUrl() already read for Netlify/GitHub Actions deploy previews), then assert the rendered .csv blob URL reflects the preview branch/repo instead of main.
Priority
- Impact: medium (a real deploy-preview regression in asset-link wiring would not be caught by any existing check)
- Effort: low (new e2e
describeblock reusing the existing build-and-read-html pattern, no production code changes)
Filed by quality agent (hold-gated mode)
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-boq9 | SHA: 8ee3ae3
— hive: agent=quality backend=copilot model=claude-opus-4-6 copilot=1.0.88
Activity
hivecommons-hive commentedon Nov 18, 2026
Folded finding. This was filed as a separate issue, but 1 open agent-filed issue (plus 4 closed as completed in the last 14 days) already cite
docusaurus.config.ts, so it was folded into the oldest of them instead of opening another. Treat this issue as the tracker for that component: prefer one structural fix that covers every folded variant over a PR per variant.[quality] test:coverage --exclude flag leaves docusaurus.config.ts ungated despite being fully unit-tested
Finding
package.json'stest:coveragescript passes--exclude 'docusaurus.config.ts'to c8:This exclude predates
lib/docusaurusConfigPreprocessor.test.mtsandlib/docusaurusConfigBuildContext.test.mts(added in #404/#419), which bothimport the real
docusaurus.config.tsdirectly viatestHelpers/resolveExtensionlessTs.mjsand already exercise it at 100%stmt/branch/func/line. The exclude flag is now a stale blind spot: it was
needed back when the file had no direct-import tests (see the since-closed
#398), but today it just means a future regression or new untested branch
added to
docusaurus.config.tswould passnpm run test:coveragesilentlyinstead of failing the gate, because c8 never instruments that file.
Verified locally: removing the
--exclude 'docusaurus.config.ts'flag andre-running
npm run test:coveragestill reports 100% stmts/branch/func/linefor
docusaurus.config.ts— no new tests are needed, this is purely a stalegate-configuration gap.
Recommendation
Remove
--exclude 'docusaurus.config.ts'from thetest:coveragescript inpackage.json, and add a regression test (alongside the existingscripts/coverage-thresholds.test.mjsthreshold check) asserting the scriptno longer excludes that file, so the exclude can't quietly return.
Priority
Filed by quality agent (hold-gated mode)
🐝 Hive Agent:
quality| Instance:hosted-available-lke648397-260827-boq9| SHA:unknown— hive: agent=quality backend=copilot model=claude-opus-4-6 copilot=1.0.88
Folded finding. This was filed as a separate issue, but 1 open agent-filed issue (plus 4 closed as completed in the last 14 days) already cite
docusaurus.config.ts, so it was folded into the oldest of them instead of opening another. Treat this issue as the tracker for that component: prefer one structural fix that covers every folded variant over a PR per variant.[quality] e2e build suite never exercises BUILD_ENV=production, leaving docusaurus.config.ts's editUrl/url wiring unit-covered but not end-to-end covered
Finding
docusaurus.config.ts'sisProd-dependent branches (the siteurl:production domain vs.
DEPLOY_PRIME_URL/localhost fallback;editUrl:set on both docs plugins in production,
undefinedotherwise) are fullyunit-tested via
lib/docusaurusConfigBuildContext.test.mts(theBUILD_ENV=productioncase is explicitly asserted:'uses the production site URL and GitHub editUrl/asset links when
BUILD_ENV=production').
npm run test:coveragereports 100%stmts/branch/func/line on
docusaurus.config.ts(once #427 landsremoving the stale exclude flag).
However,
e2e/linkRewrite.test.mjs's realdocusaurus buildonly everruns with
BUILD_ENV=dev(#426 adds a second build withBUILD_ENV=deploy-preview). The actual Netlify production context(
npm run build:production->npm run _build, which never setsBUILD_ENV, sogetBuildContext.tsdefaultsbuildEnvto'production') is never exercised by a real build anywhere in the testsuite.
Verified locally with two real
docusaurus buildruns against this repo(revision ff6cca7):
BUILD_ENV=productionrenders an 'Edit this page'link (
href=.../tree/main/...) andog:url=https://cncf-techdocs.netlify.app/,while
BUILD_ENV=devrenders no edit link andog:url=http://localhost:3000/. So a wiring regression in theproduction-only branch (e.g.
editUrlsilently omitted, orurlpointing at the wrong domain) would pass every existing unit and e2e test
and only surface on the live site.
Recommendation
Add a third
docusaurus buildscenario toe2e/linkRewrite.test.mjswith
BUILD_ENV=production(andDEPLOY_PRIME_URLcleared, matchingthe real Netlify production context), asserting the rendered HTML for a
docs page contains the GitHub edit-this-page link
(
href="https://github.com/cncf/techdocs/tree/main/...") and thatindex.html'sog:urlmeta tag is the production domain(
https://cncf-techdocs.netlify.app/).Priority
canonical URL or 'Edit this page' links — not a build failure — so it
could ship silently for a while before anyone notices)
docusaurus build+ a couple of assertions,following the exact pattern test: add end-to-end coverage for link-rewrite plugins in the real build #414/test: cover deploy-preview branch/repo wiring in e2e link-rewrite suite #426 already established)
Filed by quality agent (hold-gated mode)
🐝 Hive Agent:
quality| Instance:hosted-available-lke648397-260827-boq9| SHA:unknown— hive: agent=quality backend=copilot model=claude-opus-4-6 copilot=1.0.88
hivecommons-hive commentedon Nov 18, 2026
Note: this issue's number was reused by the hive's consolidation (component:docusaurus.config.ts) for a distinct finding — the
test:coveragescript's stale--exclude 'docusaurus.config.ts'c8 flag, which leaves that file ungated despite being fully unit-tested by lib/docusaurusConfigPreprocessor.test.mts and lib/docusaurusConfigBuildContext.test.mts. That fix is unrelated to the deploy-preview e2e gap described above (tracked separately by PR #426) and ships in a follow-up PR referencing this issue withRefs #425, since the deploy-preview e2e work above remains open.🐝 Hive Agent:
quality| Instance:hosted-available-lke648397-260827-boq9| SHA:unknown— hive: agent=quality backend=copilot model=claude-opus-4-6 copilot=1.0.88
hivecommons-hive commentedon Nov 18, 2026
Additional finding: BUILD_ENV=production is also never e2e-exercised
Distinct from the deploy-preview gap above (addressed by PR #426):
e2e/linkRewrite.test.mjsruns realdocusaurus builds withBUILD_ENV=dev(existing) andBUILD_ENV=deploy-preview(added by #426), but never withBUILD_ENV=production— the actual Netlify production context (npm run build:production->npm run _build, which never setsBUILD_ENV, sogetBuildContext.tsdefaultsbuildEnvto'production').docusaurus.config.ts'sisProd-dependent branches (siteurl: production domain vs.DEPLOY_PRIME_URL/localhost fallback;editUrl: set on both docs plugins in production,undefinedotherwise) are 100% unit-covered vialib/docusaurusConfigBuildContext.test.mts('uses the production site URL and GitHub editUrl/asset links when BUILD_ENV=production'), but no real build ever exercises that branch end-to-end.Verified locally with two real
docusaurus buildruns (revision ff6cca7):BUILD_ENV=productionrenders an 'Edit this page' link (href=.../tree/main/...) andog:url=https://cncf-techdocs.netlify.app/;BUILD_ENV=devrenders no edit link andog:url=http://localhost:3000/. A regression in the production-only branch (e.g.editUrlsilently omitted, orurlpointing at the wrong domain) would pass every existing unit and e2e test and only surface on the live site.Priority 2 (unit-covered, not end-to-end covered) per the quality-agent coverage-evidence policy — opening a PR to add this third build scenario, Refs #425 since this ships independently of the deploy-preview work.
Filed by quality agent (hold-gated mode)
🐝 Hive Agent:
quality| Instance:hosted-available-lke648397-260827-boq9| SHA:unknown— hive: agent=quality backend=copilot model=claude-opus-4-6 copilot=1.0.88