No test checks that the router (SetupRoutes in internal/server/routes.go) puts the basic auth in front of /metrics, or that it installs the metrics middleware when a metrics username is set. #178 tests both pieces on their own, so either could drop out of the router unnoticed.
Only one test in internal/server can set up /metrics, because the metrics middleware registers with the process-wide Prometheus registry, and that test is the existing TestMaintenanceModeKeepsOtherRoutes (internal/server/maintenance_internal_test.go). CLAUDE.md needs your approval to change an existing test.
Question: may that test be extended (or its /metrics part moved into a new test) to also check that /metrics answers 401 with a WWW-Authenticate challenge without credentials and with a wrong password, and that /metrics reports a request the router served?
Yes (recommended): a small tests-only change; the /metrics gate is then covered where it matters.
No: this stays untested until #85 changes how metrics are set up.
Model: opus-5-5
Split from https://git.eeqj.de/sneak/pixa/issues/79 by the review of https://git.eeqj.de/sneak/pixa/pulls/178 (https://git.eeqj.de/sneak/pixa/pulls/178#issuecomment-122519).
No test checks that the router (`SetupRoutes` in `internal/server/routes.go`) puts the basic auth in front of `/metrics`, or that it installs the metrics middleware when a metrics username is set. https://git.eeqj.de/sneak/pixa/pulls/178 tests both pieces on their own, so either could drop out of the router unnoticed.
Only one test in `internal/server` can set up `/metrics`, because the metrics middleware registers with the process-wide Prometheus registry, and that test is the existing `TestMaintenanceModeKeepsOtherRoutes` (`internal/server/maintenance_internal_test.go`). `CLAUDE.md` needs your approval to change an existing test.
Question: may that test be extended (or its `/metrics` part moved into a new test) to also check that `/metrics` answers 401 with a `WWW-Authenticate` challenge without credentials and with a wrong password, and that `/metrics` reports a request the router served?
- Yes (recommended): a small tests-only change; the `/metrics` gate is then covered where it matters.
- No: this stays untested until https://git.eeqj.de/sneak/pixa/issues/85 changes how metrics are set up.
Model: opus-5-5
sneak
was assigned by clawbot2026-10-04 11:58:53 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Split from #79 by the review of #178 (#178 (comment)).
No test checks that the router (
SetupRoutesininternal/server/routes.go) puts the basic auth in front of/metrics, or that it installs the metrics middleware when a metrics username is set. #178 tests both pieces on their own, so either could drop out of the router unnoticed.Only one test in
internal/servercan set up/metrics, because the metrics middleware registers with the process-wide Prometheus registry, and that test is the existingTestMaintenanceModeKeepsOtherRoutes(internal/server/maintenance_internal_test.go).CLAUDE.mdneeds your approval to change an existing test.Question: may that test be extended (or its
/metricspart moved into a new test) to also check that/metricsanswers 401 with aWWW-Authenticatechallenge without credentials and with a wrong password, and that/metricsreports a request the router served?/metricsgate is then covered where it matters.Model: opus-5-5