Revert "fix: Skip permissions set and check for in-place"

This reverts commit 53e1f6df6a.
This commit is contained in:
Ilya Kuznetsov 2024-11-18 22:32:36 +01:00
parent 55f715dddf
commit 518aa14b64
No known key found for this signature in database
GPG Key ID: 91F3DDCF5D21CDDF
5 changed files with 0 additions and 17 deletions

View File

@ -32,10 +32,6 @@ func (r ReadOnlyBundle) SyncRoot() vfs.Path {
return r.b.SyncRoot
}
func (r ReadOnlyBundle) SyncRootPath() string {
return r.b.SyncRootPath
}
func (r ReadOnlyBundle) WorkspaceClient() *databricks.WorkspaceClient {
return r.b.WorkspaceClient()
}

View File

@ -4,7 +4,6 @@ import (
"context"
"fmt"
"path"
"strings"
"github.com/databricks/cli/bundle"
"github.com/databricks/cli/bundle/libraries"
@ -31,9 +30,6 @@ func (f *folderPermissions) Apply(ctx context.Context, b bundle.ReadOnlyBundle)
g, ctx := errgroup.WithContext(ctx)
results := make([]diag.Diagnostics, len(bundlePaths))
for i, p := range bundlePaths {
if strings.HasPrefix(p, b.SyncRootPath()) {
continue
}
g.Go(func() error {
results[i] = checkFolderPermission(ctx, b, p)
return nil

View File

@ -78,7 +78,6 @@ func TestFolderPermissionsInheritedWhenRootPathDoesNotExist(t *testing.T) {
func TestValidateFolderPermissionsFailsOnMissingBundlePermission(t *testing.T) {
b := &bundle.Bundle{
SyncRootPath: t.TempDir(),
Config: config.Root{
Workspace: config.Workspace{
RootPath: "/Workspace/Users/foo@bar.com",
@ -131,7 +130,6 @@ func TestValidateFolderPermissionsFailsOnMissingBundlePermission(t *testing.T) {
func TestValidateFolderPermissionsFailsOnPermissionMismatch(t *testing.T) {
b := &bundle.Bundle{
SyncRootPath: t.TempDir(),
Config: config.Root{
Workspace: config.Workspace{
RootPath: "/Workspace/Users/foo@bar.com",
@ -177,7 +175,6 @@ func TestValidateFolderPermissionsFailsOnPermissionMismatch(t *testing.T) {
func TestValidateFolderPermissionsFailsOnNoRootFolder(t *testing.T) {
b := &bundle.Bundle{
SyncRootPath: t.TempDir(),
Config: config.Root{
Workspace: config.Workspace{
RootPath: "/NotExisting",

View File

@ -3,7 +3,6 @@ package permissions
import (
"context"
"fmt"
"strings"
"github.com/databricks/cli/bundle"
"github.com/databricks/cli/bundle/libraries"
@ -60,9 +59,6 @@ func giveAccessForWorkspaceRoot(ctx context.Context, b *bundle.Bundle) error {
g, ctx := errgroup.WithContext(ctx)
for _, p := range bundlePaths {
if strings.HasPrefix(p, b.SyncRootPath) {
continue
}
g.Go(func() error {
return setPermissions(ctx, w, p, permissions)
})

View File

@ -19,7 +19,6 @@ import (
func TestApplyWorkspaceRootPermissions(t *testing.T) {
b := &bundle.Bundle{
SyncRootPath: t.TempDir(),
Config: config.Root{
Workspace: config.Workspace{
RootPath: "/Users/foo@bar.com",
@ -80,7 +79,6 @@ func TestApplyWorkspaceRootPermissions(t *testing.T) {
func TestApplyWorkspaceRootPermissionsForAllPaths(t *testing.T) {
b := &bundle.Bundle{
SyncRootPath: t.TempDir(),
Config: config.Root{
Workspace: config.Workspace{
RootPath: "/Some/Root/Path",