Skip to content

fix(website): send /models to /models/ permanently - #18484

Closed
benjcooley wants to merge 1 commit into
mainfrom
bencooley/fe-2770-models-trailing-slash
Closed

benjcooley wants to merge 1 commit into
mainfrom
bencooley/fe-2770-models-trailing-slash

Conversation

@benjcooley

Copy link
Copy Markdown
Collaborator

Summary

/models and /models/ both answered 200 and search traffic split between them (Hex: 134 organic sessions on /models/, zero on /models); Vercel now 301s the bare path to the canonical slash form in both locales.

Changes

  • What:
    • vercel.json: two permanent redirects, /models → /models/ and /zh-CN/models → /zh-CN/models/. Literal sources, same pattern as the MiniMax and Enterprise entries.
    • src/config/redirects.test.ts: pins both redirects and that the slash forms stay unredirected.
    • src/config/llms-txt.test.ts: the stale-link check built its set from every redirect source, and normalizePath collapses /models and /models/, so llms.txt's /models/ link would have read as stale. A redirect whose destination is its own source plus a slash keeps its page; those are left out of the set.
  • Breaking: none.

Review Focus

Refs FE-2770 (https://linear.app/comfyorg/issue/FE-2770)

Screenshots (if applicable)

Not applicable — a redirect. Verification after deploy: curl -sI https://comfy.org/models → 301 with location: https://comfy.org/models/.

The catalogue answered 200 at both /models and /models/, and organic
search split across them while only the slash form ranked. Every page
canonicalizes with the slash, so Vercel now sends the bare path there
with a 301, in both locales.

The llms.txt stale-link check treated every redirect source as a retired
page; a redirect that only adds the slash keeps its page, so it is left
out of that set.

Refs FE-2770
@benjcooley
benjcooley requested review from a team September 23, 2026 00:04
@vercel

vercel Bot commented Sep 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
billing-web Ignored Ignored Sep 23, 2026 12:04am UTC

Request Review

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

🧩 Custom Nodes Ecosystem Matrix: 🟡 Withheld — could not measure

Executes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight ecosystem-matrix shard checks are a harness self-test; the pack verdict is matrix-verdict.

This candidate changes nothing the matrix measures, so every expensive stage was skipped.

Reproduce locally
# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
  npx vitest run --config vitest.matrix.config.mts

Full docs: scripts/registry-census/README.md

🌐 Website E2E

Tip

All tests passed.

Status ✅ Passed
Report View Report

🌾 Fallow: ✅ Passed

Fallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened.

No new findings in the changed files.

Reproduce locally
# the base the gate compared against
npx fallow audit --root . --quiet --format json \
  --changed-since 2d91d541ae686105ac4cb1cc8395bcb0084bdc62

Full docs: ADR-DEVEX-LINT-0015

🔗 Website Preview

Website Preview: https://comfy-website-preview-pr-18484.vercel.app

Models is built and gated by PostHog (workshop-enabled), using staging Cloud.

This commit: https://website-frontend-3i1mt034n-comfyui.vercel.app

Last updated: 2026-09-23T00:06:33Z for 5e3a35f

@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 49964038-57b6-45e7-9df5-96cd2b3713ec

📥 Commits

Reviewing files that changed from the base of the PR and between 2d91d54 and 5e3a35f.

📒 Files selected for processing (3)
  • apps/website/src/config/llms-txt.test.ts
  • apps/website/src/config/redirects.test.ts
  • apps/website/vercel.json

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


📝 Walkthrough

Walkthrough

The website adds permanent redirects from model routes without trailing slashes to trailing-slash routes. Redirect parsing excludes these slash-only redirects from stale-source checks. Tests verify both behaviors.

Changes

Models trailing-slash routing

Layer / File(s) Summary
Redirect configuration and route validation
apps/website/vercel.json, apps/website/src/config/redirects.test.ts
Adds permanent redirects for /models and /zh-CN/models. Tests verify the redirects and confirm trailing-slash routes are not redirected.
Stale-source filtering
apps/website/src/config/llms-txt.test.ts
Excludes redirects that only append a trailing slash from stale-source checks while preserving source normalization for other redirects.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: christian-byrne, nav-tej

Merge Risk: ⚪ Minimal · up to 5e3a3

The change safely canonicalizes model URLs and prevents harmless trailing-slash redirects from producing stale-link reports.

🚥 Pre-merge checks | ✅ 7
✅ Passed checks (7 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: permanently redirecting /models to /models/.
Description check ✅ Passed The description follows the template and explains the redirect changes, tests, scope, review considerations, issue reference, and verification steps. It is complete and relevant.
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.
End-To-End Regression Coverage For Fixes ✅ Passed The title and commit subject contain the bug-fix signal fix. However, all changed files are under apps/website, which the check explicitly excludes from this browser_tests/ requirement. The PR d…
Website End-To-End Regression Coverage ✅ Passed The changed apps/website/src/ files are test files only (llms-txt.test.ts and redirects.test.ts). The runtime change is confined to apps/website/vercel.json, which is outside the check's appli…
Adr Compliance For Entity/Litegraph Changes ✅ Passed The changed-file list contains only apps/website/src/config/llms-txt.test.ts, apps/website/src/config/redirects.test.ts, and apps/website/vercel.json. None are under src/lib/litegraph/, `src/e…
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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

@codecov

codecov Bot commented Sep 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##             main   #18484      +/-   ##
==========================================
+ Coverage   83.35%   83.37%   +0.01%     
==========================================
  Files        2987     2956      -31     
  Lines      147788   147156     -632     
  Branches    38162    38009     -153     
==========================================
- Hits       123190   122684     -506     
+ Misses      23317    23227      -90     
+ Partials     1281     1245      -36     
Flag Coverage Δ
billing-web-unit ?
website-unit 75.80% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 31 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added the risk:high PR risk grade (advisory shadow check; grader-owned) label Sep 23, 2026
Comment thread apps/website/vercel.json
Comment on lines +55 to +59
{
"source": "/models",
"destination": "/models/",
"permanent": true
},

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

suggestion (non-blocking): with #18480 in, the 148 model pages carry 887 links to bare /models or /models?…, all built from workshop: '/models' in config/routes.ts:52: the "Back to all models" link, "Browse all models", and every tag and use-case filter link (/models?q=flux, /models?useCase=generate-images). After this lands, each one is a redirect hop on pages we're asking Google to crawl. Could that constant become '/models/' in this PR, so the redirect only ever catches outside links?

@MaanilVerma

Copy link
Copy Markdown
Collaborator

Checked on this PR's Vercel preview and against Vercel's own route compiler (@vercel/routing-utils 6.6.0). /models and /zh-CN/models redirect to the slash form in one hop, the query string survives (/models?utm_source=x lands on /models/?utm_source=x), and /models/ itself isn't matched because the source compiles to ^/models$, so there's no loop. Removing the two entries turns 2 tests red and turning one into a loop turns 1 red.

Check Result
/models and /zh-CN/models redirect permanently pass, 308
One hop, ends at 200, no loop pass
Query string kept pass
Tests catch a missing or looping redirect pass
No internal links to bare /models once #18480 lands 887 links, see inline

One correction for the description and the post-deploy check: Vercel answers permanent: true with 308, not 301, so curl -sI https://comfy.org/models will show 308. Google treats the two the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants