Skip to content

feat(java): expand static HTTP consumer extraction coverage#1888

Open
ShiningXu wants to merge 3 commits into
abhigyanpatwari:mainfrom
ShiningXu:fix/issue-1873-java-http-followups
Open

feat(java): expand static HTTP consumer extraction coverage#1888
ShiningXu wants to merge 3 commits into
abhigyanpatwari:mainfrom
ShiningXu:fix/issue-1873-java-http-followups

Conversation

@ShiningXu

@ShiningXu ShiningXu commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Refs #1873 for the Java-only static cases covered here.

  • support fully-qualified Spring and OpenFeign annotations
  • preserve @RequestMapping prefixes on non-Feign Spring controller interfaces
  • extract static URI.create(...) and literal UriComponentsBuilder paths in RestTemplate calls, including fromUriString(...), fromHttpUrl(...), and query-only intermediate calls
  • extract WebClient method(HttpMethod.X).uri(...) long-form calls, aligned with Kotlin PR feat(group): add Kotlin Spring WebClient long-form HTTP consumer extraction #1884 boundaries: no double emit, no variable-bound verb guessing, and only GET/POST/PUT/DELETE/PATCH long-form verbs
  • infer OkHttp verbs from sibling builder calls such as .get(), .head(), .post(...), .delete(), and .method("PATCH", ...)
  • cover Java HttpClient helper methods including HEAD() plus .method("PATCH", ...) and default GET builders

Deferred

  • dynamic variable URLs, constants, string concatenation, @Value, helper/wrapper methods, and cross-statement data-flow remain deferred
  • Kotlin changes are intentionally out of scope

Validation

  • npx vitest run test/unit/group/http-route-extractor.test.ts
  • npx vitest run test/unit/group
  • npx tsc --noEmit
  • npx prettier --check src/core/group/extractors/http-patterns/java.ts test/unit/group/http-route-extractor.test.ts
  • npx eslint src/core/group/extractors/http-patterns/java.ts test/unit/group/http-route-extractor.test.ts (warnings only from existing non-null assertions in the test file)
  • git diff --check
  • ./gitnexus/dist/cli/index.js detect-changes --scope unstaged --repo GitNexus

@vercel

vercel Bot commented May 29, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the NexusCore Team on Vercel.

A member of the Team first needs to authorize it.

@ShiningXu ShiningXu changed the title feat(java): expand static HTTP consumer extraction feat(java): expand static HTTP consumer extraction coverage May 29, 2026
@ShiningXu

Copy link
Copy Markdown
Contributor Author

Update summary for the latest Java-only additions:

  • Spring/OpenFeign annotations now support fully-qualified names, including fully-qualified @FeignClient, @RequestMapping, and method mapping annotations.
  • Non-Feign Spring controller interfaces now keep interface-level @RequestMapping prefixes and still emit provider contracts, not consumers.
  • RestTemplate static URL extraction now covers literal strings, URI.create(...), and literal UriComponentsBuilder chains, including fromPath(...), fromUriString(...), fromHttpUrl(...), path(...), pathSegment(...), and query-only intermediate calls.
  • WebClient long-form extraction now covers webClient.method(HttpMethod.X).uri(...) for GET/POST/PUT/DELETE/PATCH and is aligned with Kotlin PR feat(group): add Kotlin Spring WebClient long-form HTTP consumer extraction #1884 boundaries: no double emit, no variable-bound verb guessing, and unsupported enum verbs are skipped.
  • OkHttp builder extraction now infers .get(), .head(), .post(...), .put(...), .delete(), .patch(...), and .method("VERB", ...) from sibling builder calls instead of defaulting every request to GET.
  • Java HttpClient extraction now covers helper methods GET/POST/PUT/DELETE/HEAD, default GET builders, and .method("PATCH", ...) / other literal custom methods.
  • Added negative coverage for dynamic variable URL arguments so source-scan still skips non-static URL expressions.

Still intentionally deferred for #1873 follow-up scope: dynamic variable URLs, constants/string concatenation/@Value, helper or wrapper methods, cross-statement data-flow, and Kotlin parity beyond the separate Kotlin PR.

@github-actions

Copy link
Copy Markdown
Contributor

CI Report

All checks passed

Pipeline Status

Stage Status Details
✅ Typecheck success tsc --noEmit
✅ Tests success unit tests, 3 platforms
✅ E2E success gitnexus-web changes only

Test Results

Tests Passed Failed Skipped Duration
10062 10058 0 4 599s

✅ All 10058 tests passed

4 test(s) skipped — expand for details
  • PHP pipeline benchmark > scales with file count (workers enabled)
  • Ruby pipeline benchmark > scales with file count (workers enabled)
  • Rust pipeline benchmark > scales with file count (workers enabled)
  • buildTypeEnv > known limitations (documented skip tests) > Ruby block parameter: users.each { |user| } — closure param inference, different feature

Code Coverage

Tests

Metric Coverage Covered Base Delta Status
Statements 79.83% 35375/44308 79.48% 📈 +0.3 🟢 ███████████████░░░░░
Branches 68.4% 22583/33016 68% 📈 +0.4 🟢 █████████████░░░░░░░
Functions 84.86% 3650/4301 84.56% 📈 +0.3 🟢 ████████████████░░░░
Lines 83.4% 31870/38211 82.97% 📈 +0.4 🟢 ████████████████░░░░

📋 View full run · Generated by CI

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.

1 participant