Skip to content

Commit e0d771e

Browse files
authored
Rename action "noop" to "skip" (#3662)
All other actions are verbs, so some messages look odd with "noop" > cannot noop resources.jobs.foo: failed to resolve ...
1 parent 2686669 commit e0d771e

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

bundle/deployplan/action.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type ActionType int
3131
// Note, Create/Delete are handled explicitly and never compared.
3232
const (
3333
ActionTypeUnset ActionType = iota
34-
ActionTypeNoop
34+
ActionTypeSkip
3535
ActionTypeResize
3636
ActionTypeUpdate
3737
ActionTypeUpdateWithID
@@ -41,7 +41,7 @@ const (
4141
)
4242

4343
var actionName = map[ActionType]string{
44-
ActionTypeNoop: "noop",
44+
ActionTypeSkip: "skip",
4545
ActionTypeResize: "resize",
4646
ActionTypeUpdate: "update",
4747
ActionTypeUpdateWithID: "update_id",
@@ -62,7 +62,7 @@ func init() {
6262
}
6363

6464
func (a ActionType) IsNoop() bool {
65-
return a == ActionTypeNoop
65+
return a == ActionTypeSkip
6666
}
6767

6868
func (a ActionType) KeepsID() bool {

bundle/direct/bundle_plan.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func (b *DeploymentBundle) CalculatePlanForDeploy(ctx context.Context, client *d
121121
}
122122
}
123123

124-
if actionType == deployplan.ActionTypeNoop {
124+
if actionType == deployplan.ActionTypeSkip {
125125
if hasDelayedResolutions {
126126
logdiag.LogError(ctx, fmt.Errorf("%s: internal error, action noop must not have delayed resolutions", errorPrefix))
127127
return false

bundle/direct/dresources/adapter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,10 +449,10 @@ func (a *Adapter) DoUpdateWithID(ctx context.Context, oldID string, newState any
449449

450450
// ClassifyByTriggers classifies a set of changes using FieldTriggers.
451451
// Unspecified changed fields default to ActionTypeUpdate. Final action is the
452-
// maximum by precedence. No changes yield ActionTypeNoop.
452+
// maximum by precedence. No changes yield ActionTypeSkip.
453453
func (a *Adapter) ClassifyByTriggers(changes []structdiff.Change) deployplan.ActionType {
454454
if len(changes) == 0 {
455-
return deployplan.ActionTypeNoop
455+
return deployplan.ActionTypeSkip
456456
}
457457

458458
// Default when there are changes but no explicit trigger is update.

bundle/direct/plan.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
func (d *DeploymentUnit) Plan(ctx context.Context, client *databricks.WorkspaceClient, db *dstate.DeploymentState, inputConfig any, localOnly, refresh bool) (deployplan.ActionType, error) {
2121
result, err := d.plan(ctx, client, db, inputConfig, localOnly, refresh)
2222
if err != nil {
23-
return deployplan.ActionTypeNoop, fmt.Errorf("planning: %s: %w", d.ResourceKey, err)
23+
return deployplan.ActionTypeSkip, fmt.Errorf("planning: %s: %w", d.ResourceKey, err)
2424
}
2525
return result, err
2626
}
@@ -197,7 +197,7 @@ func calcDiff(adapter *dresources.Adapter, savedState, config any) (deployplan.A
197197
}
198198

199199
if len(localDiff) == 0 {
200-
return deployplan.ActionTypeNoop, nil
200+
return deployplan.ActionTypeSkip, nil
201201
}
202202

203203
result := adapter.ClassifyByTriggers(localDiff)

cmd/bundle/plan.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ It is useful for previewing changes before running 'bundle deploy'.`,
8686
// A recreate counts as both a delete and a create
8787
deleteCount++
8888
createCount++
89-
case deployplan.ActionTypeNoop, deployplan.ActionTypeUnset:
89+
case deployplan.ActionTypeSkip, deployplan.ActionTypeUnset:
9090
// Noop
9191
}
9292
}

0 commit comments

Comments
 (0)