mirror of
https://github.com/stablyai/orca.git
synced 2026-10-23 08:03:39 +00:00
Tier GitHub PR lookup polling to prevent quota exhaustion (#12013)
* Tier GitHub PR lookup polling to prevent quota exhaustion The selected worktree (O(1)) checks per-minute; card list (O(N)) per-15-minutes. Introduce process-wide cache to collapse concurrent polling and gate lookups on available rate-limit budget with exponential backoff on failure. - Preserve last-known review during backoff - Invalidate cache when Orca opens a PR - Stop coordinator from double-charging * Tier GitHub PR lookup polling to prevent quota exhaustion - Return the latest reset time when both GitHub API buckets are rate-limited, preventing premature retries against still-blocked buckets. - Serve the last known review on transient lookup failures, preventing reviews from blinking out on temporary errors. - Discard in-flight lookups that predate an invalidation so stale answers cannot overwrite newly opened reviews. * fix: give rate-limit reset tests unique titles oxlint vitest/no-identical-title was failing static analysis because two cases shared the same describe title.
This commit is contained in:
@@ -649,18 +649,9 @@ describe('pr-refresh-coordinator', () => {
|
||||
'graphql',
|
||||
executionOptions
|
||||
)
|
||||
expect(noteRepositoryRateLimitSpendMock).toHaveBeenCalledWith(
|
||||
testCase.repository,
|
||||
'core',
|
||||
1,
|
||||
executionOptions
|
||||
)
|
||||
expect(noteRepositoryRateLimitSpendMock).toHaveBeenCalledWith(
|
||||
testCase.repository,
|
||||
'graphql',
|
||||
1,
|
||||
executionOptions
|
||||
)
|
||||
// Why (#11532): the lookup itself debits the snapshot now, so every caller
|
||||
// is accounted for; the coordinator must not double-charge on top.
|
||||
expect(noteRepositoryRateLimitSpendMock).not.toHaveBeenCalled()
|
||||
expect(getPRForBranchOutcomeMock).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user