Repository navigation
fix(docs): accept scoped generated reference paths - #1473
Conversation
|
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Path validation and redirect coverage src/utils/repo-path.ts, tests/scoped-docs-paths.test.ts |
The path-segment pattern now permits @. Tests check scoped path validation, manifest-based render redirect resolution, and rejection of traversal, repeated separators, encoded traversal, query or fragment delimiters, backslashes, and authority-style URLs. |
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix
Possibly related issues
- fix(seo): make the sitemap canonical-only, healthy, and testable #1153 — This change allows a scoped reference path to pass repository-path validation, addressing one unhealthy reference-path case described in the issue. Broader sitemap validation remains outside this change.
Possibly related PRs
- TanStack/tanstack.com#885 — Adds skill-content URL handling that uses a skill path; this change permits
@in the shared path validator. - TanStack/tanstack.com#1459 — Resolves package-relative Markdown links against published skill-file URLs and loads skill content on direct visits; this change permits scoped path segments in shared validation.
Merge Risk: 
Minimal · up to f41f1
-
No actionable merge-blocking risk was identified in the scoped path-validation change.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title "fix(docs): accept scoped generated reference paths" matches the main change. The PR allows "@" in repository path segments so scoped generated namespace paths pass shared path validation for docs route resolution and raw content loading. The title is specific and concise, and it follows a conventional commit style. The changed code is one pattern in src/utils/repo-path.ts, plus tests for scoped paths and for the rejected inputs that must stay invalid.
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
tanstack-com | f41f1ae | Commit Preview URL Branch Preview URL |
Nov 01 2026, 05:31 AM |
|
The affected generated-reference page now renders on the exact commit preview.
|
|
The scoped-reference fix is live now. All 45 namespace URLs that failed the earlier audit have recovered.
|
A live sitemap sample found
/db/latest/docs/reference/@tanstack/namespaces/IR/variables/INCLUDES_SCALAR_FIELDreturning 404 even though its Markdown file exists upstream. The shared repository-path validator rejects@, so both docs route resolution and raw content loading reject this generated namespace path.Allow
@in repository path segments. The existing restrictions on traversal, empty segments, absolute paths, URL delimiters and encoded characters stay in place. Reviewed callers use the validated value as a repository-relative path beneath separately validated owner/repository/ref values.The regression fails on the old validator and passes with this change, checking both content-path validation and actual docs route resolution. Negative controls cover scoped traversal, encoded traversal, backslashes, query/fragment delimiters and URL-shaped inputs. This addresses one concrete unhealthy sitemap destination under #1153, which remains open for its other requirements. Full preview HTTP verification is pending.
Normal commit hooks passed formatting, TypeScript, lint, 689 unit tests, 2,278 chat tests and 20 desktop tests, with 5, 6 and 1 skipped respectively.
Summary by CodeRabbit
@are now accepted, allowing valid references to resolve to their destination.