Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ Copyright (c) 2012 Alex Ogier. All rights reserved.
Copyright (c) 2012 The Go Authors. All rights reserved.
License - https://github.com/spf13/pflag/blob/master/LICENSE

google/uuid - https://github.com/google/uuid
Copyright (c) 2009,2014 Google Inc. All rights reserved.
License - https://github.com/google/uuid/blob/master/LICENSE

hexops/gotextdiff - https://github.com/hexops/gotextdiff
Copyright (c) 2009 The Go Authors. All rights reserved.
License - https://github.com/hexops/gotextdiff/blob/main/LICENSE
Expand Down
3 changes: 1 addition & 2 deletions acceptance/acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ import (
"testing"
"time"
"unicode/utf8"

"github.com/google/uuid"
"uuid"

"github.com/databricks/cli/acceptance/internal"
"github.com/databricks/cli/acceptance/internal/selection"
Expand Down
2 changes: 1 addition & 1 deletion acceptance/dbr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"path/filepath"
"testing"
"time"
"uuid"

"github.com/databricks/cli/internal/testarchive"
"github.com/databricks/cli/libs/filer"
Expand All @@ -17,7 +18,6 @@ import (
"github.com/databricks/databricks-sdk-go/service/iam"
"github.com/databricks/databricks-sdk-go/service/jobs"
"github.com/databricks/databricks-sdk-go/service/workspace"
"github.com/google/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
4 changes: 2 additions & 2 deletions acceptance/internal/prepare_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"testing"
"time"
"unicode/utf8"
"uuid"

"github.com/databricks/cli/libs/auth"
"github.com/databricks/cli/libs/env"
Expand All @@ -27,7 +28,6 @@ import (
"github.com/databricks/databricks-sdk-go"
sdkconfig "github.com/databricks/databricks-sdk-go/config"
"github.com/databricks/databricks-sdk-go/service/iam"
"github.com/google/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down Expand Up @@ -99,7 +99,7 @@ func PrepareServerAndClient(t *testing.T, config TestConfig, logRequests bool, o

// Use a unique token for each test. This allows us to maintain
// separate state for each test in fake workspaces.
tokenSuffix := strings.ReplaceAll(uuid.NewString(), "-", "")
tokenSuffix := strings.ReplaceAll(uuid.New().String(), "-", "")

var token string
var testUser iam.User
Expand Down
5 changes: 2 additions & 3 deletions acceptance/subset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import (
"strconv"
"strings"
"testing"

"github.com/google/uuid"
"uuid"

"github.com/databricks/cli/acceptance/internal/selection"
)
Expand Down Expand Up @@ -66,7 +65,7 @@ func newSubsetSelector(t *testing.T, overwrite, forcerun bool) subsetSelector {
seed := os.Getenv(SubsetSeedEnvVar)
if seed == "" {
// Reproduce this run's subset by re-running with the logged seed.
seed = uuid.NewString()
seed = uuid.New().String()
t.Logf("%s not set, using random seed %q", SubsetSeedEnvVar, seed)
}

Expand Down
2 changes: 1 addition & 1 deletion bundle/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"path/filepath"
"sync"
"time"
"uuid"

"github.com/databricks/cli/bundle/config"
"github.com/databricks/cli/bundle/config/engine"
Expand All @@ -31,7 +32,6 @@ import (
"github.com/databricks/cli/libs/telemetry/protos"
"github.com/databricks/cli/libs/vfs"
"github.com/databricks/databricks-sdk-go"
"github.com/google/uuid"
)

const internalFolder = ".internal"
Expand Down
2 changes: 1 addition & 1 deletion bundle/deploy/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
"io/fs"
"path/filepath"
"time"
"uuid"

"github.com/databricks/cli/bundle"
"github.com/databricks/cli/libs/fileset"
"github.com/databricks/cli/libs/vfs"
"github.com/google/uuid"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions bundle/deploy/state_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import (
"io/fs"
"os"
"time"
"uuid"

"github.com/databricks/cli/bundle"
"github.com/databricks/cli/internal/build"
"github.com/databricks/cli/libs/atomicfile"
"github.com/databricks/cli/libs/diag"
"github.com/databricks/cli/libs/log"
"github.com/google/uuid"
)

type stateUpdate struct{}
Expand Down Expand Up @@ -46,7 +46,7 @@ func (s *stateUpdate) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnost
state.Files = fl

// Generate a UUID for the deployment, if one does not already exist
if state.ID == uuid.Nil {
if state.ID == uuid.Nil() {
state.ID = uuid.New()
}
b.Metrics.DeploymentId = state.ID
Expand Down
4 changes: 2 additions & 2 deletions bundle/deploy/state_update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"os"
"testing"
"uuid"

"github.com/databricks/cli/bundle"
"github.com/databricks/cli/bundle/config"
Expand All @@ -12,7 +13,6 @@ import (
"github.com/databricks/cli/libs/fileset"
"github.com/databricks/cli/libs/vfs"
"github.com/databricks/databricks-sdk-go/service/iam"
"github.com/google/uuid"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -90,7 +90,7 @@ func TestStateUpdate(t *testing.T) {
require.Equal(t, build.GetInfo().Version, state.CliVersion)

// Valid non-empty UUID is generated.
require.NotEqual(t, uuid.Nil, state.ID)
require.NotEqual(t, uuid.Nil(), state.ID)
}

func TestStateUpdateWithExistingState(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions bundle/direct/dresources/job_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"strconv"
"strings"
"time"
"uuid"

"github.com/databricks/cli/bundle/config/resources"
"github.com/databricks/cli/bundle/deployplan"
Expand All @@ -20,7 +21,6 @@ import (
"github.com/databricks/databricks-sdk-go/marshal"
"github.com/databricks/databricks-sdk-go/retries"
"github.com/databricks/databricks-sdk-go/service/jobs"
"github.com/google/uuid"
)

// jobRunTimeout matches the timeout `bundle run` allows a run (bundle/run/job.go).
Expand Down Expand Up @@ -98,7 +98,7 @@ func (*ResourceJobRun) PrepareState(input *resources.JobRun) *JobRunState {
ts = *input.Lifecycle.TriggersState
}
if input.HasOnBundleDeploy() {
ts.OnBundleDeploy = uuid.NewString()
ts.OnBundleDeploy = uuid.New().String()
}
if !ts.IsEmpty() {
state.Lifecycle = &JobRunLifecycleState{TriggersState: &ts}
Expand Down Expand Up @@ -188,7 +188,7 @@ func (r *ResourceJobRun) DoCreate(ctx context.Context, config *JobRunState) (str
// Mint a token so an SDK retry of a lost response returns the same run. Set it
// on a copy: recording it in state would drift from the empty config and recreate.
req := config.RunNow
req.IdempotencyToken = uuid.NewString()
req.IdempotencyToken = uuid.New().String()
// RunNow returns only the new run id, so we return a nil remote and let the
// framework read it back via DoRead.
wait, err := r.client.Jobs.RunNow(ctx, req)
Expand Down
2 changes: 1 addition & 1 deletion bundle/direct/dstate/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"slices"
"strings"
"sync"
"uuid"

"github.com/databricks/cli/bundle/config"
"github.com/databricks/cli/bundle/deployplan"
Expand All @@ -24,7 +25,6 @@ import (
"github.com/databricks/cli/libs/dms"
"github.com/databricks/cli/libs/log"
"github.com/databricks/databricks-sdk-go/service/bundledeployments"
"github.com/google/uuid"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions cmd/air/runlaunch.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import (
"fmt"
"path"
"strings"
"uuid"

"github.com/databricks/cli/libs/env"
"github.com/databricks/databricks-sdk-go"
"github.com/databricks/databricks-sdk-go/apierr"
"github.com/databricks/databricks-sdk-go/service/iam"
"github.com/databricks/databricks-sdk-go/service/workspace"
"github.com/google/uuid"
)

// userWorkspaceDirEnv overrides the per-user workspace directory; mirrors the
Expand Down Expand Up @@ -53,7 +53,7 @@ func cliLaunchDir(base, experiment, run string) string {
if run == "" {
run = experiment
}
unique := strings.ReplaceAll(uuid.NewString(), "-", "")[:16]
unique := strings.ReplaceAll(uuid.New().String(), "-", "")[:16]
return path.Join(base, ".air", "cli_launch", experiment, run+"_"+unique)
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/air/runsubmit.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"strconv"
"strings"
"time"
"uuid"

"github.com/databricks/cli/libs/auth"
"github.com/databricks/cli/libs/cmdio"
Expand All @@ -20,7 +21,6 @@ import (
"github.com/databricks/databricks-sdk-go/client"
"github.com/databricks/databricks-sdk-go/service/compute"
"github.com/databricks/databricks-sdk-go/service/jobs"
"github.com/google/uuid"
"golang.org/x/sync/errgroup"
)

Expand Down Expand Up @@ -275,7 +275,7 @@ func effectiveIdempotencyToken(flag string, cfg *runConfig) string {
token = *cfg.IdempotencyToken
}
if token == "" {
token = uuid.NewString()
token = uuid.New().String()
}
return token
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/pipelines/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package pipelines

import (
"fmt"
"uuid"

"github.com/databricks/cli/cmd/bundle/utils"
"github.com/databricks/cli/cmd/root"
Expand All @@ -10,7 +11,6 @@ import (
"github.com/databricks/cli/libs/cmdio"
databricks "github.com/databricks/databricks-sdk-go"
"github.com/databricks/databricks-sdk-go/service/pipelines"
"github.com/google/uuid"
"github.com/spf13/cobra"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/psql/psql_provisioned.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import (
"context"
"errors"
"fmt"
"uuid"

"github.com/databricks/cli/libs/cmdctx"
"github.com/databricks/cli/libs/cmdio"
libpsql "github.com/databricks/cli/libs/psql"
"github.com/databricks/databricks-sdk-go"
"github.com/databricks/databricks-sdk-go/service/database"
"github.com/databricks/databricks-sdk-go/service/iam"
"github.com/google/uuid"
)

// provisionedDefaultDatabase is the default database for Lakebase Provisioned instances.
Expand Down Expand Up @@ -42,7 +42,7 @@ func connectProvisioned(ctx context.Context, instanceName string, retryConfig li

cred, err := w.Database.GenerateDatabaseCredential(ctx, database.GenerateDatabaseCredentialRequest{
InstanceNames: []string{instance.Name},
RequestId: uuid.NewString(),
RequestId: uuid.New().String(),
})
if err != nil {
return fmt.Errorf("failed to get database credentials: %w", err)
Expand Down
4 changes: 2 additions & 2 deletions experimental/postgres/cmd/internal/target/provisioned.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package target
import (
"context"
"fmt"
"uuid"

"github.com/databricks/databricks-sdk-go"
"github.com/databricks/databricks-sdk-go/service/database"
"github.com/google/uuid"
)

// GetProvisioned fetches a single provisioned instance by name.
Expand All @@ -28,7 +28,7 @@ func GetProvisioned(ctx context.Context, w *databricks.WorkspaceClient, name str
func ProvisionedCredential(ctx context.Context, w *databricks.WorkspaceClient, instanceName string) (string, error) {
cred, err := w.Database.GenerateDatabaseCredential(ctx, database.GenerateDatabaseCredentialRequest{
InstanceNames: []string{instanceName},
RequestId: uuid.NewString(),
RequestId: uuid.New().String(),
})
if err != nil {
return "", fmt.Errorf("failed to get database credentials: %w", err)
Expand Down
4 changes: 2 additions & 2 deletions experimental/ssh/internal/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"sync"
"sync/atomic"
"time"
"uuid"

"github.com/databricks/cli/libs/log"
"github.com/google/uuid"
"github.com/gorilla/websocket"
"golang.org/x/sync/errgroup"
)
Expand Down Expand Up @@ -247,7 +247,7 @@ type createWebsocketConnectionFunc func(ctx context.Context, req DialRequest) (*

func newProxyConnection(createConn createWebsocketConnectionFunc) *proxyConnection {
return &proxyConnection{
connID: uuid.NewString(),
connID: uuid.New().String(),
createWebsocketConnection: createConn,
ready: make(chan struct{}),
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ require (
github.com/databricks/sdk-go/files v0.1.0 // Apache-2.0
github.com/databricks/sdk-go/options v0.1.0 // Apache-2.0
github.com/google/jsonschema-go v0.4.3 // MIT
github.com/google/uuid v1.6.0 // BSD-3-Clause
github.com/gorilla/websocket v1.5.3 // BSD-2-Clause
github.com/hexops/gotextdiff v1.0.3 // BSD-3-Clause
github.com/jackc/pgx/v5 v5.11.0 // MIT
Expand Down Expand Up @@ -70,6 +69,7 @@ require (
github.com/godbus/dbus/v5 v5.2.2 // indirect
github.com/google/go-querystring v1.2.0 // indirect
github.com/google/s2a-go v0.1.9 // indirect
github.com/google/uuid v1.6.0 // indirect

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also update databricks-sdk-go? or does that need to support previous golang versions as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, up to EOL. And there's also other deps that still pull it in.

github.com/googleapis/enterprise-certificate-proxy v0.3.11 // indirect
github.com/googleapis/gax-go/v2 v2.17.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
Expand Down
2 changes: 1 addition & 1 deletion integration/libs/telemetry/telemetry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"encoding/json"
"testing"
"time"
"uuid"

"github.com/databricks/cli/integration/internal/acc"
"github.com/databricks/cli/libs/telemetry"
"github.com/databricks/cli/libs/telemetry/protos"
"github.com/databricks/databricks-sdk-go/client"
"github.com/google/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/testutil/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package testutil

import (
"strings"
"uuid"

"github.com/databricks/cli/libs/env"
"github.com/google/uuid"
)

// GetEnvOrSkipTest proceeds with test only with that env variable.
Expand Down
3 changes: 2 additions & 1 deletion libs/apps/runlocal/headers.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package runlocal

import (
"uuid"

"github.com/databricks/databricks-sdk-go/service/iam"
"github.com/google/uuid"
)

func GetXHeaders(user *iam.User) map[string]string {
Expand Down
Loading
Loading