This commit is contained in:
Shreyas Goenka 2025-01-29 16:05:25 +01:00
parent ee3568cf64
commit 8f8463f665
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
5 changed files with 19 additions and 63 deletions

View File

@ -0,0 +1,18 @@
[
{
"method": "POST",
"path": "/telemetry-ext",
"headers": {
"Authorization": "Bearer foobar"
},
"request_body": {
"uploadTime": "<current-unix-time>",
"protoLogs": [
"{\"frontend_log_event_id\":\"<UUID>\",\"entry\":{\"databricks_cli_log\":{\"cli_test_event\":{\"name\":\"VALUE1\"}}}}",
"{\"frontend_log_event_id\":\"<UUID>\",\"entry\":{\"databricks_cli_log\":{\"cli_test_event\":{\"name\":\"VALUE2\"}}}}",
"{\"frontend_log_event_id\":\"<UUID>\",\"entry\":{\"databricks_cli_log\":{\"cli_test_event\":{\"name\":\"VALUE3\"}}}}"
],
"items": []
}
}
]

View File

@ -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,

View File

@ -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
}

View File

@ -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"`
}