Skip to content

fix: send the staging pinger with manual redirects - #678

Merged
thomasluizon merged 1 commit into
mainfrom
fix/ticket-1009-pinger-manual-redirect
Oct 1, 2026
Merged

thomasluizon merged 1 commit into
mainfrom
fix/ticket-1009-pinger-manual-redirect

Conversation

@thomasluizon

Copy link
Copy Markdown
Owner

Cloudflare's Workers runtime rejects redirect: "error" when it constructs the Request ("Invalid redirect value, must be one of "follow" or "manual""), so every scheduled staging health ping would fail before it reached https://api-staging.useorbit.org/health. Node's Request, which the unit tests use, accepts "error", which is why the suite stayed green.

The Worker now sends redirect: "manual". The existing response.ok check already fails the invocation on any 3xx response, and a new test proves a redirect response fails the invocation instead of being followed. infra/README.md describes the behaviour.

Found by Pullfrog on the redesign carry (#677, thread on infra/workers/staging-pinger.mjs:29). By the carry rule, the fix lands on main first and is cherry-picked into the carry.

Refs thomasluizon/orbit-tickets#1009

Test evidence

  • With the old redirect: "error" and the updated assertion, node --test infra/staging-pinger.test.mjs: 14 pass, 1 fail (the request option assertion).
  • After the fix: node --test infra/staging-pinger.test.mjs 15 pass; node --test infra/*.test.mjs 34 pass, 0 fail.
  • Runtime evidence: Pullfrog's probe on workerd 2026-10-01 with compatibility date 2026-09-30 constructed the pinger's Request with each redirect mode; manual was accepted and error threw before any network I/O.

Assumptions

  • manual plus the existing non-success check is the correct way to refuse redirects at the edge, as the runtime's own error message recommends. Rejected follow, which would let a redirect hide an unhealthy staging host.

Manual steps

None. The Worker is not deployed yet: its targeted apply still waits on Workers Scripts Edit for the Cloudflare token (#1009).

🤖 Generated with Claude Code

Cloudflare's runtime rejects redirect: "error" when it builds the Request,
so every scheduled ping failed before reaching staging /health. Manual
mode is accepted, and the existing response.ok check still fails the
invocation on a 3xx response, now covered by its own test.

Refs thomasluizon/orbit-tickets#1009

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes Reviewed the staging pinger’s redirect policy, regression tests, and deployment documentation.

  • Manual redirects: infra/workers/staging-pinger.mjs uses redirect: "manual", preserving the existing non-success rejection and failure logging without following redirects.
  • Regression coverage: infra/staging-pinger.test.mjs asserts the exact redirect option and verifies that a 301 response rejects the invocation and retains its status in the failure log.
  • Documentation: infra/README.md describes the manual redirect policy. All 34 infrastructure unit tests passed with node --test infra/*.test.mjs; Cloudflare’s Request contract confirms that manual mode returns 3xx responses as-is. Live Worker deployment was not exercised.

Pullfrog  | View workflow run | Using openai/gpt-6.1-sol | 𝕏

@sonarqubecloud

sonarqubecloud Bot commented Oct 1, 2026

Copy link
Copy Markdown

@thomasluizon
thomasluizon merged commit 41d8064 into main Oct 1, 2026
27 checks passed
@thomasluizon
thomasluizon deleted the fix/ticket-1009-pinger-manual-redirect branch October 1, 2026 02:54
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