Repository navigation
feat(pulls): say why the pull request page is empty - #249
Conversation
The page said "No pull requests yet" whether GitHub was never connected or connected and simply carrying nothing that named an issue. Those need different answers and the page gave neither. Read whether the workspace has an enabled repository and answer the two cases apart: offer a way to connect, or say that a pull request links when its branch or title names an issue. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThe pulls page now evaluates GitHub installation and repository reachability while loading pull requests. It passes the result and integration-management permission to the pulls view, which renders state-specific empty states. ChangesPulls reachability flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant PullsPage
participant githubReach
participant PullsRealtime
participant PullsView
PullsPage->>githubReach: request GitHub reachability
githubReach-->>PullsPage: return GithubReach
PullsPage->>PullsRealtime: pass reach and canManageIntegrations
PullsRealtime->>PullsView: forward reach and permission
PullsView-->>PullsPage: render status-specific empty state
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Checking only for repository sync rows called a workspace that had installed the app but tracked no repository "not connected", and pointed it at a connect flow it had already been through. Read the integration too and answer the three cases apart. A member who cannot manage integrations is told a workspace admin has to do it rather than being handed a button that leads somewhere they cannot act. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
A suspended installation keeps its rows, so reading only the presence of an installation told an admin to go and pick repositories while GitHub was refusing to send anything at all. Read the installation status and answer suspension on its own terms. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Reading repositories first returned connected before suspension was ever considered, so a workspace whose installation GitHub had suspended was told its pull requests simply named no issue, while nothing was arriving at all. Read both, and answer suspension first. Cover the order with tests against a real database, including the case that was wrong. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Counting installations and repositories separately let an active installation with nothing tracked borrow a repository belonging to a suspended one, and report connected while nothing was arriving. Match a tracked repository to an active installation by integration before calling the workspace connected. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/web/tests/features/pulls/github-reach.test.ts`:
- Around line 51-53: Add a test fixture near the existing githubReach cases that
creates an integration and an enabled githubRepositorySync for the workspace
without creating a githubInstallation, then assert githubReach returns
“connected”; keep the existing never-connected test unchanged and use the
repository’s established fixture helpers.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 368abcbc-700f-4115-95b5-7829e60c61b5
📒 Files selected for processing (6)
apps/web/src/app/(app)/pulls/page.tsxapps/web/src/features/pulls/data.tsapps/web/src/features/pulls/pulls-realtime.tsxapps/web/src/features/pulls/pulls-view.tsxapps/web/tests/features/pulls/github-reach.test.tsapps/web/tests/features/pulls/pulls-view.test.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- apps/web/tests/features/pulls/pulls-view.test.tsx
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The report
"Why does the pull request page look like nothing? We have merged so many PRs."
What is actually happening
Nothing is broken.
/pullsreadsgit_linkrows joined to issues, andapplyGithubEventcreates agit_linkonly when the pull request's branch or title names an Orbit issue:Checked against the branches we actually merged:
feat/team-settingsfix/peek-holds-openchore/clickable-affordancesfeat(issues): let the properties panel take you to what it namesshashank/eng-42-fan-out-delta-packetsNone of our own pull requests ever named an issue, so none could link, so the page is empty and correct. The problem is that the page never said so.
What changed
The empty state now answers the two cases apart, driven by whether the workspace has an enabled
github_repository_syncrow.No repository connected: "No repository is connected yet", with a Connect GitHub button to
/settings/integrations.Connected, nothing linked: "No pull requests linked to your issues", explaining that a pull request links when its branch or title names an issue like ENG-42, and pointing at Copy branch name, which produces exactly that.
Tests
2 new covering both states, and the existing two updated for the new prop.
bun run verifygreen.Worth knowing
This is presentation only. If you want our own pull requests to appear, the branch has to name the issue, which is what Copy branch name on an issue is for. PR #184 widens matching to issues named in the pull request body, which would also help.
🤖 Generated with Claude Code
Greptile Summary
The PR explains why the pull-request page is empty by distinguishing GitHub installation, suspension, repository-selection, and issue-linking states.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Load pulls page] --> B{Any GitHub installations?} B -- No --> C{Enabled repository sync exists?} C -- No --> D[Not installed] C -- Yes --> E[Connected legacy state] B -- Yes --> F{Any active installation?} F -- No --> G[Suspended] F -- Yes --> H{Enabled repository belongs to active installation?} H -- No --> I[No repositories] H -- Yes --> J[Connected] D --> K{Can manage integrations?} G --> K I --> K K -- Yes --> L[Show settings action] K -- No --> M[Explain that an admin must act] E --> N[Explain issue identifier linking] J --> NReviews (7): Last reviewed commit: "chore: merge main" | Re-trigger Greptile