Skip to content

test(code-pages): make the docs.json redirect round-trip hermetic - #1702

Merged
mattmillerai merged 1 commit into
mainfrom
fix/code-pages-redirect-test-hermetic
Sep 18, 2026
Merged

mattmillerai merged 1 commit into
mainfrom
fix/code-pages-redirect-test-hermetic

Conversation

@mattmillerai

Copy link
Copy Markdown
Contributor

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-redirects job now passes, but its snippet-script-tests job fails in the round-trip test because the sync branch's docs.json already 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

  • Authored by: interactive session
  • Verified: bun test ./.github/scripts/snippets/: 38 passed, 0 failed against main's docs.json, and 38 passed, 0 failed again with the sync branch's docs.json (which carries the ten model-page redirects) swapped in.
  • Deviations: unknown

Reviewer context

Summary

  • The renderDocsJson round-trip test prunes development/comfy-router/models/test-provider/never-shipped/code instead of a real retired model, and asserts up front that docs.json has no redirect for it.
  • No generator change.

Test plan

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.
@mintlify

mintlify Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
comfy 🟢 Ready View Preview Sep 18, 2026, 12:54 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 00db6896-e305-4e15-9762-449fbefc6652

📥 Commits

Reviewing files that changed from the base of the PR and between d138875 and 127eeae.

📒 Files selected for processing (1)
  • .github/scripts/snippets/gen-code-pages.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The redirect test now uses a synthetic never-shipped provider model. It verifies that no redirect exists before renderDocsJson inserts one.

Changes

Redirect test validation

Layer / File(s) Summary
Synthetic redirect fixture and precondition
.github/scripts/snippets/gen-code-pages.test.ts
The test uses a synthetic provider model and asserts that its redirect is absent before rendering.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 127ee

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)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
✨ Simplify code
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@mattmillerai
mattmillerai merged commit 7a54290 into main Sep 18, 2026
11 checks passed
@mattmillerai
mattmillerai deleted the fix/code-pages-redirect-test-hermetic branch September 18, 2026 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant