Repository navigation
Description
Finding
rewriteHref()'s isAsset = !!options.assetBaseUrl && assetExts.includes(ext) has a short-circuit branch for assetBaseUrl being falsy. That branch is 100% unit-covered (lib/remarkRewriteLinks/index.test.mts: 'leaves .csv links untouched when no assetBaseUrl is provided'; npm run test:coverage reports 100/100/100/100 repo-wide at commit 7dc5dd4) but no e2e build exercises it.
Verified with npx c8 --all --include lib/remarkRewriteLinks/index.ts node --test e2e/linkRewrite.test.mjs at commit 7dc5dd4: 99.32% stmt/line, 83.78% branch, with line 93 (the assetBaseUrl-falsy branch) uncovered.
This is distinct from the gaps #444/#445/#449 (open PRs) and #440/#441 (merged) already address - none of those touch this branch.
Unlike those gaps, this branch looks structurally unreachable through the real build: docusaurus.config.ts always wires the plugin with assetBaseUrl from getBuildContext(repo), whose assetBaseUrl field (${assetRepo}/blob/${assetBranch}) is always a non-empty string by construction. There is no BUILD_ENV/env-var combination that makes getBuildContext omit it, so an e2e test can only reach this branch by constructing a Docusaurus build that wires remarkRewriteLinks without assetBaseUrl - different from the real production wiring, not a path a genuine e2e assertion should fabricate.
Recommendation
No test-code fix is proposed here: an e2e test that rewires the plugin outside docusaurus.config.ts's real configuration would test a configuration the site never uses, not close a genuine end-to-end gap. Two options for a maintainer to pick between, and this is advisory rather than actionable from this lane since it crosses into design judgement about dead-code/branch simplification:
- Leave as-is - the branch exists for direct API consumers of
rewriteHref/remarkRewriteLinksoutside this repo's own Docusaurus config (it is an exported, documented option), so unit coverage is the right bar for it, and this issue can close as 'won't test further'. - If the branch is considered genuinely dead in this repo's own build, note that in the file's JSDoc so a future reader doesn't go looking for an e2e test that cannot meaningfully exist.
Priority
- Evidence: unit-covered (
lib/remarkRewriteLinks/index.test.mts), not end-to-end-covered (no e2e fixture reaches it, and by design cannot without faking the config wiring) - Priority: 2 (medium) - unit-covered, not end-to-end-covered
- Impact: low (narrow branch, exported for external API consumers, not reachable from this site's own build)
- Effort: low to decide, none to implement (no e2e test proposed)
Filed by quality agent (hold-gated mode)
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-boq9 | SHA: 7dc5dd4
Activity
hivecommons-hive commentedon Nov 24, 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
e2e/linkRewrite.test.mjs, 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] getBuildContext BUILD_ENV default-fallback (real production path) unit-covered but not end-to-end exercised
Finding
getBuildContext.tsline 14:The
|| 'production'default is the real Netlify production code path:netlify.toml's[context.production]runsnpm run build:production(
npm run _build->docusaurus build), and neither that script norbuild:previewsetsBUILD_ENV. Only the localnpm run buildscript setsBUILD_ENV=devexplicitly. So in a genuine production deploy,BUILD_ENVis unset and this fallback is what decides
isProd/assetBaseUrlfor thewhole site.
This default is 100% unit-covered in isolation
(
lib/getBuildContext.test.mts: "defaults to production when BUILD_ENV isunset"), but no e2e build exercises it.
e2e/linkRewrite.test.mjs's"production build wires isProd-dependent editUrl/url end-to-end" suite
explicitly sets
BUILD_ENV: 'production'in the child process env (line167) rather than leaving it unset, so the real build only ever takes the
explicit-string branch of line 14, never the
||default branch. Aregression that broke the default (e.g. swapping the fallback to
'development') would pass every existing unit and e2e test whilebreaking the real production build.
Verified with combined coverage:
npx c8 --all --include 'lib/**/*.ts' --reporter=json node --test 'e2e/**/*.test.mjs'at commit 3c1e2b5 reportslib/getBuildContext.tsbranch 3 (line 14, the||default) at 0 hits,even though
npm run test:coverage(unit) reports the same file at100/100/100/100. Confirmed locally that a build with
BUILD_ENVdeletedfrom the child env (rather than set to
'production') produces identicaloutput (same
og:url/editUrl) to the existing explicit-production e2ebuild, proving the default is reachable and assertable without fabricating
any wiring the real build doesn't use.
Recommendation
Add an e2e case that builds with
BUILD_ENVdeleted (not set to anyvalue) and asserts the same production assertions as the existing
explicit-
BUILD_ENV=productionsuite, so a regression in the defaultitself fails even when the explicit-string path still passes.
Priority
lib/getBuildContext.test.mts), notend-to-end-covered (no e2e build leaves
BUILD_ENVunset; seee2e/linkRewrite.test.mjsline 167)deploy takes, not a byway)
Filed by quality agent (hold-gated mode)
🐝 Hive Agent:
quality| Instance:hosted-available-lke648397-260827-boq9| SHA:unknownhivecommons-hive commentedon Nov 24, 2026
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.
PR #454 covers this issue: #454
The PR body says this is partial/non-closing work (
Refs/Part ofor leave-open wording), so Hive will not add a closing keyword. GitHub will not show its issue-list PR icon without a closing keyword; the stage comment is the link.