Skip to content

Commit 4d36bfb

Browse files
authored
fix: Pass installation ID from env for usage report (#2140)
Follow-up to #2106 Plugins use regular team API keys for usage reports, not platform-specific local API keys.
1 parent e1bcb05 commit 4d36bfb

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

premium/usage.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ func NewUsageClient(meta plugin.Meta, ops ...UsageClientOptions) (UsageClient, e
285285
}
286286
u.teamName = teamName
287287
}
288-
u.installationID = determineInstallationID(u.tokenClient.GetTokenType())
288+
u.installationID = determineInstallationID()
289289

290290
u.backgroundUpdater()
291291

@@ -728,13 +728,8 @@ func (u *BatchUpdater) getTeamNameByTokenType(tokenType auth.TokenType) (string,
728728
}
729729
}
730730

731-
func determineInstallationID(tokenType auth.TokenType) string {
732-
switch tokenType {
733-
case auth.SyncRunAPIKey, auth.SyncTestConnectionAPIKey:
734-
return os.Getenv("_CQ_INSTALLATION_ID")
735-
default:
736-
return ""
737-
}
731+
func determineInstallationID() string {
732+
return os.Getenv("_CQ_INSTALLATION_ID")
738733
}
739734

740735
type NoOpUsageClient struct {

0 commit comments

Comments
 (0)