Repository navigation
index: match listed repositories by ID when available - #1296
Merged
keegancsmith merged 2 commits intoNov 26, 2026
Merged
Conversation
Signed-off-by: Perfloop Agent <[email protected]>
Signed-off-by: Perfloop Agent <[email protected]>
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.
Listing repositories in a compound shard can include repositories that do not match the query when they share a name with a matching repository. Those extra repositories also inflate the aggregate statistics. With IDs 0, 1 and 2 all named
same-name, for example, an ID-1 query previously listed all three repositories; it now lists only ID 1.cc @camdencheek @keegancsmith
indexData.Listnow records nonzero repository IDs from the bounded search and checks those IDs when selecting entries. Matches from repositories without an ID go into a separate name set, so the legacy path cannot select a same-named repository with a nonzero ID, or vice versa. The existing entries still supply metadata, branches and statistics in both output formats. Tenant access checks and tombstone filtering are unchanged.The tests in
index/index_test.gocover same-named repositories with mixed zero/nonzero IDs, query-specific selection and complete statistics in both formats. The existing content-listing test also covers distinct names with unset IDs while retaining its simple-shard case.Go tests for index listing, sharded listing and
type:repoquery evaluation passed.Repositories without IDs still use name-based matching.
go test ./...passes locally with the change based on7b032f67and onb55ce727.Case and evidence
Made by Perfloop. Human sponsor: Tomás Senart.