feat(code): add method for finding PR for branch#1861
Merged
Conversation
Contributor
Author
Prompt To Fix All With AIThis is a comment left during a code review.
Path: apps/code/src/renderer/features/git-interaction/hooks/useLinkedBranchPrUrl.ts
Line: 24-26
Comment:
**Unnecessary polling once URL is found**
`refetchInterval: 5 * 60_000` keeps firing network requests even after a PR URL has been successfully resolved. Since a PR URL is stable once it exists, you could stop polling after the first successful (non-null) result to avoid the extra `gh pr list` calls.
```suggestion
enabled: !!folderPath && !!linkedBranch,
staleTime: 60_000,
refetchInterval: (query) =>
query.state.data ? false : 5 * 60_000,
retry: 1,
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "feat(code): add method for finding PR fo..." | Re-trigger Greptile |
Comment on lines
+24
to
+26
| staleTime: 60_000, | ||
| refetchInterval: 5 * 60_000, | ||
| retry: 1, |
There was a problem hiding this comment.
Unnecessary polling once URL is found
refetchInterval: 5 * 60_000 keeps firing network requests even after a PR URL has been successfully resolved. Since a PR URL is stable once it exists, you could stop polling after the first successful (non-null) result to avoid the extra gh pr list calls.
Suggested change
| staleTime: 60_000, | |
| refetchInterval: 5 * 60_000, | |
| retry: 1, | |
| enabled: !!folderPath && !!linkedBranch, | |
| staleTime: 60_000, | |
| refetchInterval: (query) => | |
| query.state.data ? false : 5 * 60_000, | |
| retry: 1, |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/git-interaction/hooks/useLinkedBranchPrUrl.ts
Line: 24-26
Comment:
**Unnecessary polling once URL is found**
`refetchInterval: 5 * 60_000` keeps firing network requests even after a PR URL has been successfully resolved. Since a PR URL is stable once it exists, you could stop polling after the first successful (non-null) result to avoid the extra `gh pr list` calls.
```suggestion
enabled: !!folderPath && !!linkedBranch,
staleTime: 60_000,
refetchInterval: (query) =>
query.state.data ? false : 5 * 60_000,
retry: 1,
```
How can I resolve this? If you propose a fix, please make it concise.
This was referenced Apr 23, 2026
331a490 to
73e2848
Compare
Contributor
Author
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.

Problem
now that local tasks have linked branches, we can find PR details
but we need a lil bit of infra to find a PR for an arbitrary branch
Changes
adds
getPrUrlForBranchanduseLinkedBranchPrUrlso we can easily fetch a PR for a local taskHow did you test this?
tested upstack