Skip to content

Commit df11348

Browse files
authored
actions: remove references to action types, linked resources (#37616)
* action renaming * actions: remove references to action types * actions: remove references to linked_resources or action types from the plan proto
1 parent 1048510 commit df11348

File tree

17 files changed

+634
-929
lines changed

17 files changed

+634
-929
lines changed

internal/command/jsonformat/plan_test.go

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8467,8 +8467,8 @@ func TestResourceChange_actions(t *testing.T) {
84678467
"before actions": {
84688468
actionInvocations: []jsonplan.ActionInvocation{
84698469
{
8470-
Address: "action.test_unlinked.hello",
8471-
Type: "test_unlinked",
8470+
Address: "action.test_action.hello",
8471+
Type: "test_action",
84728472
Name: "hello",
84738473
ProviderName: "registry.terraform.io/hashicorp/test",
84748474
LifecycleActionTrigger: &jsonplan.LifecycleActionTrigger{
@@ -8494,7 +8494,7 @@ func TestResourceChange_actions(t *testing.T) {
84948494
}
84958495
84968496
# Actions to be invoked before this change in order:
8497-
action "test_unlinked" "hello" {
8497+
action "test_action" "hello" {
84988498
config {
84998499
disk = {
85008500
size = "100"
@@ -8511,8 +8511,8 @@ func TestResourceChange_actions(t *testing.T) {
85118511
"after actions": {
85128512
actionInvocations: []jsonplan.ActionInvocation{
85138513
{
8514-
Address: "action.test_unlinked.hello",
8515-
Type: "test_unlinked",
8514+
Address: "action.test_action.hello",
8515+
Type: "test_action",
85168516
Name: "hello",
85178517
ProviderName: "registry.terraform.io/hashicorp/test",
85188518
LifecycleActionTrigger: &jsonplan.LifecycleActionTrigger{
@@ -8538,7 +8538,7 @@ func TestResourceChange_actions(t *testing.T) {
85388538
}
85398539
85408540
# Actions to be invoked after this change in order:
8541-
action "test_unlinked" "hello" {
8541+
action "test_action" "hello" {
85428542
config {
85438543
disk = {
85448544
size = "100"
@@ -8555,8 +8555,8 @@ func TestResourceChange_actions(t *testing.T) {
85558555
"before and after actions": {
85568556
actionInvocations: []jsonplan.ActionInvocation{
85578557
{
8558-
Address: "action.test_unlinked.hello",
8559-
Type: "test_unlinked",
8558+
Address: "action.test_action.hello",
8559+
Type: "test_action",
85608560
Name: "hello",
85618561
ProviderName: "registry.terraform.io/hashicorp/test",
85628562
LifecycleActionTrigger: &jsonplan.LifecycleActionTrigger{
@@ -8570,8 +8570,8 @@ func TestResourceChange_actions(t *testing.T) {
85708570
})),
85718571
},
85728572
{
8573-
Address: "action.test_unlinked.hello",
8574-
Type: "test_unlinked",
8573+
Address: "action.test_action.hello",
8574+
Type: "test_action",
85758575
Name: "hello",
85768576
ProviderName: "registry.terraform.io/hashicorp/test",
85778577
LifecycleActionTrigger: &jsonplan.LifecycleActionTrigger{
@@ -8585,8 +8585,8 @@ func TestResourceChange_actions(t *testing.T) {
85858585
})),
85868586
},
85878587
{
8588-
Address: "action.test_unlinked.hello",
8589-
Type: "test_unlinked",
8588+
Address: "action.test_action.hello",
8589+
Type: "test_action",
85908590
Name: "hello",
85918591
ProviderName: "registry.terraform.io/hashicorp/test",
85928592
LifecycleActionTrigger: &jsonplan.LifecycleActionTrigger{
@@ -8600,8 +8600,8 @@ func TestResourceChange_actions(t *testing.T) {
86008600
})),
86018601
},
86028602
{
8603-
Address: "action.test_unlinked.hello",
8604-
Type: "test_unlinked",
8603+
Address: "action.test_action.hello",
8604+
Type: "test_action",
86058605
Name: "hello",
86068606
ProviderName: "registry.terraform.io/hashicorp/test",
86078607
LifecycleActionTrigger: &jsonplan.LifecycleActionTrigger{
@@ -8615,8 +8615,8 @@ func TestResourceChange_actions(t *testing.T) {
86158615
})),
86168616
},
86178617
{
8618-
Address: "action.test_unlinked.hello",
8619-
Type: "test_unlinked",
8618+
Address: "action.test_action.hello",
8619+
Type: "test_action",
86208620
Name: "hello",
86218621
ProviderName: "registry.terraform.io/hashicorp/test",
86228622
LifecycleActionTrigger: &jsonplan.LifecycleActionTrigger{
@@ -8636,30 +8636,30 @@ func TestResourceChange_actions(t *testing.T) {
86368636
}
86378637
86388638
# Actions to be invoked before this change in order:
8639-
action "test_unlinked" "hello" {
8639+
action "test_action" "hello" {
86408640
config {
86418641
id = "first-block-and-action"
86428642
}
86438643
}
8644-
action "test_unlinked" "hello" {
8644+
action "test_action" "hello" {
86458645
config {
86468646
id = "first-block-second-action"
86478647
}
86488648
}
8649-
action "test_unlinked" "hello" {
8649+
action "test_action" "hello" {
86508650
config {
86518651
id = "fourth-block-first-action"
86528652
}
86538653
}
86548654
86558655
86568656
# Actions to be invoked after this change in order:
8657-
action "test_unlinked" "hello" {
8657+
action "test_action" "hello" {
86588658
config {
86598659
id = "second-block-first-action"
86608660
}
86618661
}
8662-
action "test_unlinked" "hello" {
8662+
action "test_action" "hello" {
86638663
config {
86648664
id = "third-block-first-action"
86658665
}
@@ -8669,8 +8669,8 @@ func TestResourceChange_actions(t *testing.T) {
86698669
"no config value": {
86708670
actionInvocations: []jsonplan.ActionInvocation{
86718671
{
8672-
Address: "action.test_unlinked.hello",
8673-
Type: "test_unlinked",
8672+
Address: "action.test_action.hello",
8673+
Type: "test_action",
86748674
Name: "hello",
86758675
ProviderName: "registry.terraform.io/hashicorp/test",
86768676
LifecycleActionTrigger: &jsonplan.LifecycleActionTrigger{
@@ -8687,7 +8687,7 @@ func TestResourceChange_actions(t *testing.T) {
86878687
}
86888688
86898689
# Actions to be invoked before this change in order:
8690-
action "test_unlinked" "hello" {
8690+
action "test_action" "hello" {
86918691
}
86928692
`,
86938693
},
@@ -8707,7 +8707,7 @@ func TestResourceChange_actions(t *testing.T) {
87078707
},
87088708
},
87098709
Actions: map[string]providers.ActionSchema{
8710-
"test_unlinked": {
8710+
"test_action": {
87118711
ConfigSchema: blockSchema,
87128712
},
87138713
},

internal/command/jsonprovider/provider_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ func TestMarshalProvider(t *testing.T) {
243243
},
244244
},
245245
Actions: map[string]providers.ActionSchema{
246-
"test_unlinked_action": {
246+
"test_action": {
247247
ConfigSchema: &configschema.Block{
248248
Attributes: map[string]*configschema.Attribute{
249249
"opt_attr": {Type: cty.String, Optional: true},
@@ -281,7 +281,7 @@ func TestMarshalProvider(t *testing.T) {
281281
},
282282
ResourceIdentitySchemas: map[string]*IdentitySchema{},
283283
ActionSchemas: map[string]*ActionSchema{
284-
"test_unlinked_action": {
284+
"test_action": {
285285
ConfigSchema: &Block{
286286
Attributes: map[string]*Attribute{
287287
"opt_attr": {

internal/command/show_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,7 @@ func showFixtureSchema() *providers.GetProviderSchemaResponse {
11281128
},
11291129
},
11301130
Actions: map[string]providers.ActionSchema{
1131-
"test_unlinked": {
1131+
"test_action": {
11321132
ConfigSchema: &configschema.Block{
11331133
Attributes: map[string]*configschema.Attribute{
11341134
"attr": {Type: cty.String, Optional: true},

internal/command/views/operation_test.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ func TestOperationJSON_plan_with_actions(t *testing.T) {
572572
beep := addrs.Resource{Mode: addrs.ManagedResourceMode, Type: "test_resource", Name: "beep"}.Instance(addrs.IntKey(0)).Absolute(vpc)
573573

574574
act1 := &plans.ActionInvocationInstanceSrc{
575-
Addr: addrs.Action{Type: "test_unlinked_action", Name: "hello"}.Instance(addrs.NoKey).Absolute(root),
575+
Addr: addrs.Action{Type: "test_action", Name: "hello"}.Instance(addrs.NoKey).Absolute(root),
576576
ActionTrigger: &plans.LifecycleActionTrigger{
577577
TriggeringResourceAddr: boop,
578578
ActionTriggerEvent: configs.AfterCreate,
@@ -581,7 +581,7 @@ func TestOperationJSON_plan_with_actions(t *testing.T) {
581581
},
582582
}
583583
act2 := &plans.ActionInvocationInstanceSrc{
584-
Addr: addrs.Action{Type: "test_unlinked_other_action", Name: "world"}.Instance(addrs.NoKey).Absolute(root),
584+
Addr: addrs.Action{Type: "test_other_action", Name: "world"}.Instance(addrs.NoKey).Absolute(root),
585585
ActionTrigger: &plans.LifecycleActionTrigger{
586586
TriggeringResourceAddr: boop,
587587
ActionTriggerEvent: configs.AfterCreate,
@@ -590,7 +590,7 @@ func TestOperationJSON_plan_with_actions(t *testing.T) {
590590
},
591591
}
592592
act3 := &plans.ActionInvocationInstanceSrc{
593-
Addr: addrs.Action{Type: "test_unlinked_action", Name: "goodbye"}.Instance(addrs.IntKey(0)).Absolute(vpc),
593+
Addr: addrs.Action{Type: "test_action", Name: "goodbye"}.Instance(addrs.IntKey(0)).Absolute(vpc),
594594
ActionTrigger: &plans.LifecycleActionTrigger{
595595
TriggeringResourceAddr: beep,
596596
ActionTriggerEvent: configs.BeforeUpdate,
@@ -665,18 +665,18 @@ func TestOperationJSON_plan_with_actions(t *testing.T) {
665665
// Action invocation 1
666666
{
667667
"@level": "info",
668-
"@message": "planned action invocation: action.test_unlinked_action.hello",
668+
"@message": "planned action invocation: action.test_action.hello",
669669
"@module": "terraform.ui",
670670
"type": "planned_action_invocation",
671671
"invocation": map[string]interface{}{
672672
"action_addr": map[string]interface{}{
673-
"addr": `action.test_unlinked_action.hello`,
673+
"addr": `action.test_action.hello`,
674674
"implied_provider": "test",
675675
"module": "",
676-
"action": `action.test_unlinked_action.hello`,
676+
"action": `action.test_action.hello`,
677677
"action_key": nil,
678678
"action_name": "hello",
679-
"action_type": "test_unlinked_action",
679+
"action_type": "test_action",
680680
},
681681
"lifecycle_trigger": map[string]interface{}{
682682
"action_trigger_block_index": float64(0),
@@ -697,18 +697,18 @@ func TestOperationJSON_plan_with_actions(t *testing.T) {
697697
// Action invocation 2
698698
{
699699
"@level": "info",
700-
"@message": "planned action invocation: action.test_unlinked_other_action.world",
700+
"@message": "planned action invocation: action.test_other_action.world",
701701
"@module": "terraform.ui",
702702
"type": "planned_action_invocation",
703703
"invocation": map[string]interface{}{
704704
"action_addr": map[string]interface{}{
705-
"addr": `action.test_unlinked_other_action.world`,
705+
"addr": `action.test_other_action.world`,
706706
"implied_provider": "test",
707707
"module": "",
708-
"action": `action.test_unlinked_other_action.world`,
708+
"action": `action.test_other_action.world`,
709709
"action_key": nil,
710710
"action_name": "world",
711-
"action_type": "test_unlinked_other_action",
711+
"action_type": "test_other_action",
712712
},
713713
"lifecycle_trigger": map[string]interface{}{
714714
"action_trigger_block_index": float64(0),
@@ -729,18 +729,18 @@ func TestOperationJSON_plan_with_actions(t *testing.T) {
729729
// Action invocation 3
730730
{
731731
"@level": "info",
732-
"@message": "planned action invocation: action.test_unlinked_action.goodbye[0]",
732+
"@message": "planned action invocation: action.test_action.goodbye[0]",
733733
"@module": "terraform.ui",
734734
"type": "planned_action_invocation",
735735
"invocation": map[string]interface{}{
736736
"action_addr": map[string]interface{}{
737-
"addr": `module.vpc.action.test_unlinked_action.goodbye[0]`,
737+
"addr": `module.vpc.action.test_action.goodbye[0]`,
738738
"implied_provider": "test",
739739
"module": "module.vpc",
740-
"action": `action.test_unlinked_action.goodbye[0]`,
740+
"action": `action.test_action.goodbye[0]`,
741741
"action_key": float64(0),
742742
"action_name": "goodbye",
743-
"action_type": "test_unlinked_action",
743+
"action_type": "test_action",
744744
},
745745
"lifecycle_trigger": map[string]interface{}{
746746
"action_trigger_block_index": float64(1),

0 commit comments

Comments
 (0)