diff --git a/bundle/artifacts/artifacts.go b/bundle/artifacts/artifacts.go index e55ae4e8..e703668e 100644 --- a/bundle/artifacts/artifacts.go +++ b/bundle/artifacts/artifacts.go @@ -160,7 +160,7 @@ func uploadArtifactFile(ctx context.Context, file string, uploadPath string, cli } func getUploadBasePath(b *bundle.Bundle) (string, error) { - artifactPath := b.Config.Workspace.ArtifactsPath + artifactPath := b.Config.Workspace.ArtifactPath if artifactPath == "" { return "", fmt.Errorf("remote artifact path not configured") } diff --git a/bundle/config/mutator/default_workspace_paths.go b/bundle/config/mutator/default_workspace_paths.go index b444ba96..04f2b0dc 100644 --- a/bundle/config/mutator/default_workspace_paths.go +++ b/bundle/config/mutator/default_workspace_paths.go @@ -25,12 +25,12 @@ func (m *defineDefaultWorkspacePaths) Apply(ctx context.Context, b *bundle.Bundl return fmt.Errorf("unable to define default workspace paths: workspace root not defined") } - if b.Config.Workspace.FilesPath == "" { - b.Config.Workspace.FilesPath = path.Join(root, "files") + if b.Config.Workspace.FilePath == "" { + b.Config.Workspace.FilePath = path.Join(root, "files") } - if b.Config.Workspace.ArtifactsPath == "" { - b.Config.Workspace.ArtifactsPath = path.Join(root, "artifacts") + if b.Config.Workspace.ArtifactPath == "" { + b.Config.Workspace.ArtifactPath = path.Join(root, "artifacts") } if b.Config.Workspace.StatePath == "" { diff --git a/bundle/config/mutator/default_workspace_paths_test.go b/bundle/config/mutator/default_workspace_paths_test.go index 308f82c4..033b7f48 100644 --- a/bundle/config/mutator/default_workspace_paths_test.go +++ b/bundle/config/mutator/default_workspace_paths_test.go @@ -21,8 +21,8 @@ func TestDefineDefaultWorkspacePaths(t *testing.T) { } err := mutator.DefineDefaultWorkspacePaths().Apply(context.Background(), bundle) require.NoError(t, err) - assert.Equal(t, "/files", bundle.Config.Workspace.FilesPath) - assert.Equal(t, "/artifacts", bundle.Config.Workspace.ArtifactsPath) + assert.Equal(t, "/files", bundle.Config.Workspace.FilePath) + assert.Equal(t, "/artifacts", bundle.Config.Workspace.ArtifactPath) assert.Equal(t, "/state", bundle.Config.Workspace.StatePath) } @@ -30,16 +30,16 @@ func TestDefineDefaultWorkspacePathsAlreadySet(t *testing.T) { bundle := &bundle.Bundle{ Config: config.Root{ Workspace: config.Workspace{ - RootPath: "/", - FilesPath: "/foo/bar", - ArtifactsPath: "/foo/bar", - StatePath: "/foo/bar", + RootPath: "/", + FilePath: "/foo/bar", + ArtifactPath: "/foo/bar", + StatePath: "/foo/bar", }, }, } err := mutator.DefineDefaultWorkspacePaths().Apply(context.Background(), bundle) require.NoError(t, err) - assert.Equal(t, "/foo/bar", bundle.Config.Workspace.FilesPath) - assert.Equal(t, "/foo/bar", bundle.Config.Workspace.ArtifactsPath) + assert.Equal(t, "/foo/bar", bundle.Config.Workspace.FilePath) + assert.Equal(t, "/foo/bar", bundle.Config.Workspace.ArtifactPath) assert.Equal(t, "/foo/bar", bundle.Config.Workspace.StatePath) } diff --git a/bundle/config/mutator/process_target_mode.go b/bundle/config/mutator/process_target_mode.go index bd161e95..f9d2795a 100644 --- a/bundle/config/mutator/process_target_mode.go +++ b/bundle/config/mutator/process_target_mode.go @@ -120,11 +120,11 @@ func findIncorrectPath(b *bundle.Bundle, mode config.Mode) string { if strings.Contains(b.Config.Workspace.StatePath, username) != containsExpected { return "state_path" } - if strings.Contains(b.Config.Workspace.FilesPath, username) != containsExpected { - return "files_path" + if strings.Contains(b.Config.Workspace.FilePath, username) != containsExpected { + return "file_path" } - if strings.Contains(b.Config.Workspace.ArtifactsPath, username) != containsExpected { - return "artifacts_path" + if strings.Contains(b.Config.Workspace.ArtifactPath, username) != containsExpected { + return "artifact_path" } return "" } diff --git a/bundle/config/mutator/process_target_mode_test.go b/bundle/config/mutator/process_target_mode_test.go index f7e78da2..2e438f6e 100644 --- a/bundle/config/mutator/process_target_mode_test.go +++ b/bundle/config/mutator/process_target_mode_test.go @@ -39,9 +39,9 @@ func mockBundle(mode config.Mode) *bundle.Bundle { Id: "1", }, }, - StatePath: "/Users/lennart@company.com/.bundle/x/y/state", - ArtifactsPath: "/Users/lennart@company.com/.bundle/x/y/artifacts", - FilesPath: "/Users/lennart@company.com/.bundle/x/y/files", + StatePath: "/Users/lennart@company.com/.bundle/x/y/state", + ArtifactPath: "/Users/lennart@company.com/.bundle/x/y/artifacts", + FilePath: "/Users/lennart@company.com/.bundle/x/y/files", }, Resources: config.Resources{ Jobs: map[string]*resources.Job{ @@ -190,8 +190,8 @@ func TestProcessTargetModeProduction(t *testing.T) { require.ErrorContains(t, err, "state_path") bundle.Config.Workspace.StatePath = "/Shared/.bundle/x/y/state" - bundle.Config.Workspace.ArtifactsPath = "/Shared/.bundle/x/y/artifacts" - bundle.Config.Workspace.FilesPath = "/Shared/.bundle/x/y/files" + bundle.Config.Workspace.ArtifactPath = "/Shared/.bundle/x/y/artifacts" + bundle.Config.Workspace.FilePath = "/Shared/.bundle/x/y/files" err = validateProductionMode(context.Background(), bundle, false) require.ErrorContains(t, err, "production") diff --git a/bundle/config/mutator/trampoline.go b/bundle/config/mutator/trampoline.go index 52d62c1b..24600f52 100644 --- a/bundle/config/mutator/trampoline.go +++ b/bundle/config/mutator/trampoline.go @@ -90,7 +90,7 @@ func (m *trampoline) generateNotebookWrapper(ctx context.Context, b *bundle.Bund if err != nil { return err } - remotePath := path.Join(b.Config.Workspace.FilesPath, filepath.ToSlash(internalDirRel), notebookName) + remotePath := path.Join(b.Config.Workspace.FilePath, filepath.ToSlash(internalDirRel), notebookName) task.Task.NotebookTask = &jobs.NotebookTask{ NotebookPath: remotePath, diff --git a/bundle/config/mutator/translate_paths.go b/bundle/config/mutator/translate_paths.go index 8d3c8ce3..b4a17afc 100644 --- a/bundle/config/mutator/translate_paths.go +++ b/bundle/config/mutator/translate_paths.go @@ -92,7 +92,7 @@ func (m *translatePaths) rewritePath( } // Prefix remote path with its remote root path. - remotePath := path.Join(b.Config.Workspace.FilesPath, filepath.ToSlash(localRelPath)) + remotePath := path.Join(b.Config.Workspace.FilePath, filepath.ToSlash(localRelPath)) // Convert local path into workspace path via specified function. interp, err := fn(*p, localPath, localRelPath, filepath.ToSlash(remotePath)) diff --git a/bundle/config/mutator/translate_paths_test.go b/bundle/config/mutator/translate_paths_test.go index c24fd2e7..2e578dd9 100644 --- a/bundle/config/mutator/translate_paths_test.go +++ b/bundle/config/mutator/translate_paths_test.go @@ -39,7 +39,7 @@ func TestTranslatePathsSkippedWithGitSource(t *testing.T) { Config: config.Root{ Path: dir, Workspace: config.Workspace{ - FilesPath: "/bundle", + FilePath: "/bundle", }, Resources: config.Resources{ Jobs: map[string]*resources.Job{ @@ -111,7 +111,7 @@ func TestTranslatePaths(t *testing.T) { Config: config.Root{ Path: dir, Workspace: config.Workspace{ - FilesPath: "/bundle", + FilePath: "/bundle", }, Resources: config.Resources{ Jobs: map[string]*resources.Job{ @@ -282,7 +282,7 @@ func TestTranslatePathsInSubdirectories(t *testing.T) { Config: config.Root{ Path: dir, Workspace: config.Workspace{ - FilesPath: "/bundle", + FilePath: "/bundle", }, Resources: config.Resources{ Jobs: map[string]*resources.Job{ @@ -380,7 +380,7 @@ func TestTranslatePathsOutsideBundleRoot(t *testing.T) { Config: config.Root{ Path: dir, Workspace: config.Workspace{ - FilesPath: "/bundle", + FilePath: "/bundle", }, Resources: config.Resources{ Jobs: map[string]*resources.Job{ @@ -539,7 +539,7 @@ func TestJobSparkPythonTaskWithNotebookSourceError(t *testing.T) { Config: config.Root{ Path: dir, Workspace: config.Workspace{ - FilesPath: "/bundle", + FilePath: "/bundle", }, Resources: config.Resources{ Jobs: map[string]*resources.Job{ @@ -574,7 +574,7 @@ func TestJobNotebookTaskWithFileSourceError(t *testing.T) { Config: config.Root{ Path: dir, Workspace: config.Workspace{ - FilesPath: "/bundle", + FilePath: "/bundle", }, Resources: config.Resources{ Jobs: map[string]*resources.Job{ @@ -609,7 +609,7 @@ func TestPipelineNotebookLibraryWithFileSourceError(t *testing.T) { Config: config.Root{ Path: dir, Workspace: config.Workspace{ - FilesPath: "/bundle", + FilePath: "/bundle", }, Resources: config.Resources{ Pipelines: map[string]*resources.Pipeline{ @@ -644,7 +644,7 @@ func TestPipelineFileLibraryWithNotebookSourceError(t *testing.T) { Config: config.Root{ Path: dir, Workspace: config.Workspace{ - FilesPath: "/bundle", + FilePath: "/bundle", }, Resources: config.Resources{ Pipelines: map[string]*resources.Pipeline{ diff --git a/bundle/config/workspace.go b/bundle/config/workspace.go index 16a70afb..5f8691ba 100644 --- a/bundle/config/workspace.go +++ b/bundle/config/workspace.go @@ -52,11 +52,11 @@ type Workspace struct { // Remote workspace path to synchronize local files to. // This defaults to "${workspace.root}/files". - FilesPath string `json:"file_path,omitempty"` + FilePath string `json:"file_path,omitempty"` // Remote workspace path for build artifacts. // This defaults to "${workspace.root}/artifacts". - ArtifactsPath string `json:"artifact_path,omitempty"` + ArtifactPath string `json:"artifact_path,omitempty"` // Remote workspace path for deployment state. // This defaults to "${workspace.root}/state". diff --git a/bundle/deploy/files/sync.go b/bundle/deploy/files/sync.go index ff3d78d0..148a63ff 100644 --- a/bundle/deploy/files/sync.go +++ b/bundle/deploy/files/sync.go @@ -21,7 +21,7 @@ func getSync(ctx context.Context, b *bundle.Bundle) (*sync.Sync, error) { opts := sync.SyncOptions{ LocalPath: b.Config.Path, - RemotePath: b.Config.Workspace.FilesPath, + RemotePath: b.Config.Workspace.FilePath, Include: includes, Exclude: b.Config.Sync.Exclude, diff --git a/bundle/deploy/files/upload.go b/bundle/deploy/files/upload.go index 9b7a85a4..aebbf6d5 100644 --- a/bundle/deploy/files/upload.go +++ b/bundle/deploy/files/upload.go @@ -26,7 +26,7 @@ func (m *upload) Apply(ctx context.Context, b *bundle.Bundle) error { return err } - cmdio.LogString(ctx, fmt.Sprintf("Uploaded bundle files at %s!\n", b.Config.Workspace.FilesPath)) + cmdio.LogString(ctx, fmt.Sprintf("Uploaded bundle files at %s!\n", b.Config.Workspace.FilePath)) return nil } diff --git a/bundle/deploy/metadata/compute.go b/bundle/deploy/metadata/compute.go index 9a3ae0e3..460a81c9 100644 --- a/bundle/deploy/metadata/compute.go +++ b/bundle/deploy/metadata/compute.go @@ -46,6 +46,6 @@ func (m *compute) Apply(_ context.Context, b *bundle.Bundle) error { b.Metadata.Config.Resources.Jobs = jobsMetadata // Set file upload destination of the bundle in metadata - b.Metadata.Config.Workspace.FilesPath = b.Config.Workspace.FilesPath + b.Metadata.Config.Workspace.FilePath = b.Config.Workspace.FilePath return nil } diff --git a/bundle/deploy/metadata/compute_test.go b/bundle/deploy/metadata/compute_test.go index 9e4b475c..ffa352d0 100644 --- a/bundle/deploy/metadata/compute_test.go +++ b/bundle/deploy/metadata/compute_test.go @@ -18,9 +18,9 @@ func TestComputeMetadataMutator(t *testing.T) { b := &bundle.Bundle{ Config: config.Root{ Workspace: config.Workspace{ - RootPath: "/Users/shreyas.goenka@databricks.com", - ArtifactsPath: "/Users/shreyas.goenka@databricks.com/artifacts", - FilesPath: "/Users/shreyas.goenka@databricks.com/files", + RootPath: "/Users/shreyas.goenka@databricks.com", + ArtifactPath: "/Users/shreyas.goenka@databricks.com/artifacts", + FilePath: "/Users/shreyas.goenka@databricks.com/files", }, Bundle: config.Bundle{ Name: "my-bundle", @@ -68,7 +68,7 @@ func TestComputeMetadataMutator(t *testing.T) { Version: metadata.Version, Config: metadata.Config{ Workspace: metadata.Workspace{ - FilesPath: "/Users/shreyas.goenka@databricks.com/files", + FilePath: "/Users/shreyas.goenka@databricks.com/files", }, Bundle: metadata.Bundle{ Git: config.Git{ diff --git a/bundle/metadata/metadata.go b/bundle/metadata/metadata.go index 441f1463..78c8cb18 100644 --- a/bundle/metadata/metadata.go +++ b/bundle/metadata/metadata.go @@ -11,7 +11,7 @@ type Bundle struct { } type Workspace struct { - FilesPath string `json:"file_path"` + FilePath string `json:"file_path"` } type Job struct { diff --git a/cmd/bundle/sync.go b/cmd/bundle/sync.go index 6d6a6f5a..ca81275b 100644 --- a/cmd/bundle/sync.go +++ b/cmd/bundle/sync.go @@ -30,7 +30,7 @@ func (f *syncFlags) syncOptionsFromBundle(cmd *cobra.Command, b *bundle.Bundle) opts := sync.SyncOptions{ LocalPath: b.Config.Path, - RemotePath: b.Config.Workspace.FilesPath, + RemotePath: b.Config.Workspace.FilePath, Include: includes, Exclude: b.Config.Sync.Exclude, Full: f.full, diff --git a/cmd/sync/sync.go b/cmd/sync/sync.go index 2870e1e0..f00c02a8 100644 --- a/cmd/sync/sync.go +++ b/cmd/sync/sync.go @@ -41,7 +41,7 @@ func (f *syncFlags) syncOptionsFromBundle(cmd *cobra.Command, args []string, b * opts := sync.SyncOptions{ LocalPath: b.Config.Path, - RemotePath: b.Config.Workspace.FilesPath, + RemotePath: b.Config.Workspace.FilePath, Include: includes, Exclude: b.Config.Sync.Exclude, Full: f.full, diff --git a/cmd/sync/sync_test.go b/cmd/sync/sync_test.go index 14f641ff..827c4d50 100644 --- a/cmd/sync/sync_test.go +++ b/cmd/sync/sync_test.go @@ -24,7 +24,7 @@ func TestSyncOptionsFromBundle(t *testing.T) { }, Workspace: config.Workspace{ - FilesPath: "/Users/jane@doe.com/path", + FilePath: "/Users/jane@doe.com/path", }, }, } diff --git a/internal/bundle/artifacts_test.go b/internal/bundle/artifacts_test.go index 9d1a171a..689a4b4b 100644 --- a/internal/bundle/artifacts_test.go +++ b/internal/bundle/artifacts_test.go @@ -54,7 +54,7 @@ func TestAccUploadArtifactFileToCorrectRemotePath(t *testing.T) { Target: "whatever", }, Workspace: config.Workspace{ - ArtifactsPath: wsDir, + ArtifactPath: wsDir, }, Artifacts: config.Artifacts{ "test": artifact, diff --git a/internal/bundle/job_metadata_test.go b/internal/bundle/job_metadata_test.go index 70962c4c..3e2bb7f0 100644 --- a/internal/bundle/job_metadata_test.go +++ b/internal/bundle/job_metadata_test.go @@ -83,7 +83,7 @@ func TestAccJobsMetadataFile(t *testing.T) { }, }, Workspace: metadata.Workspace{ - FilesPath: path.Join(root, "files"), + FilePath: path.Join(root, "files"), }, Resources: metadata.Resources{ Jobs: map[string]*metadata.Job{