robust health check detection#8
Merged
Merged
Conversation
- Add `Healthcheck` enum (`Path`/`Command`) to replace `Option<String>`,
making the semantic distinction between HTTP paths and shell commands
explicit in the type system
- Fix Dockerfile `CMD-SHELL` parsing bug where `find("CMD")` matched
inside `"CMD-SHELL"`, producing garbled output like `-SHELL curl ...`
- Parse `[[http_service.checks]]` in fly.toml (was silently ignored)
- Parse `healthcheck.path` in Heroku app.json (was silently ignored)
- Add Phoenix health check inference (`/health` — ships in generated
router since Phoenix 1.7)
- Update all existing health check assertions to use typed enum variants
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add HealthCheckSignal that detects health endpoints by finding a known health check library import AND a health path string in the same file. Both conditions must hold — co-occurrence in one file is near-certain evidence the endpoint exists at that path. Covers ~80% of real-world usage across Go, Node/TS, Python, and PHP: - Go: hellofresh/health-go, heptiolabs/healthcheck, alexliesenfeld/health, dimiro1/health, etherlabsio/healthcheck, InVisionApp/go-health, GlobalWebIndex/healthcheck, gofiber healthcheck middleware - Node/TS: @nestjs/terminus, @godaddy/terminus, express-healthcheck, healthcheck-middleware, fastify-healthcheck, lightship - Python: django-health-check (health_check.urls include pattern), py-healthcheck, fastapi-healthchecks, fastapi-health - PHP: pragmarx/health, liip/monitor-bundle, spatie/laravel-health Also adds Ruby gem auto-registration detection (no source scanning needed): - okcomputer → /okcomputer - health_check gem → /health_check Two-tier filtering (same pattern as LibraryCallsSignal): Aho-Corasick pre-filter eliminates non-matching files fast; regex confirms import and extracts the exact path string used at the registration site. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Bare words like `health`, `ping`, `status` could previously match without
a leading `/`. The shared path regex now requires `/` explicitly.
Django URL conf never uses leading slashes (`path("health/", include(...))`),
so a dedicated HC_DJANGO_PATH_RE extracts the prefix from the `path()` call
and prepends `/` — rather than making the shared regex optionally slash-less.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Healthcheckenum (Path/Command) to replaceOption<String>,making the semantic distinction between HTTP paths and shell commands
explicit in the type system
CMD-SHELLparsing bug wherefind("CMD")matchedinside
"CMD-SHELL", producing garbled output like-SHELL curl ...[[http_service.checks]]in fly.toml (was silently ignored)healthcheck.pathin Heroku app.json (was silently ignored)/health— ships in generatedrouter since Phoenix 1.7)