Skip to content

fix(api): /healthz Cache-Control: no-store (BUG-API-300)#192

Merged
mastermanas805 merged 1 commit into
masterfrom
bug-api-300-healthz-cache-control
May 30, 2026
Merged

fix(api): /healthz Cache-Control: no-store (BUG-API-300)#192
mastermanas805 merged 1 commit into
masterfrom
bug-api-300-healthz-cache-control

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

Summary

  • /healthz is the rule-14 build-SHA gate surface. Without Cache-Control, intermediaries (CF edge, browser fetch cache, NR synthetic) may return a stale commit_id for seconds-to-minutes after a rollout — silently breaking the "did the new image actually land" verification.
  • Stamp Cache-Control: no-store so probes always hit the live pod.

Coverage block

Symptom:        /healthz returns identical JSON every call with no Cache-Control (BUG-API-300)
Enumeration:    rg -F '/healthz' internal/router/router.go (1 emit site)
Sites found:    1 (router.go:414)
Sites touched:  1
Coverage test:  TestHealthzShape asserts resp.Header.Get("Cache-Control") == "no-store"
                so a future deletion of the c.Set call fails before merge.
Live verified:  pending auto-deploy + curl -I https://api.instanode.dev/healthz | grep -i cache-control

Inbox reference

  • BUG-API-300 (P2 — /healthz returns identical JSON every call — no Cache-Control)

Test plan

  • go build ./... clean
  • go vet ./... clean
  • go test ./internal/router/ -short -count=1 green
  • Live verify: curl -I https://api.instanode.dev/healthz | grep -i cache-control returns cache-control: no-store after auto-deploy
  • Live verify rule 14: curl https://api.instanode.dev/healthz | jq -r .commit_id matches the merge SHA

🤖 Generated with Claude Code

/healthz is the rule-14 build-SHA gate surface. Without a Cache-Control
directive, intermediaries (CF edge, browser fetch cache, NR synthetic,
kubectl-port-forward'd browser tab) may return a stale commit_id for
seconds-to-minutes after a rollout, silently breaking the "did the new
image actually land" verification.

Stamp `Cache-Control: no-store` so probes always hit the live pod.

Coverage block:
  Symptom:        /healthz returns identical JSON every call (BUG-API-300)
  Enumeration:    rg -F '/healthz' internal/router/router.go (1 emit)
  Sites found:    1 (router.go:414)
  Sites touched:  1
  Coverage test:  TestHealthzShape pins Cache-Control: no-store header so
                  a future deletion of c.Set(HeaderCacheControl, "no-store")
                  fails before merge.
  Live verified:  pending auto-deploy + curl https://api.instanode.dev/healthz
                  -I | grep -i cache-control

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mastermanas805 mastermanas805 merged commit d25ea33 into master May 30, 2026
14 checks passed
@mastermanas805 mastermanas805 deleted the bug-api-300-healthz-cache-control branch May 30, 2026 08:49
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