Skip to content

OpenConceptLab/ocl_issues#3097 | A search of all repositories finds one's own private ones - #1128

Open
paynejd wants to merge 2 commits into
masterfrom
ocl_issues-3097-member-repo-search
Open

paynejd wants to merge 2 commits into
masterfrom
ocl_issues-3097-member-repo-search

Conversation

@paynejd

@paynejd paynejd commented Dec 3, 2026

Copy link
Copy Markdown
Member

What changes

Searching all repositories (GET /repos/?q=) finds your own private repositories and those of your organizations, as /sources/?q= and /collections/?q= do. TBv3's Repositories search uses it.

Who is a member is read from the database at each search, so someone who leaves an organization stops finding its private repositories at once. The same rule decides the results, the count and the facets.

A HEAD request for a repository search that finds nothing answers num_found: 0. It used to fail.

How

get_public_criteria adds what owners and members can see for the repository search too. No reindexing is needed.

Tests

SearchMembershipAccessTest runs its searches against /repos/ as well: a source and a collection, of an organization and of a person, for members, former members, others, staff, and people who aren't signed in.

Refs OpenConceptLab/ocl_issues#3097.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AaZ4qUWvM4HRKZktm5NSVk

…ne's own private ones

/repos/?q= has the rule of /sources/?q= and /collections/?q=: the private repositories
of the requester and their organizations, by current membership, in the results, the
count and the facets. A HEAD request for a search that finds nothing answers 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaZ4qUWvM4HRKZktm5NSVk
@paynejd
paynejd requested a review from snyaggarwal December 3, 2026 12:24
@paynejd

paynejd commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

Reviews: a Codex pass, a check of the commit after it and a simplification review, recorded on OpenConceptLab/ocl_online#747. No P0 or P1 of this change is open. One gap in the tests was filled: a person's own collection, and the facets for it.

Lint and the tests of repositories, search access and membership pass. CI runs the rest.

@snyaggarwal snyaggarwal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve. It's small and right. /repos/?q= now adds the same owner and member criteria as /sources/ and /collections/. Its hits still go through get_viewable_hits, because get_search_checks_access was already true for /repos/. So the database decides what's listed, by current membership. Results, num_found and the owner facet follow the same rule. The tests cover members, former members, outsiders, staff and signed-out users, for an org's and a person's source and collection.

Merge order: last of the three, after #1119 and #1120. It merges cleanly onto today's master (3c2e9c1) and onto both. Its HEAD num_found fix is the same line #1119 makes, so there's nothing to resolve whichever goes first.

The points left open from the Codex pass, recorded on OpenConceptLab/ocl_online#747, all predate this PR and are accepted there. They are allVersions counting public releases of private repositories (OpenConceptLab/ocl_online#876), a reused username, and organization names that differ only in case. I have nothing new to add.

This branch has not been deployed

No deployments
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.

2 participants