GitNexus/gitnexus/test/unit/group
Gergő Magyar 698f5efc82
Some checks are pending
CodeQL / Analyze (javascript-typescript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
Gitleaks / gitleaks (push) Waiting to run
Publish / Classify release event (push) Waiting to run
Publish / RC guard (marker + release-PR skip) (push) Blocked by required conditions
Publish / ci (push) Blocked by required conditions
Publish / Publish to npm (push) Blocked by required conditions
Publish / Build & Push RC Docker images (push) Blocked by required conditions
Scorecard / Scorecard analysis (push) Waiting to run
Trivy Image Scan / Trivy (gitnexus-cli) (push) Waiting to run
Trivy Image Scan / Trivy (gitnexus-web) (push) Waiting to run
feat(group): resolve inline HTTP provider handlers via call-site line (#2276) (#2282)
* feat(group): resolve Go inline provider handlers via line containment (#2276)

Widen the Go HandleFunc + framework-route handler capture to match
func literals and emit name:null + call-site line for them, so an
inline handler resolves to its containing/closure symbol instead of
file-level. Named identifier handlers keep resolving by name.

* feat(group): resolve Laravel closure provider handlers via line containment (#2276)

Capture the Laravel route handler argument; a closure (anonymous
function or arrow fn) now emits name:null + the registration line so it
resolves to its containing symbol (service-provider boot, controller
method) by containment. Named-controller routes keep the 'route' label.
File-scope closures stay file-level (PHP closures not yet indexed).

* feat(group): wire call-site line on FastAPI provider emits (#2276)

Set line on the FastAPI @app/@router provider detections (already
name:null) so the source-scan fallback resolves the decorated handler
by line-span containment. Best-effort: FastAPI routes are graph-backed
and the function span starts at def, so this lands the single-decorator
case. Flask add_url_rule already carried line.

* feat(group): wire call-site line on Kotlin/Java Spring provider emits (#2276)

Add line to the Kotlin and Java Spring @*Mapping provider detections
for parity with the consumer emits and a future inline DSL. Inert for
current resolution: a named Spring controller method resolves by name
and never falls through to line-span containment.

* fix(review): apply autofix feedback

Pin two documented limitations with tests: a file-scope Laravel closure
and a multi-decorator FastAPI handler both degrade to file-level rather
than mis-attributing (#2276 ce-code-review autofix).

* test(group): lock named gin framework-route resolves by name not registrar (#2276)

Reviewer verified named Go handlers still resolve by name across the
widened queries; the HandleFunc path was already pinned, this adds the
framework-route (gin/echo) path with a DB + enclosing registrar whose
span covers the registration line, proving the emitted line never
diverts a named provider to its registrar via containment.

* test(group): end-to-end inline Go provider resolution against real LadybugDB (#2276)

Closes the validation gap that all prior coverage mocked CONTAINING_QUERY:
runs the real pipeline over a Go file with an inline http.HandleFunc
func-literal handler, persists into a real LadybugDB, and runs the
production HttpRouteExtractor against the real executor — proving the
emitted call-site line lands inside main()'s real 0-based span and yields
source_scan_resolved, not the file-level fallback.

* fix(test): use fs.mkdtemp to satisfy CodeQL insecure-temporary-file gate (#2276)

The new integration test created its temp base via a predictable
os.tmpdir()+name join, which CodeQL flags as js/insecure-temporary-file
(1 high). Switch to fs.mkdtemp for an atomic, randomly-named base dir.

* fix(group): anchor Go provider @handler to the trailing argument (#2276)

The widened framework-route and HandleFunc handler captures
(`[(identifier) (func_literal)] @handler`) were unanchored, so a variadic
middleware route `r.GET("/x", mw, func(){})` produced two provider
detections — one for the middleware identifier and one for the closure.
The contractId-only merge then kept the middleware detection and
mis-attributed the route to it (and the pre-existing `mw, namedHandler`
shape had the same defect), silently neutralizing the inline-handler
containment resolution from #2276.

Add a trailing tree-sitter anchor (`@handler .`) so the handler binds the
LAST argument of the call, leaving middleware args before it unconstrained.
Verified against tree-sitter-go: the multi-arg shapes now yield exactly one
detection (the real handler) while every 2-arg case is unchanged. Adds two
regression tests pinning that a middleware + inline closure resolves to its
containing function and a middleware + named handler resolves by name.

* test(group): cover FastAPI @router inline-handler containment (#2276)

The @router/APIRouter provider emit gained a call-site `line` in #2276 but
only the @app path was tested; the existing @router tests call
`extract(null, …)` so the resolver/containment path never ran for @router.
Add two tests mirroring the @app cases: a single-decorator @router handler
resolves to its function via source_scan_resolved (which fails if `line` is
dropped), and a multi-decorator one degrades to file-level.

* fix(group): treat synthetic 'route' label as anonymous in cross-trace (#2276)

After #2276 an unresolved file-scope Laravel closure emits name:null, so its
persisted symbolName falls back to 'handler' — which providerLabel already
anonymizes to '<contractId handler>'. But an unresolved named-controller
route still carries the synthetic 'route' placeholder, which the sentinel
did NOT cover, so group_trace/group_cross_impact rendered it as the literal
'route' while equivalent closures showed '<... handler>'.

'route' is only ever the synthetic Laravel placeholder (php.ts), never a
resolved handler name, so add it to the unresolved-generic sentinel set
alongside 'handler'/'fetch'. The resolved branch is untouched, so a real
symbol genuinely named 'route' still displays its name. Adds a cross-trace
test pinning the anonymized label.

* fix(group): gate Spring provider line on a present method name (#2276)

The Java/Kotlin Spring @*Mapping provider emits set `line` unconditionally
while the method name is typed string|null. The 'a named provider never
reaches containment' guarantee held only because the grammar always captures
a method name — the type did not enforce it. A (grammar-impossible) null name
would emit name:null + line and resolve by containment to the enclosing class
body instead of staying file-level.

Emit `line` only when the method name is truthy, so a nameless provider
degrades to file-level (the safe no-mis-attribution outcome). Behavior is
unchanged for every real Spring route (name is always present), but the
inertness is now enforced rather than incidental.
2026-06-23 17:51:11 +01:00
..
bridge-db-edge.test.ts fix(deps): upgrade @ladybugdb/core to 0.16.0 to resolve native segfaults (#1235) 2026-04-30 17:40:39 +01:00
bridge-db.test.ts feat(group): cross-repo call trace using PDG (#2269) 2026-06-23 07:54:13 +01:00
bridge-storage-tempfile.test.ts fix(security): close URL/regex/tag-filter sanitization cluster (U7) (#1330) 2026-05-08 07:11:29 +01:00
config-parser.test.ts feat: add IncludeExtractor for C++ cross-repo include tracking (group) (#1156) 2026-05-09 09:31:59 +01:00
cross-impact-phase2-timeout.test.ts fix(ingestion): close ReDoS in cobol-preprocessor + rust-workspace + resource-exhaustion in cross-impact (U8) (#1331) 2026-05-08 09:10:07 +01:00
cross-impact.test.ts fix(group): bubble local-impact phase errors in groupImpact (#1004) (#1007) 2026-04-21 11:44:16 +01:00
cross-trace.test.ts feat(group): resolve inline HTTP provider handlers via call-site line (#2276) (#2282) 2026-06-23 17:51:11 +01:00
elixir-workspace-extractor.test.ts feat(group): workspace extractors for Node, Python, Go, Java, Elixir (#1260) 2026-05-04 09:43:21 +01:00
fixtures.ts feat(group): bridge.lbug storage + contract matching expansion (1/4 of #606 split) (#795) 2026-04-11 19:46:12 +01:00
go-workspace-extractor.test.ts feat(group): workspace extractors for Node, Python, Go, Java, Elixir (#1260) 2026-05-04 09:43:21 +01:00
group-path-utils.test.ts feat: cross-repo impact analysis (#794) — @repo MCP routing + group resources (#984) 2026-04-20 11:55:07 +01:00
group-service-group-mode.test.ts feat: cross-repo impact analysis (#794) — @repo MCP routing + group resources (#984) 2026-04-20 11:55:07 +01:00
group-tools.test.ts feat: cross-repo impact analysis (#794) — @repo MCP routing + group resources (#984) 2026-04-20 11:55:07 +01:00
grpc-extractor.test.ts fix(group): stop Node gRPC loadPackageDefinition gate from matching every member call (#1916) 2026-05-30 09:31:36 +01:00
http-consumer-signals.test.ts perf(group/http): skip source parse for graph-covered route files (#2138 Part 2) (#2265) 2026-06-23 07:22:43 +01:00
http-route-extractor.test.ts feat(group): resolve inline HTTP provider handlers via call-site line (#2276) (#2282) 2026-06-23 17:51:11 +01:00
http-route-graph-method.test.ts feat(group): cross-repo call trace using PDG (#2269) 2026-06-23 07:54:13 +01:00
http-route-multi-verb.test.ts feat(group): cross-repo call trace using PDG (#2269) 2026-06-23 07:54:13 +01:00
impact-by-uid.test.ts feat(group): add sync pipeline, CLI, MCP tools, and monorepo fixture 2026-04-02 00:40:31 +03:00
include-extractor.test.ts feat(cpp): parse CUDA source extensions (#2213) 2026-06-16 07:32:53 +01:00
insecure-tempfile.test.ts fix(security): close URL/regex/tag-filter sanitization cluster (U7) (#1330) 2026-05-08 07:11:29 +01:00
java-workspace-extractor.test.ts feat(group): workspace extractors for Node, Python, Go, Java, Elixir (#1260) 2026-05-04 09:43:21 +01:00
manifest-extractor.test.ts feat(ingestion): add thrift contracts impl (#1234) 2026-05-06 09:19:10 +01:00
matching.test.ts feat(group): Support Django route extraction for multi-repo (#1836) 2026-06-21 20:11:30 +01:00
node-workspace-extractor.test.ts feat(group): workspace extractors for Node, Python, Go, Java, Elixir (#1260) 2026-05-04 09:43:21 +01:00
python-workspace-extractor.test.ts feat(group): workspace extractors for Node, Python, Go, Java, Elixir (#1260) 2026-05-04 09:43:21 +01:00
resolve-bridge-neighbors.test.ts feat(group): cross-repo call trace using PDG (#2269) 2026-06-23 07:54:13 +01:00
rust-workspace-extractor.test.ts feat(core): adopt pino structured logger (#1336) 2026-05-07 20:56:25 +01:00
service-boundary-detector.test.ts fix(group): address 4 HIGH-priority issues from PR #626 review 2026-04-02 12:55:33 +03:00
service.test.ts feat: cross-repo impact analysis (#794) — @repo MCP routing + group resources (#984) 2026-04-20 11:55:07 +01:00
storage.test.ts fix(group): address 4 HIGH-priority issues from PR #626 review 2026-04-02 12:55:33 +03:00
sync-windowed-resolution.test.ts fix(group): pin repos during sync so large groups resolve cross-links (#2191) 2026-06-13 20:11:15 +01:00
sync.test.ts fix(group): pin repos during sync so large groups resolve cross-links (#2191) 2026-06-13 20:11:15 +01:00
thrift-extractor.test.ts fix(windows): 32767-char tree-sitter crash + VECTOR extension SIGSEGV (#1433) 2026-05-10 16:00:36 +01:00
topic-extractor.test.ts fix(group): contract extractors honour .gitnexusignore via shared IgnoreService (#1185) (#1247) 2026-05-01 16:42:21 +01:00
types.test.ts feat(ingestion): add thrift contracts impl (#1234) 2026-05-06 09:19:10 +01:00