Description
CircuitBreaker is implemented and tested but VercelService calls the Vercel API directly without any circuit-breaking. A Vercel outage causes all deployment requests to hang until timeout, blocking the entire pipeline queue.
Requirements and context
- Must be secure, tested, and documented where applicable
- Should stay reviewable and fit the current monorepo structure
- Relevant files:
apps/backend/src/lib/api/circuit-breaker.ts, apps/backend/src/services/vercel.service.ts, apps/backend/tests/chaos/external-services.chaos.test.ts
Suggested execution
- Create branch:
issue-019-circuit-breaker-vercel-api-calls
- Keep changes scoped to the issue and reference the task IDs in the PR
Implement changes
- Inject a
CircuitBreaker instance into VercelService constructor
- Wrap
request() with breaker.call()
- Expose circuit state in the health-check cron response so ops can observe it
Test and commit
- Extend
external-services.chaos.test.ts with Vercel-specific open/half-open/closed transitions
- Verify
CircuitOpenError is surfaced as a retryable pipeline error
- Edge case: circuit opens mid-deployment — pipeline should fail fast, not hang
Example commit message
feat(vercel): wrap API calls with circuit breaker
Guidelines
- Prefer small, reviewable PRs
- Keep naming and data contracts consistent with the spec docs
Description
CircuitBreakeris implemented and tested butVercelServicecalls the Vercel API directly without any circuit-breaking. A Vercel outage causes all deployment requests to hang until timeout, blocking the entire pipeline queue.Requirements and context
apps/backend/src/lib/api/circuit-breaker.ts,apps/backend/src/services/vercel.service.ts,apps/backend/tests/chaos/external-services.chaos.test.tsSuggested execution
issue-019-circuit-breaker-vercel-api-callsImplement changes
CircuitBreakerinstance intoVercelServiceconstructorrequest()withbreaker.call()Test and commit
external-services.chaos.test.tswith Vercel-specific open/half-open/closed transitionsCircuitOpenErroris surfaced as a retryable pipeline errorExample commit message
Guidelines