Skip to content

test: cover sync-sibling-docs main(), asset copying and introduceSpekStyle - #154

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

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

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds scripts/sync-sibling-docs.main.test.ts, driving the prebuild sibling-docs sync end to end the way npm run prebuild does: the script is spawned under tsx with a --import preload that replaces globalThis.fetch (the same pattern update-meeting-recordings.test.ts already uses), so no network is touched and every fetch outcome is scripted per URL.

Covered:

  • a missing required readme exits 1 with the not found error; projects listed earlier are still written, later ones are not attempted
  • optional pages that 404 are warned — skipped and every required readme is still written
  • markdown pages land on disk with the synced header and rewritten links (synced-route vs. GitHub blob)
  • *_DOCS_REF overrides change the branch that is fetched and recorded in the header
  • MDX pages from spektacular-website: fetched images are copied under docs/content/spektacular/images/…, missing images fall back to the siteBase URL, and a /images/../../… path is refused by the outDir guard (never fetched, never written)
  • introduceSpekStyle: non-spektacular and no-table targets are untouched, replaceAll rewrites every occurrence, backticked command names are preserved, the getting-started table applies

Mutation check: removing the traversal guard makes the MDX test fail. Also adds a changelog.d fragment.

In-process v8 coverage for scripts/sync-sibling-docs.ts moves 32.65% → 39.79% statements (introduceSpekStyle); main/copyAssets/renderPage run in the spawned child, which v8 does not instrument — the same limitation as the existing script tests. npx vitest run scripts/ → 10 files, 116 tests pass; eslint and tsc --noEmit clean.

Closes #153


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

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

…Style

Spawn the script under tsx with a --import fetch stub (the pattern already
used by update-meeting-recordings.test.ts) to exercise the prebuild sync
end to end: required-readme failure, optional 404 skip, synced header and
link rewriting on disk, *_DOCS_REF branch overrides, MDX image copy with
site fallback and the outDir traversal guard. Add in-process unit tests
for introduceSpekStyle.

Closes #153

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 1, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for hivecommons-docs ready!

Name Link
🔨 Latest commit 03019bb
🔍 Latest deploy log https://app.netlify.com/projects/hivecommons-docs/deploys/6abea8d6d3ed220008c1286b
😎 Deploy Preview https://deploy-preview-154--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 7d13e99 into main Oct 1, 2026
8 of 9 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-sync-sibling-docs-main branch October 1, 2026 18:44
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.

[quality] scripts/sync-sibling-docs.ts: main(), copyAssets and renderPage have no tests (33% stmts)

0 participants