- Notifications
You must be signed in to change notification settings - Fork 1.4k
[gitpod-cli] add command analytics #15997
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
| started the job as gitpod-build-af-gp-analytics.1 because the annotations in the pull request description changed |
| @akosyakov this is almost done, it would be nice if someone can pick it up and merge it |
| @andreafalzetti thank you ❤️ |
| cc @laushinka |
ba66932 to 3c544f2 Compare | } | ||
| if action != "get" { | ||
| return | ||
| return nil |
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.
this is not error, no matter previous err is nil or not
| ClusterHost: wsInfo.WorkspaceClusterHost, | ||
| } | ||
| | ||
| if err != nil { |
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.
actually this is a bug, because it need check err first, otherwise wsInfo will be nil, and wsInfo.WorkspaceId make program crash
| Hidden: true, | ||
| Args: cobra.ExactArgs(0), | ||
| RunE: func(cmd *cobra.Command, args []string) (err error) { | ||
| defer os.Exit(0) |
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.
make sure this command is called os.Exit or log. Fatal to exit, because it doesn't wanna be sent track event.
5ae42e5 to 750402f Compare | @iQQBot i dont think we need analytics for credential helper and it’s supporting commands like token validator and so on… not sure about error reprting |
added ignore |
1a29280 to 9b2a95b Compare | /werft run 👍 started the job as gitpod-build-af-gp-analytics.19 |
9b2a95b to a8751da Compare 15d49e1 to 210e95a Compare | @iQQBot is it ok to retest it? the build is red |
| /werft run 👍 started the job as gitpod-build-af-gp-analytics.42 |
210e95a to f04549d Compare | Use: "await <port>", | ||
| Short: "Waits for a process to listen on a port", | ||
| Args: cobra.ExactArgs(1), | ||
| Run: func(cmd *cobra.Command, args []string) { |
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.
@iQQBot interruption does not work for this command
| RunE: func(cmd *cobra.Command, args []string) error { | ||
| srcp, err := strconv.ParseUint(args[0], 10, 16) | ||
| if err != nil { | ||
| log.Fatalf("local-port cannot be parsed as int: %s", err) |
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.
@iQQBot should be invalid_arg as well
| ) | ||
| | ||
| func stopDebugContainer(ctx context.Context, dockerPath string) { | ||
| func stopDebugContainer(ctx context.Context, dockerPath string) error { |
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.
it never should return error
| ForceResize: forceResize, | ||
| Interactive: interactive, | ||
| }) | ||
| if err != nil { |
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.
@iQQBot I got system erro by typing exit in attached terminal. It should be success in this case?
i.e. create VS Code terminal do gp tasks attach and then run exit
| signal.Notify(stopch, syscall.SIGTERM|syscall.SIGINT) | ||
| select { | ||
| case err := <-errchan: | ||
| if err != io.EOF { |
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.
@iQQBot maybe it could be exec.ExitError?
akosyakov left a comment
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.
I tried, there is one major thing with gp ports await not respecting interruptions. Everything else is alright. Please address before merging.
/hold
Co-authored-by: Andrea Falzetti <andrea@gitpod.io>
f04549d to 1b69220 Compare | started the job as gitpod-build-af-gp-analytics.46 because the annotations in the pull request description changed |
Description
This PR adds analytics to the
gpCLI. This will help us understand which commands are most and least useful.All commands updated
Related Issue(s)
Fixes #10349
How to test
send-analyticsitself, if the command success,outcomeshould besuccess, if the command failed, theoutcomeshould besystem_errororuser_errordepending on the error.gp stopcommand, because at that time, the workspace is going to stop.credential-helpergit-token-validatorgit-track-commandRelease Notes
Documentation
Werft options:
If enabled this will build
install/previewValid options are
all,workspace,webapp,ide,jetbrains,vscode,ssh