-
Notifications
You must be signed in to change notification settings - Fork 26
feat: Pass installation ID from env to usage report #2106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment, ok otherwise.
premium/usage.go
Outdated
func maybeGetInstallationID(tokenType auth.TokenType) string { | ||
switch tokenType { | ||
case auth.SyncRunAPIKey, auth.SyncTestConnectionAPIKey: | ||
return os.Getenv("_CQ_INSTALLATION_ID") | ||
default: | ||
return "" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we not have a function with a name starting with maybe? :))
Since this is used in a single place either way, let's skip extracting it as a separate function; or just rename it :)).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is determineInstallationID()
ok? 771f100
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup. LGTM!
🤖 I have created a release *beep* *boop* --- ## [4.76.0](v4.75.0...v4.76.0) (2025-04-02) ### Features * Pass installation ID from env to usage report ([#2106](#2106)) ([0bea6e7](0bea6e7)) ### Bug Fixes * **deps:** Update golang.org/x/exp digest to 054e65f ([#2110](#2110)) ([f9875f8](f9875f8)) * **deps:** Update module github.com/cloudquery/plugin-pb-go to v1.26.9 ([#2112](#2112)) ([abd2117](abd2117)) * Error if both PKs and PK components are set ([#2113](#2113)) ([4f0b312](4f0b312)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Follow-up to #2106 Plugins use regular team API keys for usage reports, not platform-specific local API keys.
Goes with cloudquery/cloudquery#20455