mirror of
https://github.com/alibaba/open-code-review.git
synced 2026-07-09 17:28:58 +00:00
* ci(workflow): add rate-limit-aware retry for PR review comment posting Add GitHub REST API rate-limit handling to the ocr-review workflow: - Implement computeRetryDelayMs() following GitHub's documented strategy: * Honor retry-after header (seconds or HTTP-date) * Wait until x-ratelimit-reset when primary limit is exhausted (remaining=0) * Exponential backoff (>=60s base) for secondary limits without a header * Backoff for transient 5xx/408 errors - Add per-comment retry loop with configurable attempts and delays - Add logRateLimitQuota() to log and proactively throttle on low remaining quota - Honor batch createReview rate-limit headers before per-comment retry - Cap all waits (including header-derived) to avoid stalling the CI job - Expose tuning via OCR_* env vars (retries, delays, thresholds) - Update example workflow docs with retry/delay configuration reference * fix(workflow): use shorter transient backoff base and dedupe header lookup - Transient server errors (5xx/408) now use a 2s base delay instead of the 60s rate-limit base, matching the comment's stated intent and avoiding unnecessary CI stalls on short-lived server hiccups. - Extract a shared getHeader() helper for case-insensitive header lookup, reused by both computeRetryDelayMs and logRateLimitQuota to eliminate duplicated logic and ensure consistent robustness. * doc: revert example doc |
||
|---|---|---|
| .. | ||
| ISSUE_TEMPLATE | ||
| workflows | ||
| pull_request_template.md | ||
| release.yml | ||