test(code-pages): make the docs.json redirect round-trip hermetic - #1702
Conversation
The round-trip test pruned a real retired model and expected exactly one redirect appended to docs.json. That held on main only until the sync branch ran the generator: it wrote the redirect for that very model, so on that branch the test found it already present, appended nothing, and failed the snippet-script-tests job. Prune a page no provider will ever ship instead, and assert the precondition the test relies on.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe redirect test now uses a synthetic never-shipped provider model. It verifies that no redirect exists before ChangesRedirect test validation
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The test fixture is isolated from repository catalog state and introduces no identified production or merge-blocking risk. 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
ELI5
A test added in #1701 — fix(code-pages): redirect the URL of every model page --prune deletes checked that retiring a model adds one forwarding address to
docs.json. It used a real retired model as its example, and as soon as the real sync retired that model for real, the forwarding address was already there and the test counted zero new ones. This swaps the example for a model that can never exist, so the test measures the code and not the state of the catalog.Motivation
The rolling sync PR #1687 — chore: sync Comfy API v2 specification and Comfy Router pages (cloud@0887294) was rebuilt after #1701 landed. Its
check-redirectsjob now passes, but itssnippet-script-testsjob fails in the round-trip test because the sync branch'sdocs.jsonalready carries the redirect the test tries to add. Every future sync would fail the same way until the test stops depending on which models happen to be retired.Provenance
bun test ./.github/scripts/snippets/: 38 passed, 0 failed againstmain'sdocs.json, and 38 passed, 0 failed again with the sync branch'sdocs.json(which carries the ten model-page redirects) swapped in.Reviewer context
snippet-script-testsuntil this is onmainand the sync is rebuiltSummary
renderDocsJsonround-trip test prunesdevelopment/comfy-router/models/test-provider/never-shipped/codeinstead of a real retired model, and asserts up front thatdocs.jsonhas no redirect for it.Test plan
snippet-script-testsgreen on this PRsnippet-script-testson chore: sync Comfy API v2 specification and Comfy Router pages (cloud@fdf7af6) #1687 should pass