[Routes] Eliminate route collision warnings from shadowed stubs, duplicate slugs, RSS conflicts, and llms.txt dupes - #32585
Draft
mvvmm wants to merge 2 commits into
Draft
[Routes] Eliminate route collision warnings from shadowed stubs, duplicate slugs, RSS conflicts, and llms.txt dupes#32585mvvmm wants to merge 2 commits into
mvvmm wants to merge 2 commits into
Conversation
kodster28
approved these changes
Aug 6, 2026
Contributor
Author
|
/rebase |
Contributor
Review
👉 Fix in your agent 👈Fix the following review findings in PR #32585 (https://github.com/cloudflare/cloudflare-docs/pull/32585).
Before making changes, review each finding and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g. the fix requires disproportionate effort for minimal benefit,
or the finding is factually incorrect), explain why
- If you need clarification before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order
After triaging, follow this order:
1. Post a comment on this PR for any findings you are skipping, with the finding ID and your reasoning.
2. Then commit the fixes for the legitimate findings.
The comment must come before the commit — the bot reads PR comments when a new
push triggers a review, so skip comments posted after the push will be missed.
---
## Code Review
### Warnings (1)
#### CR-077496e6fd4f · Over-broad collision filter drops valid product feeds
- **File:** `src/pages/changelog/rss/[product].xml.ts` line 27
- **Issue:** `groups` from `~/util/directory` includes both primary groups and `additional_groups` (it flattens both fields), but the area RSS route at `src/pages/changelog/rss/[area].xml.ts` only builds paths from primary `entry.data.entry.group`. Because the AI product’s directory id is "ai" and it has `additional_groups: [AI]`, `slugifyArea("AI") === "ai"` causes the AI product feed to be removed, and no `/changelog/rss/ai.xml` is produced by either route.
- **Fix:** Build the exclusion set from the same source the area route uses (primary groups only), or share the actual set of area slugs with both routes.
### Suggestions (1)
#### CR-ef3f8e43118d · Slugify helper duplicated across routes
- **File:** `src/pages/changelog/rss/[product].xml.ts` line 20
- **Issue:** The `slugifyArea` helper is copied from `src/pages/changelog/rss/[area].xml.ts`. If the area slug rule changes in one place but not the other, the collision check will become inconsistent.
- **Fix:** Move `slugifyArea` (or a shared `areaSlugs` set) to `~/util/directory.ts` and import it in both RSS route files.
Code ReviewThis code review is in beta and may not always be helpful — use your judgment. Warnings (1)
Suggestions (1)
ConventionsNo convention issues found. Style Guide ReviewNo style-guide issues found. CommandsOnly codeowners can run commands. Post a comment with the command to trigger it.
|
…icate changelog slugs, RSS conflicts, and llms.txt dupes Filter content stubs with explicit src/pages routes from getDocsStaticPaths (ai/models, workers-ai/models, ruleset-engine/.../reference, waf/.../changelog). Deduplicate changelog post slugs by prefixing with product folder when entries from different folders share the same date-filename. Skip area RSS group slugs that collide with product IDs in [area].xml.ts getStaticPaths. Deduplicate llms.txt static paths by URL when multiple directory entries share the same entry.url (e.g. SDK variants). Results: - "Could not render" route conflict warnings: 9 -> 0 - No redirects needed (area RSS collision resolved by skipping colliding slugs) - Pages built: 8803 (was 8802)
mvvmm
force-pushed
the
fix/route-collision-warnings
branch
from
August 7, 2026 14:31
b8c238f to
48c8edc
Compare
Contributor
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
Contributor
|
Preview URL: https://f71bf0c4.preview.developers.cloudflare.com |
mvvmm
marked this pull request as ready for review
August 7, 2026 16:30
mvvmm
marked this pull request as draft
August 7, 2026 16:47
…changelog owner, and generic llms.txt entry
mvvmm
marked this pull request as ready for review
August 7, 2026 17:20
mvvmm
marked this pull request as draft
August 7, 2026 20:37
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.
Summary
Four distinct route collision sources, all fixed without URL changes or redirects. The original approach traded route conflicts for semantic regressions (broken area RSS feed, non-deterministic changelog permalink ownership, wrong llms.txt metadata). This follow-up commit fixes the semantics while keeping the route conflicts eliminated.
1. Content stubs shadowing explicit
src/pagesroutes (4 routes)Wrapped
getDocsStaticPathsinsrc/pages/[...slug].astroto filter out content stubs that have a corresponding explicit page:ai/modelsworkers-ai/modelsruleset-engine/rules-language/fields/referencewaf/change-log/changelog2. Duplicate changelog post slugs (1 collision)
getChangelogs()insrc/util/changelog.tsstrips the product folder from the ID, causing entries from different folders with the same date-filename to collide (e.g.rules/2026-04-01-l4-transport-telemetry-fields.mdxandworkers/2026-04-01-l4-transport-telemetry-fields.mdx).Fix: Two-pass dedup — first pass synchronously collects all slugs and identifies duplicates; second pass assigns canonical ownership deterministically. An explicit
CANONICAL_OWNERSmap forcesworkersto keep the bare slug for the known collision (matching production behavior); fallback is alphabetical-first folder. No moreawait-dependent ordering insidePromise.all.3. RSS product/group path collision (1 collision)
/changelog/rss/cloudflare-one.xmlwas generated by both[product].xml.ts(product IDcloudflare-one) and[area].xml.ts(group slugcloudflare-one).Fix: The area feed owns this URL (matching production).
[area].xml.tsgenerates all area slugs includingcloudflare-one.[product].xml.tsskips any product ID that collides with an area group slug, so the product feed forcloudflare-oneis not generated. The area feed includes all group products (Access, Gateway, CASB, etc.) with the description "Cloudflare changelogs for Cloudflare One products".4. Duplicate
llms.txtstatic paths (3 collisions)Four SDK directory entries (
sdk,go-sdk,python-sdk,typescript-sdk) shareentry.url: /fundamentals/api/reference/sdks/, causing[...product]/llms.txt.tsto emit the same static path 4 times.Fix: Replaced "first entry wins" Set with a
Map<url, entry>+CANONICAL_IDSset. The genericsdkentry is explicitly preferred over language-specific variants (go-sdk,python-sdk,typescript-sdk) for the shared URL. The generated/fundamentals/api/reference/sdks/llms.txtnow shows# SDKwith the generic description instead of# Go SDKor# TypeScript SDK.Results
Could not renderroute conflictsVerified against production:
/changelog/rss/cloudflare-one.xml— area feed with all group items (Access, Gateway, etc.), description "Cloudflare changelogs for Cloudflare One products"/changelog/post/2026-04-01-l4-transport-telemetry-fields/— Workers content (matches production)/fundamentals/api/reference/sdks/llms.txt—# SDKwith generic descriptionThe Nimbus
duplicate-sluginformational warning (3 routes) persists — it is emitted by the framework duringgetDocsStaticPathsbefore our filter runs.Documentation checklist