Skip to content

Wrap VercelService API calls with CircuitBreaker to prevent cascade failures #493

@temma02

Description

@temma02

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions