Skip to content

test(oauth-proxy): don't fail CI when a live upstream is unreachable#4182

Merged
viktormarinho merged 1 commit into
mainfrom
viktormarinho/oauth-proxy-tolerate-upstream
Jun 28, 2026
Merged

test(oauth-proxy): don't fail CI when a live upstream is unreachable#4182
viktormarinho merged 1 commit into
mainfrom
viktormarinho/oauth-proxy-tolerate-upstream

Conversation

@viktormarinho

@viktormarinho viktormarinho commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Problem

apps/mesh/src/api/routes/oauth-proxy.integration.test.ts (run in the blocking storage-integration gate) proxies OAuth metadata / authorize redirects from ~13 live third-party MCP servers (Stripe, OpenRouter, Notion, Supabase, Vercel, …) and asserts the proxy's discovery/rewriting contract (200/302).

When one of those servers is slow or down, the proxy correctly returns 502 (bad gateway), but the test asserted 200/302 → red gate. This is a recurring external-dependency flake — the OpenRouter .well-known fetch timing out at ~12s has now blocked unrelated PRs (#4180, #4181).

Fix

Skip a server's contract assertions when the proxy reports the upstream is unreachable (HTTP 502, which none of these tests ever expects), with a loud console.warn. Applied uniformly to all four live-server loops (protected-resource metadata, auth-server metadata, authorize redirect, resource-param rewrite).

  • Every reachable server is still fully asserted.
  • Any non-502 status flows through to the real expectations, so a genuine proxy regression is never masked — only third-party outages stop reddening the merge gate.

No production code touched; tsc + oxlint clean.

🤖 Generated with Claude Code


Summary by cubic

Make the OAuth proxy E2E tests tolerant of live upstream outages by skipping a server’s assertions when the proxy returns 502 (upstream unreachable). This prevents flaky CI from third‑party downtime while keeping full checks for reachable servers.

  • Bug Fixes
    • Added a helper to detect 502 responses and log a warning, then skip that server’s assertions.
    • Applied to all live-server checks: protected-resource metadata, authorization-server metadata, authorize redirect, and resource param rewrite.
    • Non-502 responses still run existing expectations; no production code changed.

Written for commit 642ec21. Summary will update on new commits.

Review in cubic

The MCP OAuth Proxy E2E suite proxies metadata / authorize redirects from ~13
LIVE third-party servers (Stripe, OpenRouter, Notion, Supabase, …) and asserts
the proxy's discovery/rewriting contract. When one of those servers is slow or
down, the proxy correctly returns 502 (bad gateway), but the test asserted 200/
302 and reddened the `storage-integration` gate — a recurring flake that has
blocked unrelated PRs (the OpenRouter `.well-known` fetch timing out at ~12s).

Skip a server's contract assertions when the proxy reports the upstream is
unreachable (HTTP 502, which none of these tests ever expects), with a loud
warning. Every reachable server is still fully asserted, and any non-502 status
flows through to the real expectations, so a genuine proxy regression is never
masked — only third-party outages stop blocking the merge gate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@viktormarinho viktormarinho merged commit 017e2f0 into main Jun 28, 2026
15 checks passed
@viktormarinho viktormarinho deleted the viktormarinho/oauth-proxy-tolerate-upstream branch June 28, 2026 20:24
decocms Bot pushed a commit that referenced this pull request Jun 28, 2026
PR: #4182 test(oauth-proxy): don't fail CI when a live upstream is unreachable
Bump type: patch

- decocms (apps/mesh/package.json): 3.67.1 -> 3.67.2

Deploy-Scope: server
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