ldap-sync: GrowthBook API client

REST client for the GrowthBook public API. HTTP Basic auth with a custom User-Agent (WMF's edge proxy blocks generic python-requests UAs). Sleep-based leaky-bucket rate limiter with a small initial burst budget for paginated reads.

Retry behavior:

  • 429/5xx: exponential backoff honoring Retry-After as a floor (our backoff can exceed it, but never wait less). Capped at max_retries (default 5) per call.
  • 401/403: hard-fail immediately (don't continue with partial state).
  • Run-level deadline (SYNC_DEADLINE_SECONDS): checked before each retry attempt. Raises DeadlineExceededError so the CLI can exit gracefully with code 6 rather than being SIGKILLed by the k8s activeDeadlineSeconds.

Pagination buffers a full traversal before returning. On count/total mismatch, retries once (replacing, not appending) and aborts if the retry is internally inconsistent. Malformed pagination metadata aborts immediately.

Bug: T420691

Merge request reports

Loading