test(routing): use bound AST navigation evidence#1075
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughRoute reachability analysis now parses TypeScript/JSX with Babel, resolves framework navigation APIs through lexical scopes, extracts statically determinable destinations, and checks per-file target sets instead of matching raw source text. ChangesRoute reachability analysis
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant SourceFiles
participant BabelParser
participant NavigationExtractor
participant ReachabilityChecker
SourceFiles->>BabelParser: parse each TypeScript/JSX file
BabelParser->>NavigationExtractor: provide syntax tree
NavigationExtractor->>SourceFiles: store computed navigation targets
ReachabilityChecker->>SourceFiles: check route target membership
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
…-reachability-ast
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 985226b266
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
next/link,next/navigationredirect/useRouter, andnext/serverresponse bindings with lexical shadowingModeHomeTemplate.actionscontractWhy
The previous regex could treat comments, strings, unrelated component props, or coincidental method names as inbound navigation. This makes the orphan-route guard depend on actual bound navigation syntax and fail closed for unsupported patterns.
Closes #1041.
RAG impact: no retrieval behaviour change — test-only route wiring guard.
Files
tests/route-reachability.test.tsVerification
node scripts/run-vitest.mjs run tests/route-reachability.test.ts --reporter=verbose— 5/5 passednpx eslint tests/route-reachability.test.ts— passednpm run typecheck— passednpm run test— 358 files passed; 3,172 passed; 1 skippednpm run verify:cheap— all 20 gates passed; 358 files passed; 3,172 passed; 1 skippednpm run verify:pr-local -- --dry-run --files tests/route-reachability.test.ts— selected runtime, format, lint, typecheck, full unit, and offline RAG fixture validation; build skipped as non-build-affectingnpm run check:rag:fixtures— 36 golden cases / 21 suites passedgit diff --check— passedChecks not run
verify:cheap; its only additional selected check,check:rag:fixtures, was run separately and passed.Risk and rollback
The matcher is deliberately narrow. New navigation abstractions must be explicitly supported or the orphan guard will fail closed. Roll back by reverting commit
985226b26.Summary by CodeRabbit