chore(docs): keep docs-site links relative when syncing SDK READMEs - #413
Merged
Merged
Conversation
The SDK READMEs have to link to docs.schematichq.com absolutely — they are read on GitHub and on the package registries. On the docs site those are internal pages, so someone had hand-edited the two of them in the generated .mdx to be site-relative. sync_sdk_readmes.py did not reproduce that, so all six pages read as stale and the next sync would have clobbered the hand-edit, sending preview deploys out to production docs. Teach to_page_body() to rewrite https://docs.schematichq.com/X to /X. With this, --check goes from 6/6 STALE to 6/6 ok with no page edits.
Contributor
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.
Follow-up to SchematicHQ/schematic-node#159.
The SDK READMEs link to docs.schematichq.com absolutely — they're read on
GitHub and on the package registries, so they have to. On the docs site those
same links are just internal pages, and someone had hand-edited the two of them
in the generated
.mdxto be site-relative:.../quickstart/account-setup#2-create-your-api-keys→/quickstart/account-setup#2-create-your-api-keys.../developer_resources/key_management→/developer_resources/key_managementto_page_body()doesn't reproduce that, so every one of the six synced pagesreads as stale, and the next sync would silently revert the hand-edit. The
links would still resolve, but preview deploys would link out to production
docs instead of staying in the preview.
Teaches
to_page_body()to rewritehttps://docs.schematichq.com/X→/X.Verified locally against all six SDK repos:
That's the whole drift — those two links on each page were the only thing
making them stale.
Worth noting separately:
--checkisn't wired into any CI workflow, which iswhy this went unnoticed. Adding it to a docs job would make future drift fail
loudly rather than get quietly reverted on the next Monday sync.