Skip to content

Go: mux registrations built by runtime concatenation (prefixVar + "literal") are not resolved — most of a service's routes missing #1249

Description

@mmaripanguec

What is broken

Route registrations whose path is a compile-time-obvious concatenation of a config variable and a string literal are not indexed, so the graph misses most of the service's surface.

Minimal repro (Go, gorilla/mux)

r := mux.NewRouter()
r.HandleFunc(settings.V.BaseURL+"/login", loginHandler)          // MISSED
r.HandleFunc(settings.V.BaseURL+"/v2/login", loginV2Handler)     // MISSED
r.HandleFunc(settings.V.BaseURL+"/widget/{rest:.*}", widget)     // MISSED
r.HandleFunc("/health", health)                                   // indexed OK

Observed impact

In a real BFF with 47 HandleFunc registrations (42 unique paths), all of them using the BaseURL+"literal" pattern, the graph contained only 9 Route nodes — and several of those came from logger labels rather than registrations (see #1248). The same limitation hides outbound calls built the same way (url := "http://" + host + ":" + port + "/log" produced no HTTP_CALLS edge), so a real cross-service seam was invisible.

Expected

When the non-literal part is a simple identifier/selector (config prefix) and the rest is a literal, index the literal suffix as the route path (optionally recording the dynamic prefix in a property, e.g. {"prefix_var": "settings.V.BaseURL"}). This pattern is idiomatic in Go services that mount everything under a configurable base path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingparsing/qualityGraph extraction bugs, false positives, missing edgespriority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.ux/behaviorDisplay bugs, docs, adoption UX

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions