-
Notifications
You must be signed in to change notification settings - Fork 10
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
introduce posthog #367
Open
zreigz
wants to merge
4
commits into
main
Choose a base branch
from
posthog
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+211
−19
Open
introduce posthog #367
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,13 +24,13 @@ func TestPluralConfigCommand(t *testing.T) { | |
{ | ||
name: `test "config read" command when config file doesn't exists'`, | ||
args: []string{plural.ApplicationName, "config", "read"}, | ||
expectedResponse: "apiVersion: platform.plural.sh/v1alpha1\nkind: Config\nmetadata: null\nspec:\n email: \"\"\n token: \"\"\n namespacePrefix: \"\"\n endpoint: \"\"\n lockProfile: \"\"\n reportErrors: false\n", | ||
expectedResponse: "apiVersion: platform.plural.sh/v1alpha1\nkind: Config\nmetadata: null\nspec:\n email: \"\"\n id: \"\"\n token: \"\"\n namespacePrefix: \"\"\n endpoint: \"\"\n lockProfile: \"\"\n reportErrors: false\n", | ||
}, | ||
{ | ||
name: `test "config read" command with default test config'`, | ||
args: []string{plural.ApplicationName, "config", "read"}, | ||
createConfig: true, | ||
expectedResponse: "apiVersion: platform.plural.sh/v1alpha1\nkind: Config\nmetadata: null\nspec:\n email: [email protected]\n token: abc\n namespacePrefix: test\n endpoint: http://example.com\n lockProfile: abc\n reportErrors: false\n", | ||
expectedResponse: "apiVersion: platform.plural.sh/v1alpha1\nkind: Config\nmetadata: null\nspec:\n email: [email protected]\n id: \"\"\n token: abc\n namespacePrefix: test\n endpoint: http://example.com\n lockProfile: abc\n reportErrors: false\n", | ||
}, | ||
} | ||
for _, test := range tests { | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,8 +47,10 @@ spec: | |
project: "" | ||
provider: kind | ||
region: us-east-1 | ||
sendmetrics: true | ||
owner: | ||
email: [email protected] | ||
id: testcli | ||
network: | ||
subdomain: clie2e.onplural.sh | ||
pluraldns: true | ||
|
@@ -82,6 +84,8 @@ export PLURAL_LOGIN_AFFIRM_CURRENT_USER=true | |
export PLURAL_INIT_AFFIRM_CURRENT_REPO=true | ||
export PLURAL_INIT_AFFIRM_BACKUP_KEY=false | ||
|
||
export PLURAL_INIT_AFFIRM_SEND_METRICS=true | ||
|
||
plural init | ||
plural repos reset | ||
plural bundle install console console-kind | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ import ( | |
"path/filepath" | ||
|
||
"github.com/pluralsh/plural/pkg/executor" | ||
"github.com/pluralsh/plural/pkg/utils" | ||
"github.com/pluralsh/plural/pkg/utils/git" | ||
"github.com/pluralsh/plural/pkg/utils/pathing" | ||
"github.com/pluralsh/plural/pkg/wkspace" | ||
|
@@ -120,6 +121,17 @@ func (s *Scaffold) Execute(wk *wkspace.Workspace, force bool) error { | |
preflight.Sha = "" | ||
} | ||
|
||
for _, ch := range wk.Charts { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly, this is better to send server-side |
||
utils.PosthogCapture(utils.BuildPosthogEvent, utils.PosthogProperties{ | ||
ApplicationName: wk.Installation.Repository.Name, | ||
ApplicationID: wk.Installation.Id, | ||
PackageType: s.Type, | ||
PackageName: ch.Chart.Name, | ||
PackageId: ch.Chart.Id, | ||
PackageVersion: ch.Version.Version, | ||
}) | ||
} | ||
|
||
sha, err := preflight.Execute(s.Root, ignore) | ||
if err != nil { | ||
return err | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,6 +82,7 @@ test: | |
metadata: null | ||
spec: | ||
email: [email protected] | ||
id: "" | ||
token: abc | ||
namespacePrefix: test | ||
endpoint: http://example.com | ||
|
@@ -154,6 +155,7 @@ test: | |
metadata: null | ||
spec: | ||
email: [email protected] | ||
id: "" | ||
token: abc | ||
namespacePrefix: test | ||
endpoint: http://example.com | ||
|
Oops, something went wrong.
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.
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.
We should send this info from the server if we want it in posthog, having the cli send it is error prone and could potentially cause failed installs
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.
We can't track the actual commands users execute server side since it doesn't know when somebody runs
plural deploy
. Having it in the CLI allows us to have a better metric of which commands people run, how often they run, and if they encountered an error when running the command. This can give us a metric of how many successful deploys have happened versus how many errors have occurred. It can also give us a timeline of a user's actions. For example, user deploys but runs into an error for app X, user then runsinstall
to change a config andbuild
for app X to fix that config, user then runsdeploy
again and it runs successfully.Each command that a user executes and if it passes or fails is very important data so we can have a better idea of how many command executions pass versus fail and where they fail exactly.