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:
committed by
Émile Ré
parent
6e7c96732f
commit
79bc5aa79e
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user