Repository navigation
fix(extract): emit HTTP_CALLS for Retrofit interface methods (#2723) - #2905
Open
divakantpandey wants to merge 1 commit into
Open
divakantpandey wants to merge 1 commit into
divakantpandey wants to merge 1 commit into
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 <divakant01@gmail.com>
|
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. |
This branch has not been deployed
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.
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), so a verb annotation with an argument is a Retrofit request. 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(1360 passed, ASan/UBSan, macOS arm64)