Skip to content

Fix GitHub discovery docs: keyword search, not hash search - #54

Merged
oscarvalenzuelab merged 1 commit into
mainfrom
docs/fix-github-discovery-section
Jul 22, 2026
Merged

Fix GitHub discovery docs: keyword search, not hash search#54
oscarvalenzuelab merged 1 commit into
mainfrom
docs/fix-github-discovery-section

Conversation

@oscarvalenzuelab

Copy link
Copy Markdown
Collaborator

Fixes #53.

Problem

Section 1.2 "GitHub Repository Search" in docs/discovery-methods.md was 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:

GET https://api.github.com/search/code?q=hash: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 via search/repositories, matching repository metadata such as name and description. It never touches file contents, and search/code is not used anywhere. Hash-based lookup is a Software Heritage feature (SWHID), handled by the Software Heritage client.

Fix

  • Rewrote section 1.2 to describe the GitHub provider as a keyword search against repository metadata, not a hash or content search.
  • Removed the fictional search/code?q=hash:SWHID example and pointed hash-based lookup to section 1.4 (Software Heritage Archive).
  • Corrected the search API rate limits to their per-minute values (10/min unauthenticated, 30/min authenticated).

Possible follow-ups (not in this PR)

  • hash_search.py computes 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.

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
@cla-bot cla-bot Bot added the cla-signed label Jul 22, 2026
@oscarvalenzuelab
oscarvalenzuelab merged commit 843ae0a into main Jul 22, 2026
8 checks passed
@oscarvalenzuelab
oscarvalenzuelab deleted the docs/fix-github-discovery-section branch July 22, 2026 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitHub hash file search?

1 participant