Skip to content

cmd/zoekt-mirror-gitea: skip GetUserInfo when no user or org is specified#1045

Merged
keegancsmith merged 1 commit intosourcegraph:mainfrom
ddrpa:main
Apr 13, 2026
Merged

cmd/zoekt-mirror-gitea: skip GetUserInfo when no user or org is specified#1045
keegancsmith merged 1 commit intosourcegraph:mainfrom
ddrpa:main

Conversation

@ddrpa
Copy link
Copy Markdown
Contributor

@ddrpa ddrpa commented Apr 11, 2026

Problem

When zoekt-mirror-gitea is configured with only a GiteaURL (without a specific user or organization), the tool attempts to fetch repositories by calling getUserRepos(client, "", ...) with an empty user string which causes the tool to fail with failed: exit status 1.

Fix

Add getAllRepos method.

Test

Verified on a self-hosted Gitea instance (v1.25.2), the tool successfully iterates through all paginated repository results, and begins the mirroring process as expected.

…positories when use Gitea without setting user or organization
Copilot AI review requested due to automatic review settings April 11, 2026 05:39
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes zoekt-mirror-gitea failing when configured with only --url (no --user or --org) by adding an “all repositories” fetch path that avoids calling GetUserInfo with an empty username.

Changes:

  • Switch the “no user or org specified” path to call a new getAllRepos function instead of getUserRepos(..., "").
  • Add getAllRepos, which paginates through SearchRepos results and applies the existing archived-repo filter.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Member

@keegancsmith keegancsmith left a comment

Choose a reason for hiding this comment

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

Thanks

@keegancsmith keegancsmith merged commit e7773a4 into sourcegraph:main Apr 13, 2026
12 of 13 checks passed
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.

3 participants