Skip to content

[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
productionfrom
fix/route-collision-warnings
Draft

[Routes] Eliminate route collision warnings from shadowed stubs, duplicate slugs, RSS conflicts, and llms.txt dupes#32585
mvvmm wants to merge 2 commits into
productionfrom
fix/route-collision-warnings

Conversation

@mvvmm

@mvvmm mvvmm commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

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/pages routes (4 routes)

Wrapped getDocsStaticPaths in src/pages/[...slug].astro to filter out content stubs that have a corresponding explicit page:

  • ai/models
  • workers-ai/models
  • ruleset-engine/rules-language/fields/reference
  • waf/change-log/changelog

2. Duplicate changelog post slugs (1 collision)

getChangelogs() in src/util/changelog.ts strips 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.mdx and workers/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_OWNERS map forces workers to keep the bare slug for the known collision (matching production behavior); fallback is alphabetical-first folder. No more await-dependent ordering inside Promise.all.

3. RSS product/group path collision (1 collision)

/changelog/rss/cloudflare-one.xml was generated by both [product].xml.ts (product ID cloudflare-one) and [area].xml.ts (group slug cloudflare-one).

Fix: The area feed owns this URL (matching production). [area].xml.ts generates all area slugs including cloudflare-one. [product].xml.ts skips any product ID that collides with an area group slug, so the product feed for cloudflare-one is 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.txt static paths (3 collisions)

Four SDK directory entries (sdk, go-sdk, python-sdk, typescript-sdk) share entry.url: /fundamentals/api/reference/sdks/, causing [...product]/llms.txt.ts to emit the same static path 4 times.

Fix: Replaced "first entry wins" Set with a Map<url, entry> + CANONICAL_IDS set. The generic sdk entry is explicitly preferred over language-specific variants (go-sdk, python-sdk, typescript-sdk) for the shared URL. The generated /fundamentals/api/reference/sdks/llms.txt now shows # SDK with the generic description instead of # Go SDK or # TypeScript SDK.

Results

Metric Before After
Could not render route conflicts 9 0
Pages built 8,802 8,809

Verified 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# SDK with generic description

The Nimbus duplicate-slug informational warning (3 routes) persists — it is emitted by the framework during getDocsStaticPaths before our filter runs.

Documentation checklist

@mvvmm

mvvmm commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

/rebase

@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review

⚠️ 1 warning, 💡 1 suggestion found in commit f71bf0c.

👉 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 Review

This code review is in beta and may not always be helpful — use your judgment.

Warnings (1)
File Issue
src/pages/changelog/rss/[product].xml.ts line 27 Over-broad collision filter drops valid product feedsgroups 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)
File Issue
src/pages/changelog/rss/[product].xml.ts line 20 Slugify helper duplicated across routes — 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.

Conventions

No convention issues found.

Style Guide Review

No style-guide issues found.

Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.
/ignore-review-limit Permanently lifts the 2-review automatic limit for this PR. Future pushes will trigger reviews as normal.
/disable-auto-review Stops automatic reviews from triggering on future pushes to this PR. Codeowners can still run /review or /full-review manually.
/rebase Rebases the PR branch against production. On conflict, attempts to resolve automatically using AI. Stops with an explanation if confidence is not high enough.

…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
mvvmm force-pushed the fix/route-collision-warnings branch from b8c238f to 48c8edc Compare August 7, 2026 14:31
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
*.ts @cloudflare/content-engineering, @kodster28
*.astro @cloudflare/content-engineering, @kodster28

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@mvvmm
mvvmm marked this pull request as ready for review August 7, 2026 16:30
@mvvmm
mvvmm requested a review from a team as a code owner August 7, 2026 16:30
@mvvmm
mvvmm marked this pull request as draft August 7, 2026 16:47
@mvvmm
mvvmm marked this pull request as ready for review August 7, 2026 17:20
@mvvmm
mvvmm marked this pull request as draft August 7, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants