Skip to content

feat(promote): add rollout config, traffic-allocation client and splitting probe - #86

Open
scott-lowe-vapi wants to merge 1 commit into
mainfrom
gradual-deploy-rollout-config
Open

scott-lowe-vapi wants to merge 1 commit into
mainfrom
gradual-deploy-rollout-config

Conversation

@scott-lowe-vapi

@scott-lowe-vapi scott-lowe-vapi commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Support partial GitOps promotions using traffic splitting

Part of DEPLOY-205: opt-in gradual rollouts (1 → 5 → 10 → 25 → 50 → 100%) for promotions, built on traffic allocations. 1 of 5; this PR changes no promotion behaviour.

What changes

  • rollout: in promotion.yml (src/promotion.ts): per destination org, steps (default [1, 5, 10, 25, 50, 100]) and intervalMinutes (default 30, at least 15). Steps must increase, end at 100, and have at most three decimal places (the API's 0.001% granularity). Unknown keys fail, like the rest of the org block.
  • src/rollout-api.ts: a config-free traffic-allocation client (assistant latest version and Vapi for CX lock, latest allocation, compare-and-set create, per-org probe). Writes retry only on 429, because a 5xx may follow a committed write.
  • Per-write labels (src/user-agent.ts): each allocation write sends its own x-vapi-client command (rollout-pin, rollout-step, rollout-complete, rollout-hold, rollout-abort, rollout-release, rollout-restore), so the platform's [traffic] allocation saved event says which kind of write it was (paired with VapiAI/vapi#25250, which adds the split shares). Only rollout joins COMMANDS, so an env var can't label a whole process rollout-abort.
  • Probe: promote --apply checks every rollout org has traffic splitting (a per-org beta) before anything applies.
  • DEFAULT_BASE_URL is now exported once from vapi-client.ts instead of being copied into promotion-gate.ts and check-cmd.ts.

Evidence

  • tests/rollout-config.test.ts (defaults, custom values, 11 rejections), tests/rollout-api.test.ts (labels, no 5xx retry on writes, 404/403 handling, 409 classification against a local HTTP stub) and tests/promote-rollout.test.ts (probe refuses before any child runs, plans make no API calls). npm run build and npm test pass: 609 tests.

🤖 Generated with Claude Code

…tting probe

An org in promotion.yml can now declare rollout: (steps and interval). This
adds the parsing, a config-free traffic-allocation client whose writes each
carry their own x-vapi-client command (rollout-pin, rollout-step, ...), and
an --apply check that every rollout org has traffic splitting enabled. The
next commits use them to ramp a promotion instead of cutting over at once.

Part of DEPLOY-205.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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