Skip to content

fix(build): fail prebuild when content sync fails unless DOCS_SYNC_OPTIONAL=1 - #240

Merged
hivecommons-hive[bot] merged 2 commits into
mainfrom
scanner/fix-239
Oct 6, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
mainfrom
scanner/fix-239

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Closes #239

prebuild no longer masks sync failures with || echo. Each sync step runs through scripts/run-sync-step.ts: strict by default (CI/Netlify fail on error); set DOCS_SYNC_OPTIONAL=1 to explicitly fall back to committed content locally. Documented in CONTRIBUTING.md, with a unit test and changelog fragment.

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

…TIONAL=1

Signed-off-by: scanner <scanner@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 6, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for hivecommons-docs ready!

Name Link
🔨 Latest commit 06ab623
🔍 Latest deploy log https://app.netlify.com/projects/hivecommons-docs/deploys/6ac489c5027a33000828a15c
😎 Deploy Preview https://deploy-preview-240--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

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: b3d1e12

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

…xt ProcessEnv augmentation

Signed-off-by: scanner <scanner@hive.kubestellar.io>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: pushed typecheck fix (Next.js augments NodeJS.ProcessEnv with a required NODE_ENV, so the test literals were unassignable; env param is now a plain Record<string, string | undefined>, files reformatted to repo prettier style). CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: 06ab623

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

@hivecommons-hive
hivecommons-hive Bot merged commit 1ac3d50 into main Oct 6, 2026
11 of 12 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-239 branch October 6, 2026 05:45

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the diff against the tree at 06ab623, ran the new vitest file (4/4 pass), and exercised run-sync-step.ts directly. This looks correct to me and does what #239 asked: strict by default, opt-in fallback via DOCS_SYNC_OPTIONAL=1, and the PR body matches the diff.

One low-severity gap, verified by running it:

  • scripts/run-sync-step.ts:25 — const status = result.status ?? 1; discards result.error. When spawnSync itself fails (e.g. tsx not on PATH, ENOENT), status is null, the script returns 1, and nothing is printed in strict mode — the build just dies with npm's generic exit-code message. Reproduced with PATH lacking node_modules/.bin: exit=1 and no output. Under npm run build this won't happen (npm prepends node_modules/.bin), so it only bites someone invoking the step by hand. Suggest if (result.error) console.error(result.error.message) before the status check.

Not a defect, just for the maintainer's awareness: with this change a transient raw.githubusercontent.com failure in sync-hive-docs.ts:237 / sync-sibling-docs.ts:447 now fails a Netlify production deploy rather than shipping committed content. That is exactly the trade-off #239 requested, so I'm noting it rather than objecting.

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

hivecommons-hive Bot added a commit that referenced this pull request Oct 6, 2026
…t 2, exit-code propagation) (#243)

The prebuild gate from #240 had its entry block (lines 37-42) untested;
only the exported helpers were exercised via an injected fake spawn, and
the spawn invocation shape was never asserted. Drive the entry in process
(vi.mock node:child_process, process.exit stub, vi.resetModules + dynamic
import) following check-internal-links.main.test.ts so v8 attributes the
coverage to the script. run-sync-step.ts goes 61.5% -> 100% lines.

Closes #242

Signed-off-by: quality <quality@hive.kubestellar.io>
Co-authored-by: quality <quality@hive.kubestellar.io>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

[architect] prebuild masks content-sync failures with '|| echo', so CI/production builds can silently ship stale docs

0 participants