Skip to content

Commit

Permalink
Revert "Only add an explicit dependency on an existing resource when …
Browse files Browse the repository at this point in the history
…the depl…"

This reverts commit 1dcdf46.
  • Loading branch information
jeskew authored Nov 8, 2024
1 parent 99579a9 commit 9d6b32b
Show file tree
Hide file tree
Showing 26 changed files with 175 additions and 515 deletions.
401 changes: 0 additions & 401 deletions src/Bicep.Core.IntegrationTests/ExistingResourceTests.cs

This file was deleted.

4 changes: 2 additions & 2 deletions src/Bicep.Core.IntegrationTests/ScenarioTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5065,7 +5065,7 @@ public void Test_Issue10343()
"));

var evaluated = TemplateEvaluator.Evaluate(result.Template);
evaluated.Should().HaveValueAtPath("resources.foo3.dependsOn", new JArray("foo1"));
evaluated.Should().HaveValueAtPath("resources.foo3.dependsOn", new JArray("foo2"));
}

// https://github.com/Azure/bicep/issues/11292
Expand Down Expand Up @@ -6315,7 +6315,7 @@ public void Test_Issue13596(bool enableSymbolicNameCodegen)

if (enableSymbolicNameCodegen)
{
result.Template.Should().HaveJsonAtPath("$.resources.secret.dependsOn", """["mod"]""");
result.Template.Should().HaveJsonAtPath("$.resources.secret.dependsOn", """["sa"]""");
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "14846102413726496336"
"templateHash": "12632249060210513106"
}
},
"parameters": {
Expand Down Expand Up @@ -1851,7 +1851,10 @@
}
}
}
}
},
"dependsOn": [
"kv"
]
},
"secureModule2": {
"type": "Microsoft.Resources/deployments",
Expand Down Expand Up @@ -1909,7 +1912,10 @@
}
}
}
}
},
"dependsOn": [
"scopedKv"
]
},
"secureModuleLooped": {
"copy": {
Expand Down Expand Up @@ -1971,7 +1977,11 @@
}
}
}
}
},
"dependsOn": [
"[format('loopedKv[{0}]', copyIndex())]",
"[format('loopedKv[{0}]', copyIndex())]"
]
},
"secureModuleCondition": {
"type": "Microsoft.Resources/deployments",
Expand Down Expand Up @@ -2014,7 +2024,10 @@
}
}
}
}
},
"dependsOn": [
"kv"
]
},
"withSpace": {
"type": "Microsoft.Resources/deployments",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "236868819280717113"
"templateHash": "16972434704035043060"
}
},
"parameters": {
Expand Down Expand Up @@ -71,13 +71,19 @@
"properties": {
"size": "[reference('existingParent').size]",
"style": "[reference('existingParent::existingChild').style]"
}
},
"dependsOn": [
"existingParent::existingChild"
]
},
"existingParent::existingChild": {
"existing": true,
"type": "My.Rp/parentType/childType",
"apiVersion": "2020-12-01",
"name": "[format('{0}/{1}', 'existingParent', 'existingChild')]"
"name": "[format('{0}/{1}', 'existingParent', 'existingChild')]",
"dependsOn": [
"existingParent"
]
},
"conditionParent::conditionChild::conditionGrandchild": {
"condition": "[and(and(parameters('createParent'), parameters('createChild')), parameters('createGrandchild'))]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "15062227467638827925"
"templateHash": "12953345672979673276"
}
},
"parameters": {
Expand Down Expand Up @@ -665,7 +665,10 @@
"p3_child1": {
"type": "Microsoft.Rp1/resource1/child1",
"apiVersion": "2020-06-01",
"name": "[format('{0}/{1}', 'res1', 'child1')]"
"name": "[format('{0}/{1}', 'res1', 'child1')]",
"dependsOn": [
"p3_res1"
]
},
"p4_res1": {
"existing": true,
Expand All @@ -679,7 +682,10 @@
"type": "Microsoft.Rp1/resource1/child1",
"apiVersion": "2020-06-01",
"scope": "/",
"name": "[format('{0}/{1}', 'res1', 'child1')]"
"name": "[format('{0}/{1}', 'res1', 'child1')]",
"dependsOn": [
"p4_res1"
]
},
"sqlServer": {
"type": "Microsoft.Sql/servers",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "14248540637091011874"
"templateHash": "11528852364160566097"
}
},
"parameters": {
Expand Down Expand Up @@ -56,7 +56,10 @@
"secret": "[variables('apimNameValueSet')[copyIndex()].isSecret]",
"value": "[variables('apimNameValueSet')[copyIndex()].value]",
"tags": "[variables('apimNameValueSet')[copyIndex()].tags]"
}
},
"dependsOn": [
"parentAPIM"
]
}
},
"outputs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "6816770503491912011"
"templateHash": "403029788224868668"
}
},
"parameters": {
Expand Down Expand Up @@ -47,7 +47,10 @@
"properties": {
"displayName": "[variables('groupsSet')[copyIndex()].groupDisplayName]",
"description": "[variables('groupsSet')[copyIndex()].groupDescription]"
}
},
"dependsOn": [
"parentAPIM"
]
}
},
"outputs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "2208926443863165998"
"templateHash": "13726378283629199613"
}
},
"parameters": {
Expand Down Expand Up @@ -163,7 +163,7 @@
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "6816770503491912011"
"templateHash": "403029788224868668"
}
},
"parameters": {
Expand Down Expand Up @@ -204,7 +204,10 @@
"properties": {
"displayName": "[variables('groupsSet')[copyIndex()].groupDisplayName]",
"description": "[variables('groupsSet')[copyIndex()].groupDescription]"
}
},
"dependsOn": [
"parentAPIM"
]
}
},
"outputs": {
Expand Down Expand Up @@ -248,7 +251,7 @@
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "16793550498477002119"
"templateHash": "8034218730798252475"
}
},
"parameters": {
Expand Down Expand Up @@ -298,7 +301,10 @@
"email": "[variables('usersSet')[copyIndex()].email]",
"state": "[variables('usersSet')[copyIndex()].state]",
"note": "[variables('usersSet')[copyIndex()].notes]"
}
},
"dependsOn": [
"parentAPIM"
]
}
}
}
Expand Down Expand Up @@ -330,7 +336,7 @@
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "14248540637091011874"
"templateHash": "11528852364160566097"
}
},
"parameters": {
Expand Down Expand Up @@ -380,7 +386,10 @@
"secret": "[variables('apimNameValueSet')[copyIndex()].isSecret]",
"value": "[variables('apimNameValueSet')[copyIndex()].value]",
"tags": "[variables('apimNameValueSet')[copyIndex()].tags]"
}
},
"dependsOn": [
"parentAPIM"
]
}
},
"outputs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "16793550498477002119"
"templateHash": "8034218730798252475"
}
},
"parameters": {
Expand Down Expand Up @@ -56,7 +56,10 @@
"email": "[variables('usersSet')[copyIndex()].email]",
"state": "[variables('usersSet')[copyIndex()].state]",
"note": "[variables('usersSet')[copyIndex()].notes]"
}
},
"dependsOn": [
"parentAPIM"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "12715898051173612753"
"templateHash": "5898567106534730923"
}
},
"parameters": {
Expand Down Expand Up @@ -149,7 +149,10 @@
]
}
}
}
},
"dependsOn": [
"existingVirtualNetwork"
]
},
"bastionHost": {
"type": "Microsoft.Network/bastionHosts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "14481747842301389436"
"templateHash": "16714276462655423062"
}
},
"parameters": {
Expand Down Expand Up @@ -275,6 +275,7 @@
}
},
"dependsOn": [
"managedResourceGroup",
"vnet"
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "746252077949181675"
"templateHash": "18250750169409311102"
}
},
"parameters": {
Expand Down Expand Up @@ -217,7 +217,7 @@
},
"dependsOn": [
"function",
"virtualNetwork"
"subnet"
]
},
"subnet": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "12321629843193403120"
"templateHash": "15369804211876997670"
}
},
"parameters": {
Expand All @@ -32,7 +32,10 @@
"apiVersion": "2019-06-01-preview",
"subscriptionId": "[parameters('templateSpecSub')]",
"resourceGroup": "[parameters('templateSpecRg')]",
"name": "[format('{0}/{1}', parameters('templateSpecName'), parameters('templateSpecVersion'))]"
"name": "[format('{0}/{1}', parameters('templateSpecName'), parameters('templateSpecVersion'))]",
"dependsOn": [
"ts"
]
},
"ts": {
"existing": true,
Expand All @@ -52,7 +55,10 @@
"id": "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', parameters('templateSpecSub'), parameters('templateSpecRg')), 'Microsoft.Resources/templateSpecs/versions', parameters('templateSpecName'), parameters('templateSpecVersion'))]"
},
"parameters": {}
}
},
"dependsOn": [
"ts"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "15571119746721048953"
"templateHash": "13381616690819142544"
}
},
"parameters": {
Expand Down Expand Up @@ -82,6 +82,7 @@
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('farmName'))]"
},
"dependsOn": [
"containerRegistry",
"farm"
]
},
Expand Down
Loading

0 comments on commit 9d6b32b

Please sign in to comment.