Skip to content

fix(repo-map): ignore routes in comments and strings - #217

Open
kspraveen-07 wants to merge 2 commits into
Sandesh13fr:Developmentfrom
kspraveen-07:fix/ignore-route-comments
Open

kspraveen-07 wants to merge 2 commits into
Sandesh13fr:Developmentfrom
kspraveen-07:fix/ignore-route-comments

Conversation

@kspraveen-07

Copy link
Copy Markdown
Contributor

What changed?

Fixed false-positive route detection in the repo-map package when route-looking text appears inside comments and string literals.

  • Added comment and string masking while preserving character positions and line breaks.
  • Updated Express route detection to ignore matches inside comments and strings.
  • Updated Python, Java, and Kotlin decorator detection to ignore matches inside comments and strings.
  • Added regression tests covering Express comments and string literals, and Python comments, regular strings, and triple-quoted strings.

Fixes #178

Contribution prerequisite

  • I starred the [TCalc repository](https://github.com/Sandesh13fr/TCalc) before starting this contribution.
  • I checked the issue and existing PRs for overlapping work. I understand that assignment is not required and any contributor may propose a focused solution.
  • This PR targets the Development branch (unless a maintainer explicitly approved another base).

Affected areas

  • CLI
  • MCP server / agent integrations
  • Web / dashboard
  • VS Code extension
  • JetBrains plugin
  • Shared package — packages/repo-map
  • GitHub Action / CI / release
  • Documentation / catalog data

Validation

  • Regression test added or updated for behavior changes
  • Relevant focused tests passed
  • pnpm build
  • pnpm test
  • pnpm lint
  • pnpm typecheck
  • CLI/MCP smoke, VSIX packaging, or JetBrains verification as applicable

Commands run and results:

  • pnpm.cmd exec vitest run packages/repo-map/tests/symbols/detectFrameworkRoutes.test.ts — 7 tests passed.
  • pnpm.cmd exec vitest run packages/repo-map/tests — 78 tests passed across 8 test files.
  • git diff --check — no whitespace errors reported.

Review notes

  • Privacy, security, compatibility, or breaking-change impact: No intended API changes. Route detection should produce fewer false positives by ignoring route-like text inside comments and strings.
  • Documentation updated (or not needed because): No documentation changes needed for this internal route-detection fix.
  • Screenshots/recording for visible UI changes: Not applicable; this is an internal code change without UI changes.

@vercel

vercel Bot commented Oct 19, 2026

Copy link
Copy Markdown

@kspraveen-07 is attempting to deploy a commit to the Sandesh's projects Team on Vercel.

A member of the Team first needs to authorize it.

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a00e87ad-5682-410a-8325-44583c1192c6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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.

Share

@kspraveen-07

Copy link
Copy Markdown
Contributor Author

Hi @Sandesh13fr, the route-detection changes are complete, and all 78 repo-map tests pass locally. The CI test job is currently failing in apps/cli/tests/catalogCommand.test.ts because catalogs/models.json is reported as 92 days old (maximum allowed: 90 days). The CLI smoke test also fails at catalog validation. Could you please advise whether the catalog needs to be refreshed or whether this is a known issue? Thanks!

@kspraveen-07

Copy link
Copy Markdown
Contributor Author

Hi @Sandesh13fr, I investigated the failing CI checks. The two failures in apps/cli/tests/catalogCommand.test.ts are reproducible on the upstream Development branch after building the workspace. Both fail because catalogs/models.json is 102 days old, exceeding the 90-day freshness limit. My PR only changes route detection and does not modify the CLI or catalog files. Could you confirm whether this baseline issue should be addressed separately?

@Sandesh13fr

Copy link
Copy Markdown
Owner

Thanks @kspraveen-07 — the masking approach is right (checking codeMask[m.index] keeps the route string itself while rejecting matches that start inside comments or strings). Two things before merge:

  1. Indentation: in the Express loop of detectFrameworkRoutes.ts the new try { ... } catch body is dedented to column 2, outside the enclosing for. Please re-indent it to match the surrounding block (the Python/Java loop below is fine).
  2. Add a trailing newline to detectFrameworkRoutes.test.ts.

The red Test / CLI smoke jobs are the stale-catalog failure tracked in #218, not your change. Push the fixes and I'll merge.

@kspraveen-07

Copy link
Copy Markdown
Contributor Author

Hi @Sandesh13fr, I've fixed the Express block indentation and added the trailing newline to the test file. The repo-map test suite passes (78/78), and I've pushed the updates. Thanks for the review!

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants