Restore TrackProjectCommand + comment (so we can use it later for telemetry)
Signed-off-by: Joel Longtine <joel@dagger.io>
This commit is contained in:
parent
b32e2da0a5
commit
55bf5ff4dd
@ -28,6 +28,34 @@ func commandName(cmd *cobra.Command) string {
|
||||
return strings.Join(parts, " ")
|
||||
}
|
||||
|
||||
// TrackProjectCommand is like TrackCommand but includes project and
|
||||
// optionally environment metadata.
|
||||
// func TrackProjectCommand(ctx context.Context, cmd *cobra.Command, w *state.Project, env *state.State, props ...*telemetry.Property) chan struct{} {
|
||||
// props = append([]*telemetry.Property{
|
||||
// {
|
||||
// // Hash the repository URL for privacy
|
||||
// Name: "git_repository_hash",
|
||||
// Value: hash(gitRepoURL(w.Path)),
|
||||
// },
|
||||
// {
|
||||
// // The project path might contain the username (e.g. /home/user/project), so we hash it for privacy.
|
||||
// Name: "project_path_hash",
|
||||
// Value: hash(w.Path),
|
||||
// },
|
||||
// }, props...)
|
||||
|
||||
// if env != nil {
|
||||
// props = append([]*telemetry.Property{
|
||||
// {
|
||||
// Name: "environment_name",
|
||||
// Value: env.Name,
|
||||
// },
|
||||
// }, props...)
|
||||
// }
|
||||
|
||||
// return TrackCommand(ctx, cmd, props...)
|
||||
// }
|
||||
|
||||
// hash returns the sha256 digest of the string
|
||||
// func hash(s string) string {
|
||||
// return fmt.Sprintf("%x", sha256.Sum256([]byte(s)))
|
||||
|
Reference in New Issue
Block a user