Skip to content

Commit 1e19f9f

Browse files
authored
Rename bundle/terranova to bundle/direct (#3613)
## Changes Pure renames, no other changes. ## Why We use "direct" name everywhere, makes sense to align the package names.
1 parent f0a07fe commit 1e19f9f

29 files changed

+70
-70
lines changed

.golangci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ linters:
6767
- legacy
6868
- std-error-handling
6969
rules:
70-
- path-except: bundle/terranova/tnresources
70+
- path-except: bundle/direct/dresources
7171
linters:
7272
- exhaustruct
73-
- path: bundle/terranova/tnresources/all_test.go
73+
- path: bundle/direct/dresources/all_test.go
7474
linters:
7575
- exhaustruct
7676
- path-except: ^cmd

acceptance/bin/read_id.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def print_resource_terraform(group, name):
2929
return
3030

3131

32-
def print_resource_terranova(group, name):
32+
def print_resource_direct(group, name):
3333
filename = ".databricks/bundle/default/resources.json"
3434
raw = open(filename).read()
3535
data = json.loads(raw)
@@ -42,6 +42,6 @@ def print_resource_terranova(group, name):
4242

4343

4444
if os.environ.get("DATABRICKS_CLI_DEPLOYMENT", "").startswith("direct"):
45-
print_resource_terranova(*sys.argv[1:])
45+
print_resource_direct(*sys.argv[1:])
4646
else:
4747
print_resource_terraform(*sys.argv[1:])

acceptance/bin/read_state.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def print_resource_terraform(group, name, *attrs):
3333
print(f"State not found for {group}.{name}")
3434

3535

36-
def print_resource_terranova(group, name, *attrs):
36+
def print_resource_direct(group, name, *attrs):
3737
filename = ".databricks/bundle/default/resources.json"
3838
raw = open(filename).read()
3939
data = json.loads(raw)
@@ -49,6 +49,6 @@ def print_resource_terranova(group, name, *attrs):
4949

5050

5151
if os.environ.get("DATABRICKS_CLI_DEPLOYMENT", "").startswith("direct"):
52-
print_resource_terranova(*sys.argv[1:])
52+
print_resource_direct(*sys.argv[1:])
5353
else:
5454
print_resource_terraform(*sys.argv[1:])

bundle/bundle.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import (
1515
"sync"
1616

1717
"github.com/databricks/cli/bundle/config"
18+
"github.com/databricks/cli/bundle/direct"
1819
"github.com/databricks/cli/bundle/env"
1920
"github.com/databricks/cli/bundle/metadata"
20-
"github.com/databricks/cli/bundle/terranova"
2121
"github.com/databricks/cli/libs/auth"
2222
"github.com/databricks/cli/libs/fileset"
2323
"github.com/databricks/cli/libs/locker"
@@ -130,7 +130,7 @@ type Bundle struct {
130130
TerraformPlanIsEmpty bool
131131

132132
// (direct only) deployment implementation and state
133-
DeploymentBundle terranova.DeploymentBundle
133+
DeploymentBundle direct.DeploymentBundle
134134

135135
// if true, we skip approval checks for deploy, destroy resources and delete
136136
// files
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package terranova
1+
package direct
22

33
import (
44
"bytes"
@@ -9,11 +9,11 @@ import (
99
"reflect"
1010

1111
"github.com/databricks/cli/bundle/deployplan"
12-
"github.com/databricks/cli/bundle/terranova/tnstate"
12+
"github.com/databricks/cli/bundle/direct/dstate"
1313
"github.com/databricks/cli/libs/log"
1414
)
1515

16-
func (d *DeploymentUnit) Destroy(ctx context.Context, db *tnstate.TerranovaState) error {
16+
func (d *DeploymentUnit) Destroy(ctx context.Context, db *dstate.DeploymentState) error {
1717
entry, hasEntry := db.GetResourceEntry(d.Group, d.Key)
1818
if !hasEntry {
1919
log.Infof(ctx, "Cannot delete %s.%s: missing from state", d.Group, d.Key)
@@ -32,7 +32,7 @@ func (d *DeploymentUnit) Destroy(ctx context.Context, db *tnstate.TerranovaState
3232
return nil
3333
}
3434

35-
func (d *DeploymentUnit) Deploy(ctx context.Context, db *tnstate.TerranovaState, inputConfig any, actionType deployplan.ActionType) error {
35+
func (d *DeploymentUnit) Deploy(ctx context.Context, db *dstate.DeploymentState, inputConfig any, actionType deployplan.ActionType) error {
3636
// Note, newState may be different between plan and deploy due to resolved $resource references
3737
newState, err := d.Adapter.PrepareState(inputConfig)
3838
if err != nil {
@@ -65,7 +65,7 @@ func (d *DeploymentUnit) Deploy(ctx context.Context, db *tnstate.TerranovaState,
6565
}
6666
}
6767

68-
func (d *DeploymentUnit) Create(ctx context.Context, db *tnstate.TerranovaState, newState any) error {
68+
func (d *DeploymentUnit) Create(ctx context.Context, db *dstate.DeploymentState, newState any) error {
6969
newID, remoteState, err := d.Adapter.DoCreate(ctx, newState)
7070
if err != nil {
7171
// No need to prefix error, there is no ambiguity (only one operation - DoCreate) and no additional context (like id)
@@ -97,7 +97,7 @@ func (d *DeploymentUnit) Create(ctx context.Context, db *tnstate.TerranovaState,
9797
return nil
9898
}
9999

100-
func (d *DeploymentUnit) Recreate(ctx context.Context, db *tnstate.TerranovaState, oldID string, newState any) error {
100+
func (d *DeploymentUnit) Recreate(ctx context.Context, db *dstate.DeploymentState, oldID string, newState any) error {
101101
err := d.Adapter.DoDelete(ctx, oldID)
102102
if err != nil {
103103
return fmt.Errorf("deleting old id=%s: %w", oldID, err)
@@ -111,7 +111,7 @@ func (d *DeploymentUnit) Recreate(ctx context.Context, db *tnstate.TerranovaStat
111111
return d.Create(ctx, db, newState)
112112
}
113113

114-
func (d *DeploymentUnit) Update(ctx context.Context, db *tnstate.TerranovaState, id string, newState any) error {
114+
func (d *DeploymentUnit) Update(ctx context.Context, db *dstate.DeploymentState, id string, newState any) error {
115115
remoteState, err := d.Adapter.DoUpdate(ctx, id, newState)
116116
if err != nil {
117117
return fmt.Errorf("updating id=%s: %w", id, err)
@@ -141,7 +141,7 @@ func (d *DeploymentUnit) Update(ctx context.Context, db *tnstate.TerranovaState,
141141
return nil
142142
}
143143

144-
func (d *DeploymentUnit) UpdateWithID(ctx context.Context, db *tnstate.TerranovaState, oldID string, newState any) error {
144+
func (d *DeploymentUnit) UpdateWithID(ctx context.Context, db *dstate.DeploymentState, oldID string, newState any) error {
145145
newID, remoteState, err := d.Adapter.DoUpdateWithID(ctx, oldID, newState)
146146
if err != nil {
147147
return fmt.Errorf("updating id=%s: %w", oldID, err)
@@ -177,7 +177,7 @@ func (d *DeploymentUnit) UpdateWithID(ctx context.Context, db *tnstate.Terranova
177177
return nil
178178
}
179179

180-
func (d *DeploymentUnit) Delete(ctx context.Context, db *tnstate.TerranovaState, oldID string) error {
180+
func (d *DeploymentUnit) Delete(ctx context.Context, db *dstate.DeploymentState, oldID string) error {
181181
// TODO: recognize 404 and 403 as "deleted" and proceed to removing state
182182
err := d.Adapter.DoDelete(ctx, oldID)
183183
if err != nil {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package terranova
1+
package direct
22

33
import (
44
"context"
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package terranova
1+
package direct
22

33
import (
44
"cmp"
@@ -10,7 +10,7 @@ import (
1010

1111
"github.com/databricks/cli/bundle/config"
1212
"github.com/databricks/cli/bundle/deployplan"
13-
"github.com/databricks/cli/bundle/terranova/tnresources"
13+
"github.com/databricks/cli/bundle/direct/dresources"
1414
"github.com/databricks/cli/libs/dagrun"
1515
"github.com/databricks/cli/libs/log"
1616
"github.com/databricks/cli/libs/logdiag"
@@ -31,7 +31,7 @@ func (b *DeploymentBundle) Init(client *databricks.WorkspaceClient) error {
3131
return nil
3232
}
3333
var err error
34-
b.Adapters, err = tnresources.InitAll(client)
34+
b.Adapters, err = dresources.InitAll(client)
3535
return err
3636
}
3737

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package tnresources
1+
package dresources
22

33
import (
44
"context"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package tnresources
1+
package dresources
22

33
import (
44
"context"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package tnresources
1+
package dresources
22

33
import (
44
"fmt"

0 commit comments

Comments
 (0)