Skip to content

fix(pipeline): infer HTTP method for Angular and verb-suffix client calls (#2768) - #2854

Open
divakantpandey wants to merge 1 commit into
DeusData:mainfrom
divakantpandey:fix/2768-angular-http-client-method
Open

divakantpandey wants to merge 1 commit into
DeusData:mainfrom
divakantpandey:fix/2768-angular-http-client-method

Conversation

@divakantpandey

Copy link
Copy Markdown
Contributor

Fixes #2768

Problem

Angular HttpClient calls (e.g., this.http.get('/items/list'), this.http.get('/items/' + id)) were misclassified as server route registrations in unresolved service handling because receiver conventions (HttpClient, httpClient, this.http, this.httpClient, $http) and @angular/common/http were missing from http_libraries. Furthermore, detect_url_in_args() unconditionally minted __route__ANY__ without an HTTP method, causing cross-repo template matching to link GET requests to the first matching server route template regardless of HTTP verb (e.g. matching DELETE /items/{id} or POST /items/{parentId}/{id}).

Solution

  1. Add @angular/common/http, HttpClient, httpClient, this.http, this.httpClient, and $http to http_libraries in service_patterns.c.
  2. Evaluate cbm_service_pattern_match before calls_emit_route_call in calls_emit_unresolved_service to ensure client HTTP calls take precedence over route registration heuristics.
  3. Propagate cbm_service_pattern_http_method() in detect_url_in_args() and fallback to callee suffix in pass_route_nodes.c and pass_cross_repo.c.
  4. Add regression tests in test_pipeline.c and test_cross_repo.c covering Angular HttpClient calls in both parallel and sequential modes, and verifying exact verb matching against overlapping route templates.

…alls (DeusData#2768)

Signed-off-by: Divakant Pandey <divakant01@gmail.com>
@github-actions

Copy link
Copy Markdown

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. 0.9.1-rc.1 is out, so the release freeze that held reviews is over — but it left a large queue of open pull requests behind it, and we are reading through them oldest-first. The background is in discussion #1144.

What that means for this PR, concretely:

  • It will not be closed for inactivity. No stale bot touches pull requests here.
  • It may still sit a while before a human reads it. That is on us, not on you.
  • Older PRs are read first, so a recent one is not being skipped — it is behind a queue.

Things that will genuinely speed it up whenever review does happen:

  • Keep it rebased on main — the tree is moving quickly right now, and a conflicting branch cannot be reviewed as the diff you intended.
  • Get CI green, or say which failures you believe are pre-existing.
  • Keep the change to one claim. Bundled features and refactors get split before they get merged, which costs you a round trip.
  • Every commit needs a sign-off (git commit -s) — CI enforces DCO.

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

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.

Angular HttpClient calls can be linked to the wrong cross-repo route

1 participant