Name Heroku personal account without an API call

GET /teams/@personal 404s, which would loop the source-name worker the
same way a stale Sentry slug did. Short-circuit the personal-account
slug to a static name before any HTTP call.

Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
This commit is contained in:
Aurélien Sibiril
2026-05-28 22:22:46 +02:00
parent e467060056
commit e0c53e7a51
2 changed files with 42 additions and 0 deletions

View File

@@ -726,6 +726,12 @@ func (r *herokuNameResolver) ResolveInstanceName(ctx context.Context) (string, e
return "", nil
}
// A personal account has no Team to name; short-circuit before hitting
// GET /teams/@personal, which 404s and would loop the source-name worker.
if r.teamID == herokuPersonalAccountSlug {
return herokuPersonalAccountDisplayName, nil
}
endpoint, err := url.JoinPath("https://api.heroku.com", "teams", url.PathEscape(r.teamID))
if err != nil {
return "", fmt.Errorf("cannot build heroku team URL: %w", err)