Guard github name resolver against empty organization

When a GitHub access-source connector has no organization configured
yet (user finished OAuth but abandoned the picker), the source-name
worker called https://api.github.com/orgs/ and got a 404 every 10
seconds, flooding logs. All other picker resolvers (sentry, gitlab,
bitbucket, heroku, asana, netlify, clickup, vercel) short-circuit to
("", nil) for empty settings -- this aligns github with them so the
worker falls into its existing "empty instance name -> mark synced
with generic name" branch instead of retrying forever.

Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
This commit is contained in:
Aurélien Sibiril
2026-05-23 12:10:37 +02:00
committed by Émile Ré
parent 6e7c96732f
commit 79bc5aa79e
2 changed files with 88 additions and 0 deletions

View File

@@ -552,6 +552,10 @@ func NewGitHubNameResolver(httpClient *http.Client, org string) NameResolver {
}
func (r *githubNameResolver) ResolveInstanceName(ctx context.Context) (string, error) {
if r.org == "" {
return "", nil
}
endpoint, err := url.JoinPath("https://api.github.com", "orgs", url.PathEscape(r.org))
if err != nil {
return "", fmt.Errorf("cannot build github organization URL: %w", err)