diff --git a/acceptance/libs/telemetry/host-token-auth/server.json b/acceptance/libs/telemetry/host-token-auth/server.json new file mode 100644 index 000000000..40d5ab3f0 --- /dev/null +++ b/acceptance/libs/telemetry/host-token-auth/server.json @@ -0,0 +1,18 @@ +[ + { + "method": "POST", + "path": "/telemetry-ext", + "headers": { + "Authorization": "Bearer foobar" + }, + "request_body": { + "uploadTime": "", + "protoLogs": [ + "{\"frontend_log_event_id\":\"\",\"entry\":{\"databricks_cli_log\":{\"cli_test_event\":{\"name\":\"VALUE1\"}}}}", + "{\"frontend_log_event_id\":\"\",\"entry\":{\"databricks_cli_log\":{\"cli_test_event\":{\"name\":\"VALUE2\"}}}}", + "{\"frontend_log_event_id\":\"\",\"entry\":{\"databricks_cli_log\":{\"cli_test_event\":{\"name\":\"VALUE3\"}}}}" + ], + "items": [] + } + } +] diff --git a/cmd/root/root.go b/cmd/root/root.go index eabf0c993..4f617fdf4 100644 --- a/cmd/root/root.go +++ b/cmd/root/root.go @@ -153,7 +153,7 @@ func Execute(ctx context.Context, cmd *cobra.Command) error { // TODO: Skip telemetry if the credentials are invalid. func logTelemetry(ctx context.Context, cmdStr string, start, end time.Time, exitCode int) { telemetry.SetExecutionContext(ctx, protos.ExecutionContext{ - CmdExecId: cmdExecId, + CmdExecID: cmdExecId, Version: build.GetInfo().Version, Command: cmdStr, OperatingSystem: runtime.GOOS, diff --git a/integration/libs/telemetry/__debug_bin2084705627 b/integration/libs/telemetry/__debug_bin2084705627 deleted file mode 100644 index e69de29bb..000000000 diff --git a/internal/testutil/build_cli.go b/internal/testutil/build_cli.go deleted file mode 100644 index ce3c69ff5..000000000 --- a/internal/testutil/build_cli.go +++ /dev/null @@ -1,55 +0,0 @@ -package testutil - -import ( - "os/exec" - "path/filepath" - "runtime" - "time" - - "github.com/databricks/cli/libs/folders" - "github.com/stretchr/testify/require" -) - -func BuildCLI(t TestingT, flags ...string) string { - repoRoot, err := folders.FindDirWithLeaf(".", ".git") - require.NoError(t, err) - - // Stable path for the CLI binary. This ensures fast builds and cache reuse. - execPath := filepath.Join(repoRoot, "internal", "testutil", "build", "databricks") - if runtime.GOOS == "windows" { - execPath += ".exe" - } - - start := time.Now() - args := []string{ - "go", "build", - "-mod", "vendor", - "-o", execPath, - } - if len(flags) > 0 { - args = append(args, flags...) - } - - if runtime.GOOS == "windows" { - // Get this error on my local Windows: - // error obtaining VCS status: exit status 128 - // Use -buildvcs=false to disable VCS stamping. - args = append(args, "-buildvcs=false") - } - - cmd := exec.Command(args[0], args[1:]...) - cmd.Dir = repoRoot - out, err := cmd.CombinedOutput() - elapsed := time.Since(start) - t.Logf("%s took %s", args, elapsed) - require.NoError(t, err, "go build failed: %s: %s\n%s", args, err, out) - if len(out) > 0 { - t.Logf("go build output: %s: %s", args, out) - } - - // Quick check + warm up cache: - cmd = exec.Command(execPath, "--version") - out, err = cmd.CombinedOutput() - require.NoError(t, err, "%s --version failed: %s\n%s", execPath, err, out) - return execPath -} diff --git a/libs/telemetry/protos/bundle_deploy.go b/libs/telemetry/protos/bundle_deploy.go index 8add42c39..f3c3a360b 100644 --- a/libs/telemetry/protos/bundle_deploy.go +++ b/libs/telemetry/protos/bundle_deploy.go @@ -21,17 +21,10 @@ type BundleDeployEvent struct { // IDs of resources managed by the bundle. Some resources like volumes or schemas // do not expose a numerical or UUID identifier and are tracked by name. Those // resources are not tracked here since the names are PII. -<<<<<<< HEAD - ResourceJobIds []string `json:"resource_job_ids,omitempty"` - ResourcePipelineIds []string `json:"resource_pipeline_ids,omitempty"` - ResourceClusterIds []string `json:"resource_cluster_ids,omitempty"` - ResourceDashboardIds []string `json:"resource_dashboard_ids,omitempty"` -======= ResourceJobIDs []string `json:"resource_job_ids,omitempty"` ResourcePipelineIDs []string `json:"resource_pipeline_ids,omitempty"` ResourceClusterIDs []string `json:"resource_cluster_ids,omitempty"` ResourceDashboardIDs []string `json:"resource_dashboard_ids,omitempty"` ->>>>>>> origin Experimental *BundleDeployExperimental `json:"experimental,omitempty"` }