Add plugin install/uninstall/upgrade analytics#1727
Open
vcheung-stripe wants to merge 6 commits into
Open
Conversation
4500e14 to
363ceb3
Compare
yahanxing-stripe
approved these changes
Jul 6, 2026
| return err | ||
| } | ||
|
|
||
| sendPluginLifecycleEvent(cmd.Context(), "Plugin Installed", version) |
Contributor
There was a problem hiding this comment.
do we want plugin upgraded here?
Collaborator
Author
There was a problem hiding this comment.
Yeah I think that would be useful!
Collaborator
Author
There was a problem hiding this comment.
Updated to "Plugin Upgraded" when using stripe plugin upgrade, or stripe plugin install while already having it installed. We could also capture the previous version, but I'm not sure how useful that is.
Track plugin lifecycle events (Plugin Installed, Plugin Upgraded, Plugin Uninstalled) with name, version, CLI version, OS, CPU arch, a persistent machine UUID stored in config.toml, and merchant ID when authenticated. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Committed-By-Agent: claude
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Committed-By-Agent: claude
viper.Reset() (called from GetMachineUUID → WriteConfigField) clears pflag bindings, causing ReBindKeys to clobber flags the user explicitly passed on the command line with env var values (e.g. STRIPE_PROJECT_NAME in CI). Guard each key with pflag.Changed so we skip the override when the flag was provided explicitly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Committed-By-Agent: claude
Verifies that ReBindKeys skips flags explicitly set on the command line after viper.Reset() clears the pflag binding (the condition that caused the CI failure of TestReadProjectFromFlag). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Committed-By-Agent: claude
ae2ab69 to
8642bd6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Track plugin lifecycle events (Plugin Installed, Plugin Upgraded, Plugin Uninstalled) with name, version, CLI version, OS, CPU arch, a persistent machine UUID stored in config.toml, and merchant ID when authenticated.
Here's where the machine UUID is in the config file, we'll eventually use this in more than just analytics:
I verified the events in our backend logs.