Skip to content

feat(code): add method for finding PR for branch#1861

Merged
adboio merged 1 commit intomainfrom
04-23-feat_code_add_method_for_finding_pr_for_branch
Apr 24, 2026
Merged

feat(code): add method for finding PR for branch#1861
adboio merged 1 commit intomainfrom
04-23-feat_code_add_method_for_finding_pr_for_branch

Conversation

@adboio
Copy link
Copy Markdown
Contributor

@adboio adboio commented Apr 23, 2026

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 getPrUrlForBranch and useLinkedBranchPrUrlso we can easily fetch a PR for a local task

How did you test this?

tested upstack

Copy link
Copy Markdown
Contributor Author

adboio commented Apr 23, 2026

@adboio adboio requested a review from a team April 23, 2026 13:43
@adboio adboio marked this pull request as ready for review April 23, 2026 14:34
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 23, 2026

Prompt To Fix All 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.

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,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

@adboio adboio force-pushed the 04-23-feat_code_add_method_for_finding_pr_for_branch branch from 331a490 to 73e2848 Compare April 23, 2026 19:21
Copy link
Copy Markdown
Contributor

@jonathanlab jonathanlab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Copy link
Copy Markdown
Contributor Author

adboio commented Apr 24, 2026

Merge activity

  • Apr 24, 1:56 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 24, 1:56 PM UTC: @adboio merged this pull request with Graphite.

@adboio adboio merged commit dd0c702 into main Apr 24, 2026
16 checks passed
@adboio adboio deleted the 04-23-feat_code_add_method_for_finding_pr_for_branch branch April 24, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants