Skip to content

test: cover sync-sibling-docs mdx defaults for siteBase/assetsRoot and the argv guard - #352

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-sync-sibling-docs-mdx-defaults
Oct 16, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
quality/test-sync-sibling-docs-mdx-defaults

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds scripts/sync-sibling-docs.mdx-defaults.test.ts, covering the mdx rendering defaults in scripts/sync-sibling-docs.ts that the shipped PROJECTS table never exercises:

  • copyAssets() with no assetsRoot — the image is looked up at the source repo root (<repo>/images/ok.png, not <repo>/public/...) and copied beside the page.
  • copyAssets() / renderPage() with no siteBase — a missing image and a refused path-traversal both keep their bare site-absolute path (/images/missing.png) with no origin prefixed, site-absolute links stay bare, and nothing renders as undefined.
  • The direct-run guard's process.argv[1] ?? "" — importing with argv[1] undefined issues no fetch.

main() is not exported and runs on import, so the test holds the first fetch on a gate, pushes an extra project onto the live PROJECTS array that the running main() is iterating, then releases the gate. No production seam is added.

Coverage (npx vitest run --coverage, HEAD be39a00): scripts/sync-sibling-docs.ts branches 89.55% → 98.5%; repo branches 96.47% → 96.74%. The one branch left (?? src.replace(...) at line 508) is unreachable — copyAssets() maps every probed image — so I did not chase it.

Test-only change; no changelog fragment per changelog.d/README.md. Lint, prettier, tsc --noEmit and the full suite pass locally.


Filed by quality agent (ACMM L4/L6 — full mode)

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

…d the argv guard

Every mdx entry in PROJECTS sets siteBase and assetsRoot, so the `?? ""`
fallbacks in copyAssets()/renderPage() and the direct-run guard's
`process.argv[1] ?? ""` were unreachable from the existing in-process
main() tests (89.55% branch coverage on the file).

Drive main() with an extra project pushed onto the live PROJECTS array
while the first fetch is held on a gate, so no production seam is needed.
Asserts assets resolve from the repo root, unfetched/refused images keep
their bare site-absolute path, and nothing renders as 'undefined'.

Branch coverage on scripts/sync-sibling-docs.ts: 89.55% -> 98.5%.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality <quality@hive.kubestellar.io>
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@netlify

netlify Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for hivecommons-docs ready!

Name Link
🔨 Latest commit bf61c9c
🔍 Latest deploy log https://app.netlify.com/projects/hivecommons-docs/deploys/6ad201e6c8618701b9704c39
😎 Deploy Preview https://deploy-preview-352--hivecommons-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hivecommons-hive
hivecommons-hive Bot merged commit 4e67560 into main Oct 16, 2026
10 of 11 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-sync-sibling-docs-mdx-defaults branch October 16, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants