Repository navigation
fix(extract): emit HTTP_CALLS for Retrofit interface methods (#2723) - #2905
Conversation
…a#2723) Retrofit's @GET/@POST/... share their names with the JAX-RS verbs, so every annotated client method became a served Route with a HANDLES edge, and any path without a leading slash collapsed onto "/". JAX-RS verbs are marker annotations; a verb that carries an argument is a Retrofit request. Record its path as client_route_path and emit HTTP_CALLS to the Route instead. Relative paths are rooted, full URLs kept; constants, templates and concatenations have no static value and produce no edge. Signed-off-by: Divakant Pandey <[email protected]>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
|
Thank you so much for this, @divakantpandey! This is a precise fix for a real graph-quality problem: a Retrofit interface describes calls the client makes, and the graph was turning each one into a served endpoint. Several things here are exactly right:
One request before we merge:
Also, a production file this PR touches ( Thanks again for the careful work, and for leaving the same-file constant resolution for a separate change. Keeping this one focused on the direction fix made it easy to review. |
…#2723) Pippo and Rapidoid put the path in @get("/x") on a controller class, and those methods serve the route. Retrofit services must be interfaces, so limit the client reading to Java and Kotlin interfaces. Signed-off-by: Divakant Pandey <[email protected]>
…into fix/2723-retrofit-client-http-calls Signed-off-by: Divakant Pandey <[email protected]>
|
Limited the Retrofit reading to methods declared in a Java or Kotlin interface, and added a control test with a Pippo-style Java controller and a Rapidoid-style Kotlin class that keep HANDLES and get no HTTP_CALLS (it fails without the gate). Also merged current main; CI is green on the merged tree. |
Signed-off-by: Martin Vogel <[email protected]>
|
Thank you again, @divakantpandey. Two other changes merged into main tonight and touch files this PR also changes (tests/test_pipeline.c and src/pipeline/pass_parallel.c), so we merged current main into your branch - a plain signed-off merge commit, your change is untouched - to get a fresh CI run on the exact tree that will merge. Nothing is needed from you: it merges as soon as that run is green. If you push again, please pull first so the merge commit is kept. |
|
Thanks for merging main in and for the quick review. I've pulled the merge commit locally, so anything I push later will build on it. |
|
Merged - thank you very much, @divakantpandey! This round was exactly what we hoped for.
Retrofit clients now show up in the graph as the outbound calls they are, and they match their servers across repositories like any other HTTP call. Thanks again for the careful work on #2723! |
|
Thanks for the thorough review and for testing the gate on all those interface variants, that was reassuring to see. Glad it landed. I may pick up the same-file constant resolution as a follow-up. |
Brings the branch up to date with main (e2a93e4): DeusData#2205 (daemon UI setting on manual start), DeusData#2905 (Retrofit client HTTP_CALLS) and two GitHub Actions version bumps. No conflicts. Signed-off-by: Martin Vogel <[email protected]>
|
Thank you @DeusData for sharing your feedback and merging this :) |
Fixes #2723.
Retrofit's
@GET/@POST/... match the bare-verb branch ofannotation_route_methodthat exists for JAX-RS, so each interface method became aRoutewith aHANDLESedge in the client project. Non-@Pathpaths must start with/, so Retrofit's relativev1/ordersfell back to/.JAX-RS verbs are marker annotations (the path is a sibling
@Path), and Retrofit services must be interfaces, so a verb annotation with an argument on a method declared in a Java or Kotlin interface is a Retrofit request. Controller classes that put the path in@GET("/x")(Pippo, Rapidoid) keep theirHANDLES. Such methods now storeclient_route_pathinstead ofroute_path, andcbm_pipeline_emit_def_routeemitsHTTP_CALLSwith the sameurl_path/methodproperties as call-site service edges, so cross-repo matching treats them like any other outbound call. A separate field keeps everyroute_pathconsumer (prefix bridge, decorator backstop, UI) meaning "served endpoint" unchanged. The incremental routes re-extract an edited file and go through the same emit, soensure_decorator_routesneeds no change; the incremental test covers both routes.Path handling: a leading
/is kept, a relative path is rooted (Retrofit resolves it against the base URL), and a full URL is kept as written. Aconst val, a string template or a concatenation has no static value: no edge, rather than a/Route. Resolving same-file constants would cover the remaining two cases in the issue; I left it out to keep this change to the direction fix.On the issue's fixture: client
HANDLES4 -> 0,HTTP_CALLS0 -> 2; client -> servercross_http_calls0 -> 2; billing caller 2 -> 1 (no longer lands on the client). JAX-RS server routes unchanged.Checklist
scripts/test.sh --suites pipeline_semantic_manifest_repro,pipeline,extraction,edge_types_probe,cross_repo,incremental(1376 passed, ASan/UBSan, macOS arm64); fullscripts/test.sh: 10324 passed, 0 failedHANDLES, and an incremental re-index; the Retrofit tests fail without the fix and the controller-class test fails without the interface gate