Api: order remote repositories by import usefulness - #13245
Draft
ericholscher wants to merge 1 commit into
Draft
Conversation
The list backed the dashboard's repository picker alphabetically, so the first page was whichever organization sorts first. Order importable repositories first, sink ones that already have a project, and boost documentation-looking names, with the previous alphabetical order as the tiebreak. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019yjYstmBb2HiscZUc5eKH4
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.
The remote repositories endpoint backs the dashboard's repository picker, and it ordered purely alphabetically — so the first page a new user sees is whichever organization sorts first, not anything they're likely to import. This orders repositories the user can actually import first, sinks repositories that already have a project, and boosts documentation-looking names, keeping the previous alphabetical order as the tiebreak.
This changes the endpoint's default ordering for all consumers, which I'd argue is an improvement everywhere it's used, but it's worth a conscious yes. The new signals are two indexed
EXISTSannotations plus a name match on the already per-user-filtered queryset, so the query cost is unchanged in practice. A signal that would sharpen this further — repository activity — isn't possible today because we don't sync anything likepushed_at; that would make a good follow-up.Pairs with the ext-theme change that shows a browsable repository list on the add project page, which is what makes first-page ordering matter.
Generated by Claude Code