Fix GitHub discovery docs: keyword search, not hash search - #54
Merged
Conversation
Section 1.2 was copied from the Software Heritage hash-lookup content and never updated for GitHub. It described a `search/code?q=hash:SWHID` call that does not exist, since GitHub has no content hash or SWHID search. Rewrite the section to describe what the GitHub provider actually does: a repository keyword search against repository metadata via `search/repositories`, not file-content or hash matching. Point hash-based lookup to the Software Heritage section, and correct the search API rate limits to per-minute values. Fixes #53
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.
Fixes #53.
Problem
Section 1.2 "GitHub Repository Search" in
docs/discovery-methods.mdwas copy-pasted from the Software Heritage hash-lookup content and never updated for GitHub. It claimed src2purl finds repositories by searching GitHub's index with a SWHID:That call does not exist. GitHub has no content hash or SWHID search, which is why the reporter could not find it documented or get it to work.
What the code actually does
The GitHub provider (
GitHubSearchProvider) performs a repository keyword search viasearch/repositories, matching repository metadata such as name and description. It never touches file contents, andsearch/codeis not used anywhere. Hash-based lookup is a Software Heritage feature (SWHID), handled by the Software Heritage client.Fix
search/code?q=hash:SWHIDexample and pointed hash-based lookup to section 1.4 (Software Heritage Archive).Possible follow-ups (not in this PR)
hash_search.pycomputes a sha256 that is never searched, and routes hash queries through the repository keyword search where they cannot match. If hash-based file lookup on top of GitHub is wanted, it would need to go through Software Heritage (which supports sha1_git and sha256 content lookups), not GitHub.