Repository navigation
fix(synthesis): a test's request reaches only its own app's routes - #3370
Merged
Merged
Conversation
colbymchenry
force-pushed
the
claude/issue-3320-test-requests-own-language
branch
from
November 18, 2026 03:54
3db9451 to
daba660
Compare
The test-request pass (PR #2100) links a Spring or Laravel test's request (MockMvc's `get("/owners")`, `$this->get('/about')`) to the route it reaches. It matched the request against every route node in the index, whatever its language. In a repository that holds a Java backend and a JavaScript or TypeScript server, a Java test's request that no Java route serves (an actuator path, a controller in a module the index lacks) landed on the TypeScript server's catch-all `GET /*`. That edge made the Java suite a dependent of the server's code, so `codegraph affected` selected Java tests for a change to an Angular service the server imports, which the issue reports as hundreds of Java tests for one `.service.ts`. A test's request is served by the program it tests: the pass now matches a Java or Kotlin test against JVM routes and a PHP test against PHP routes (sameLanguageFamily), filtering the route table once per language. Validation: - test-request-edges.test.ts: a Java test's request no Java route serves no longer reaches a TypeScript Express catch-all (and the server's file no longer lists the test among its dependents), a Laravel test's `/pricing` no longer reaches it either, and a Kotlin test still reaches a Java route. The two cross-language cases fail on main and pass here; the file's 8 existing cases pass (11 passed). - The issue's shape as a fixture (Spring + Angular + an Express server importing the Angular service): `codegraph affected` on the service lists the two Angular specs and no longer the Java test. - A/B against v1.6.3 sources (3 interleaved rounds): jhipster-sample-app (Spring + Angular, 62 test-request edges), jsoup, invoiceplane, and controls flask and gin all produce byte-identical graphs; index-time medians moved within this machine's noise. Left out, for the maintainer: `affected` also follows the cross-tier edges from a web client's literal `fetch`/`HttpClient` call to the backend route it calls, so a change to a Java class still selects the Angular specs of the services that call its endpoints. Whether test selection should cross that wire is a product call, left to the maintainer. Fixes #3320 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
colbymchenry
force-pushed
the
claude/issue-3320-test-requests-own-language
branch
from
November 18, 2026 03:57
daba660 to
f44dd0e
Compare
colbymchenry
deleted the
claude/issue-3320-test-requests-own-language
branch
November 18, 2026 03:58
This was referenced Nov 18, 2026
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
In a repository holding a Java backend and a JavaScript or TypeScript server, a Spring test's request that no Java route served was linked to the TypeScript server's catch-all route.
codegraph affectedthen selected Java tests for a change to the web code. A Spring/Kotlin test's request now reaches only JVM routes, and a Laravel test's only PHP routes.Root cause
The test-request pass (#2100) links a Spring or Laravel test's request (MockMvc's
get("/owners"),$this->get('/about')) to the route it reaches, so the controllers those suites exercise don't read as untested.testRequestEdges(src/resolution/tier-synthesizer.ts) matched each request against every route node in the index, whatever its language.When no Java route served the path (an actuator path, or a controller in a module the index lacks), the request could land on a TypeScript Express catch-all
GET /*. That edge made the Java suite a dependent of the server's code, and through it of whatever the server imports. That is the issue's "Java tests for an Angular service".Fix
A test's request is served by the program it tests. The pass now matches a Java or Kotlin test only against JVM routes, and a PHP test only against PHP routes (
sameLanguageFamily). The route table is filtered once per language.Validation
__tests__/test-request-edges.test.ts, three new cases. The two cross-language cases fail on main and pass here; the file's 8 existing cases pass (11 passed).get("/management/health")no longer reaches a TypeScript ExpressGET /*, and the server's file no longer lists the test among its dependents.get("/owners")still reaches its Java route.$this->get('/pricing')no longer reaches the Express catch-all, and/aboutstill reaches its PHP route.The issue's shape as a fixture: Spring + Angular, plus an Express server that imports the Angular service.
codegraph affectedon the service:HealthIT.java;A/B against v1.6.3's sources, 3 interleaved rounds:
Index-time medians moved within this machine's noise.
Full suite: see the PR's READY note.
Left out (a product call)
codegraph affectedwalks every edge kind. That includes the cross-tier edge from a web client's literalfetch/HttpClientcall to the backend route it calls (http-client, alsoqueue-job/event-bus). So a change to a Java class still selects the Angular specs of the services that call its endpoints: on the fixture,ItemService.javalistsitem.service.spec.tsanditem.component.spec.ts. Whether test selection should cross that wire is the maintainer's decision, and this PR doesn't change it.Credit
Thanks @jotder for the report.
Fixes #3320
🤖 Generated with Claude Code