Fail the build when documentation content fails to compile - #122
Merged
guanzhousongmicrosoft merged 1 commit intoJul 30, 2026
Merged
Conversation
compile-content.tsx never checked the git clone exit status. A failed clone of documentdb/docs left the copy loop with nothing to copy, and the site would build and deploy successfully with empty /docs and /docs/reference sections - a silent, total documentation outage. - The clone now fails the build with the git stderr on a non-zero exit. - A mapping whose source folder is missing from the cloned repository (layout change upstream) fails with a pointed message. - A mapping that matches zero files fails instead of shipping an empty section. - The deploy workflow gains an independent artifact check before upload: key pages must exist in out/ and at least 100 reference pages must have been exported (the docs repo currently holds ~240 reference entries). Also anchors the api-reference/ and reference/ gitignore patterns to the repo root so they can no longer swallow tracked paths like app/docs/reference/ (verified with git check-ignore before and after).
guanzhousongmicrosoft
approved these changes
Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
scripts/compile-content.tsxrunsgit cloneviaspawnSyncand never checks the exit status. If thedocumentdb/docsclone fails in CI (network blip, branch rename, repo move),copyFilesRecursivesilently finds nothing to copy, the Next.js build succeeds, and the site deploys with empty/docsand/docs/referencesections — a total documentation outage with a green pipeline.Fix
Three layers, from cause to artifact:
spawnSyncerror and non-zero exit paths). The throw flows into the script's existing error handling, which already exits 1.out/, and at least 100 reference pages must have been exported — the docs repo currently holds ~240 reference entries (counted via the GitHub tree API), so the floor triggers only on genuine content loss while tolerating growth and reasonable shrinkage.Also anchors the
api-reference/andreference/gitignore patterns to the repo root — the unanchored form also matchedapp/docs/reference/, which breaks pathspecs against tracked files there.Validation
git check-ignore -vbefore/after: rootreference/foo.mdandapi-reference/foo.mdremain ignored;app/docs/reference/page.tsxis no longer matched by any ignore rule.🤖 Generated with Claude Code
https://claude.ai/code/session_01XGMeNSmhAgmqzkdc7cQQgf