Skip to content

fix: pass repositoryUrl to PR task picker#1938

Merged
jschwxrz merged 1 commit into
mainfrom
fix-no-prs-showing-zv4li
May 8, 2026
Merged

fix: pass repositoryUrl to PR task picker#1938
jschwxrz merged 1 commit into
mainfrom
fix-no-prs-showing-zv4li

Conversation

@jschwxrz
Copy link
Copy Markdown
Collaborator

@jschwxrz jschwxrz commented May 8, 2026

issue:

  • create-task modal’s “From Pull Request” picker showing no PRs
  • picker enabled its query based on repositoryUrl but did not send it to the backend, so PR lookup could fall back to empty or stale cached project remotes

fix:

  • explicitly pass repositoryUrl to the listPr method

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 8, 2026

Greptile Summary

This PR fixes the "From Pull Request" picker in the create-task modal, which was showing no PRs because repositoryUrl was included in the React Query key and enabled guard but was never forwarded to the backend listPullRequests call. Without it, the service fell back to scanning all cached project remotes, which could resolve to nothing or stale data.

  • Root cause fixed: adds repositoryUrl to the options object passed to rpc.pullRequests.listPullRequests, aligning the call site with the existing usePullRequests hook in pr-view/usePullRequests.ts, which has always forwarded the field correctly.
  • Backend behaviour: PrQueryService.listPullRequests short-circuits to a single-URL filter when options.repositoryUrl is provided, so the query is now both correct and more efficient.

Confidence Score: 5/5

Safe to merge — the change is a minimal, targeted fix that aligns the inline picker with the established pattern used elsewhere in the codebase.

The single-line addition forwards repositoryUrl to the backend exactly as the parallel usePullRequests hook already does. The backend service correctly handles the value (non-empty string narrows the DB query; absent/empty falls back gracefully). No other logic is affected.

No files require special attention.

Important Files Changed

Filename Overview
src/renderer/features/tasks/components/inline-pr-selector.tsx One-line fix: adds repositoryUrl to the listPullRequests options so the backend filters by the correct repository instead of falling back to a project-wide remote scan.

Sequence Diagram

sequenceDiagram
    participant UI as InlinePrSelector
    participant RQ as React Query
    participant IPC as rpc.pullRequests
    participant SVC as PrQueryService

    UI->>RQ: "useQuery (enabled: !!projectId && !!repositoryUrl)"
    RQ->>IPC: "listPullRequests(projectId, { repositoryUrl, filters, limit, offset })"
    Note over IPC,SVC: repositoryUrl is now forwarded (was missing before)
    IPC->>SVC: listPullRequests(projectId, options)
    alt options.repositoryUrl provided (after fix)
        SVC-->>IPC: "filter pullRequests WHERE repositoryUrl = options.repositoryUrl"
    else no repositoryUrl (old behaviour)
        SVC->>SVC: query projectRemotes for projectId
        SVC-->>IPC: filter pullRequests WHERE repositoryUrl IN (all remotes)
    end
    IPC-->>RQ: "{ prs: [...] }"
    RQ-->>UI: render PR list
Loading

Reviews (1): Last reviewed commit: "fix: pass repository url to PR task pick..." | Re-trigger Greptile

@jschwxrz jschwxrz merged commit e229a6d into main May 8, 2026
1 check failed
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.

1 participant