Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix stale PR and CI indicators after GitHub CLI confirms that the current branch has no pull request at either repository target. Previously, an expired positive cache survived this result without an mtime update, so each subsequent render could schedule another refresh, with up to two PR lookups per refresh.
Changes
Testing
bun test src/utils/__tests__/git-review-cache.test.ts: 37 passed.bun test: 2,370 passed across 148 files.bun run lint: passed (TypeScript and ESLint).bun run build: passed.git diff --check: passed.Local validation used Bun 1.4.2 on macOS. New tests mock the CLI, cache, and clock: stale-positive to absent transitions, repeated PR/CI reads, lock sharing, TTL boundaries, a later new PR, transient errors, a PR found on origin after default resolution reports absence, mixed absent/error results in both orders, and cross-provider fallback.
Review Focus
The default repository selected by gh may differ from origin. This change preserves those existing lookup targets and does not treat absence from the first target as globally authoritative. When either target is unavailable or returns an unconfirmed result, previously cached display data is retained.
This PR prevents a confirmed absence from causing refreshes on every render; it does not guarantee one
gh pr viewinvocation per TTL. The existing default/origin path still uses up to two ordinary absent-PR lookups per refresh. Reducing that to one safely requires a separate repository-resolution design. Existing CI-field compatibility retries may also add calls.The change intentionally retains the current stale-on-transient-error retry behavior and 30-second TTL. It does not add cache cleanup, change the cache format, or extend GitLab error classification.
Breaking Changes
No configuration or cache migration is required. Existing fork lookup behavior is preserved.
Checklist