Skip to content

Fix issue with private repositories not being indexed#1

Merged
brendan-kellam merged 3 commits intomainfrom
bkellam/user-private-repo-fix
Oct 1, 2024
Merged

Fix issue with private repositories not being indexed#1
brendan-kellam merged 3 commits intomainfrom
bkellam/user-private-repo-fix

Conversation

@brendan-kellam
Copy link
Copy Markdown

Issue template for later::

Problem

When running zoekt-mirror-github with the -user flag specified, private repositories are not indexed even when a valid .github-token file is present.

Repro steps:

  1. Create ~/.github-token with a valid PAT token
  2. Run the following command:
    zoekt-mirror-github -dest data -delete -user userName
  3. Observe the repositories indexed

Expected:

All repositories (both public and private) associated with the user should be indexed.

Actual:

Only public repositories are indexed

How this PR fixes it:
By using a empty string for the user, the go github library will fallback on using the users/repos endpoint instead of the users/{user-name}/repos endpoint. For whatever reason, the latter does not return private repositories even when a authentication token is provided. The former does. Thus, this is a quick n' dirty fix that gets around this issue.

From the github library:
image

@brendan-kellam brendan-kellam merged commit 54eeade into main Oct 1, 2024
@brendan-kellam brendan-kellam deleted the bkellam/user-private-repo-fix branch October 1, 2024 03:51
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.

1 participant