Repository navigation
Say a repository is untracked instead of blaming branch naming - #269
Merged
imshashank merged 3 commits intoAug 9, 2026
Merged
imshashank merged 3 commits into
imshashank merged 3 commits into
Conversation
…aming githubReach was org wide: it returned "connected" when any enabled repository sync row shared an active installation. With three unrelated repositories associated and the repository actually being worked in not associated at all, the empty pull requests page asserted a cause it cannot know, that no branch names an issue. The real cause was that the repository was never tracked, so every pull_request delivery returned repository_not_connected while GitHub recorded a 200. Nothing looked wrong from either side. Reach now separates "everything GitHub can see is tracked" from "GitHub can see repositories nobody switched on", and the new state says plainly that those deliveries are dropped on arrival. Archived repositories and those only a suspended installation can see are excluded, because neither will ever open a pull request. The empty state also always offers the route to the integrations page, which the previous final branch omitted, leaving an admin who reached it with nowhere to go. NOV-197
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThe pull request adds ChangesGitHub reach status
Pull request empty state
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant PullsView
participant githubReach
participant RepositoryDatabase
PullsView->>githubReach: request GitHub reach state
githubReach->>RepositoryDatabase: query tracked and visible repositories
RepositoryDatabase-->>githubReach: return repository sets
githubReach-->>PullsView: return reach classification
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 |
…or another Measured against the workspace this was written for, the new state was permanently true: 9 of 24 unarchived repositories are tracked, and the other 15 are deliberately not. reachableButUntracked therefore never returns false, the untracked copy renders forever, and the copy for a fully tracked workspace becomes unreachable. That repeats the original mistake in a new place. The page asserted naming was the cause and could not know it; asserting the repository is the cause is wrong in exactly the same way, because an untracked repository is usually a deliberate choice rather than an oversight. Both conditions are now stated together, so the page says what has to be true instead of ruling on which one failed. The part worth keeping is the part nobody could have guessed: a delivery from an untracked repository is dropped while GitHub still reports it accepted. NOV-197
…a-repository-is-untracked-instead-of-blaming
imshashank
deleted the
shashank/nov-197-say-a-repository-is-untracked-instead-of-blaming
branch
August 9, 2026 10:52
This branch was successfully deployed
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.
Why
The pull requests page told an admin, with confidence, that no branch names an issue. It could not know that. The workspace it was rendering for had
Noveum/orbitconnected to GitHub but never tracked in Orbit, so everypull_requestdelivery for it was answered like this:GitHub recorded a 200 for all of them. Nothing looked wrong from either side, and the page pointed at branch naming, which was the wrong thing to go and fix.
The mistake in
githubReachIt asks an org-wide question:
Any one enabled repository sync row sharing an active installation returns
connected. Three unrelated repositories were associated, so the workspace looked healthy while the repository actually being worked in was invisible to the check. The signal that mattered, "GitHub can see repositories nobody switched on", was never computed.What changes
A new reach state sits between
connectedandno_repositories:no_repositoriesrepositories_untrackedconnectedIts copy says the part that was missing: a delivery from an untracked repository is dropped on arrival and GitHub reports it as accepted.
Two exclusions, so the state means something. An archived repository and one only a suspended installation can see are both left out, because neither will ever open a pull request and nagging about them would train people to ignore the state.
The empty state also always offers the route to
/settings/integrations. The previous final branch omitted the action entirely, so an admin who reached the page had nowhere to go.PullsEmptyStatebecame a lookup rather than a chain of conditionals. Adding a fifth branch to the chain crossed the cognitive complexity limit, and the copy for five states reads better as a table than as nested returns.Cost
One extra indexed query, and only on the path that was about to return
connected. Every other reach state returns before it.Tests
9 new. 5 against a real database on
githubReach, of which 3 are false positive guards: an archived repository, a repository only a suspended installation can see, and the case where nothing is tracked at all must all stay off the new state. 4 on the empty state, covering the new copy, the admin action, and the member who cannot act on it.Checked that they fail without the change: reverting the two source files takes 24 passing to 20 passing and 4 failing, and the 4 are exactly the ones asserting new behaviour.
bun run verifygreen.Not in this PR
Associating a repository does not backfill the pull requests that already exist, because
applyGithubEventis the only writer ofgit_linkand the webhook route is its only caller. A workspace that fixes its association sees the page fill up from the next event, not immediately. That is worth its own issue rather than a change here.Greptile Summary
This PR distinguishes repositories visible to active GitHub installations but not tracked by Orbit, replacing misleading branch-naming guidance with an actionable repository-tracking state.
repositories_untrackedreach detection while excluding archived repositories and suspended installations.Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Evaluate GitHub installations] --> B{Any installations?} B -- No --> C[not_installed] B -- Yes --> D{Any active installation?} D -- No --> E[suspended] D -- Yes --> F{Any tracked repository on an active installation?} F -- No --> G[no_repositories] F -- Yes --> H{Active non-archived visible repository is untracked?} H -- Yes --> I[repositories_untracked] H -- No --> J[connected]Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile