diff --git a/docs/experimental-features.md b/docs/experimental-features.md
index bb9a95f10d1..452e8600bd3 100644
--- a/docs/experimental-features.md
+++ b/docs/experimental-features.md
@@ -91,9 +91,9 @@ Enables the `@validate()` decorator on types, type properties, parameters, and o
param p string
```
-### `waitUntil`
+### `waitAndRetry`
-The feature introduces waitUntil decorators on resource data type. waitUntil() decorator waits for the resource until its usable based on the desired property's state.
+The feature introduces waitUntil and retryOn decorators on resource data type. waitUnitl() decorator waits for the resource until its usable based on the desired property's state. retryOn() will retry the deployment if one if the listed exception codes are encountered.
## Other experimental functionality
diff --git a/src/Bicep.Core.IntegrationTests/Decorators/OnlyIfNotExistsDecoratorTests.cs b/src/Bicep.Core.IntegrationTests/Decorators/OnlyIfNotExistsDecoratorTests.cs
index fca13e79375..1d8aabae1aa 100644
--- a/src/Bicep.Core.IntegrationTests/Decorators/OnlyIfNotExistsDecoratorTests.cs
+++ b/src/Bicep.Core.IntegrationTests/Decorators/OnlyIfNotExistsDecoratorTests.cs
@@ -48,7 +48,7 @@ public void OnlyIfNotExistsDecorator_ValidScenario()
[TestMethod]
public void OnlyIfNotExistsAndRetryOnDecorator_ValidScenario()
{
- var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext));
+ var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitAndRetryEnabled: true));
var (template, diagnostics, _) = CompilationHelper.Compile(services, @"
@onlyIfNotExists()
@retryOn(['ResourceNotFound', 'ServerError'], 1)
@@ -70,7 +70,7 @@ public void OnlyIfNotExistsAndRetryOnDecorator_ValidScenario()
{
diagnostics.ExcludingLinterDiagnostics().Should().BeEmpty();
- template.Should().NotBeNull().And.HaveValueAtPath("$.languageVersion", "2.0");
+ template.Should().NotBeNull().And.HaveValueAtPath("$.languageVersion", "2.1-experimental");
template.Should().NotBeNull()
.And.HaveValueAtPath("$.resources['sqlServer'].@options.onlyIfNotExists", onlyIfNotExistsJObject);
template.Should().NotBeNull()
diff --git a/src/Bicep.Core.IntegrationTests/Decorators/RetryOnDecoratorTests.cs b/src/Bicep.Core.IntegrationTests/Decorators/RetryOnDecoratorTests.cs
index c9cba19ec73..ae76bbd05bf 100644
--- a/src/Bicep.Core.IntegrationTests/Decorators/RetryOnDecoratorTests.cs
+++ b/src/Bicep.Core.IntegrationTests/Decorators/RetryOnDecoratorTests.cs
@@ -23,7 +23,7 @@ public class RetryOnDecoratorTests
[TestMethod]
public void RetryOnDecorator_InvalidErrorMessageItemType()
{
- var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext));
+ var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitAndRetryEnabled: true));
var (template, diagnostics, _) = CompilationHelper.Compile(services, @"
@retryOn(['ResourceNotFound', 1010])
resource sqlServer 'Microsoft.Sql/servers@2021-11-01' = {
@@ -45,7 +45,7 @@ public void RetryOnDecorator_InvalidErrorMessageItemType()
[TestMethod]
public void RetryOnDecorator_ValidScenario()
{
- var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext));
+ var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitAndRetryEnabled: true));
var (template, diagnostics, _) = CompilationHelper.Compile(services, @"
@retryOn(['ResourceNotFound', 'ServerError'], 1)
resource sqlServer 'Microsoft.Sql/servers@2021-11-01' = {
@@ -63,7 +63,7 @@ public void RetryOnDecorator_ValidScenario()
using (new AssertionScope())
{
diagnostics.ExcludingLinterDiagnostics().Should().BeEmpty();
- template.Should().NotBeNull().And.HaveValueAtPath("$.languageVersion", "2.0");
+ template.Should().NotBeNull().And.HaveValueAtPath("$.languageVersion", "2.1-experimental");
template.Should().NotBeNull()
.And.HaveValueAtPath("$.resources['sqlServer'].@options.retryOn", retryOnJObject);
}
@@ -72,7 +72,7 @@ public void RetryOnDecorator_ValidScenario()
[TestMethod]
public void RetryOnDecorator_ExpectedResourceDeclaration()
{
- var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext));
+ var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitAndRetryEnabled: true));
var (template, diagnostics, _) = CompilationHelper.Compile(services, @"
@retryOn(['ResourceNotFound'])
");
@@ -88,7 +88,7 @@ public void RetryOnDecorator_ExpectedResourceDeclaration()
[TestMethod]
public void RetryOnDecorator_WithModuleDeclaration_ShouldFail()
{
- var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext));
+ var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitAndRetryEnabled: true));
var mainUri = new Uri("file:///main.bicep");
var moduleUri = new Uri("file:///module.bicep");
@@ -127,7 +127,7 @@ param inputb string
[TestMethod]
public void RetryOnDecorator_WithRetryCountOptionalParameter_ExpectedResourceDeclaration()
{
- var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext));
+ var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitAndRetryEnabled: true));
var (template, diagnostics, _) = CompilationHelper.Compile(services, @"
@retryOn(['ResourceNotFound'], 5)
");
@@ -143,7 +143,7 @@ public void RetryOnDecorator_WithRetryCountOptionalParameter_ExpectedResourceDec
[TestMethod]
public void RetryOnDecorator_InvalidRetryCount()
{
- var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext));
+ var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitAndRetryEnabled: true));
var (template, diagnostics, _) = CompilationHelper.Compile(services, @"
@retryOn(['ResourceNotFound'], 0)
resource sqlServer 'Microsoft.Sql/servers@2021-11-01' = {
@@ -163,7 +163,7 @@ public void RetryOnDecorator_InvalidRetryCount()
[TestMethod]
public void RetryOnDecorator_NegativeRetryCount()
{
- var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext));
+ var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitAndRetryEnabled: true));
var (template, diagnostics, _) = CompilationHelper.Compile(services, @"
@retryOn(['ResourceNotFound'], -5)
resource sqlServer 'Microsoft.Sql/servers@2021-11-01' = {
@@ -183,7 +183,7 @@ public void RetryOnDecorator_NegativeRetryCount()
[TestMethod]
public void RetryOnDecorator_NonIntegerRetryCountValue()
{
- var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext));
+ var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitAndRetryEnabled: true));
var (template, diagnostics, _) = CompilationHelper.Compile(services, @"
@retryOn(['ResourceNotFound'], 'randomString')
resource sqlServer 'Microsoft.Sql/servers@2021-11-01' = {
@@ -204,7 +204,7 @@ public void RetryOnDecorator_NonIntegerRetryCountValue()
[TestMethod]
public void RetryOnDecoratorWithCollections_ValidScenario()
{
- var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext));
+ var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitAndRetryEnabled: true));
var (template, diagnostics, _) = CompilationHelper.Compile(services, @"
@retryOn(['ResourceNotFound', 'ServerError'], 1)
resource sqlServer 'Microsoft.Sql/servers@2021-11-01' = [for i in range(1, 2):{
@@ -222,7 +222,7 @@ public void RetryOnDecoratorWithCollections_ValidScenario()
using (new AssertionScope())
{
diagnostics.ExcludingLinterDiagnostics().Should().BeEmpty();
- template.Should().NotBeNull().And.HaveValueAtPath("$.languageVersion", "2.0");
+
template.Should().NotBeNull()
.And.HaveValueAtPath("$.resources['sqlServer'].@options.retryOn", retryOnJObject);
}
@@ -231,7 +231,7 @@ public void RetryOnDecoratorWithCollections_ValidScenario()
[TestMethod]
public void RetryOnDecoratorWithCollection_InvalidErrorMessageItemType()
{
- var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext));
+ var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitAndRetryEnabled: true));
var (template, diagnostics, _) = CompilationHelper.Compile(services, @"
@retryOn(['ResourceNotFound', 1010])
resource sqlServer 'Microsoft.Sql/servers@2021-11-01' = [for i in range(1, 2):{
@@ -253,7 +253,7 @@ public void RetryOnDecoratorWithCollection_InvalidErrorMessageItemType()
[TestMethod]
public void RetryOnDecoratorWithCollection_InvalidRetryCount()
{
- var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext));
+ var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitAndRetryEnabled: true));
var (template, diagnostics, _) = CompilationHelper.Compile(services, @"
@retryOn(['ResourceNotFound'], 0)
resource sqlServer 'Microsoft.Sql/servers@2021-11-01' = [for i in range(1, 2):{
@@ -273,7 +273,7 @@ public void RetryOnDecoratorWithCollection_InvalidRetryCount()
[TestMethod]
public void RetryOnDecoratorWithCollection_NegativeRetryCount()
{
- var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext));
+ var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitAndRetryEnabled: true));
var (template, diagnostics, _) = CompilationHelper.Compile(services, @"
@retryOn(['ResourceNotFound'], -5)
resource sqlServer 'Microsoft.Sql/servers@2021-11-01' = [for i in range(1, 2):{
@@ -293,7 +293,7 @@ public void RetryOnDecoratorWithCollection_NegativeRetryCount()
[TestMethod]
public void RetryOnDecoratorWithCollections_NonIntegerRetryCountValue()
{
- var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext));
+ var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitAndRetryEnabled: true));
var (template, diagnostics, _) = CompilationHelper.Compile(services, @"
@retryOn(['ResourceNotFound'], 'randomString')
resource sqlServer 'Microsoft.Sql/servers@2021-11-01' = [for i in range(1, 2):{
diff --git a/src/Bicep.Core.IntegrationTests/Decorators/WaitUntilDecoratorTests.cs b/src/Bicep.Core.IntegrationTests/Decorators/WaitUntilDecoratorTests.cs
index 375a82f6076..45876fe214f 100644
--- a/src/Bicep.Core.IntegrationTests/Decorators/WaitUntilDecoratorTests.cs
+++ b/src/Bicep.Core.IntegrationTests/Decorators/WaitUntilDecoratorTests.cs
@@ -25,7 +25,7 @@ public class WaitUntilDecoratorTests
[DataRow("@waitUntil(x => x.ProvisionStatus == 'Succeeded' && x.routingState == 'Provisioned', 'PT20S')", "[lambda('x', and(equals(lambdaVariables('x').ProvisionStatus, 'Succeeded'), equals(lambdaVariables('x').routingState, 'Provisioned')))]")]
public void WaitUntilDecorator_ValidScenario(string input, string output)
{
- var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitUntilEnabled: true));
+ var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitAndRetryEnabled: true));
var fileContent = $@"
{input}
resource sqlServer 'Microsoft.Sql/servers@2021-11-01' = {{
@@ -53,7 +53,7 @@ public void WaitUntilDecorator_ValidScenario(string input, string output)
[TestMethod]
public void WaitUntilDecorator_MissingDeclaration_ExpectedResourceDeclaration()
{
- var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitUntilEnabled: true));
+ var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitAndRetryEnabled: true));
var (template, diagnostics, _) = CompilationHelper.Compile(services, @"
@waitUntil(x => x.ProvisionStatus == 'Succeeded', 'PT20S')
");
@@ -69,7 +69,7 @@ public void WaitUntilDecorator_MissingDeclaration_ExpectedResourceDeclaration()
[TestMethod]
public void WaitUntilDecorator_MissingParameters_ExpectedTwoParameters()
{
- var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitUntilEnabled: true));
+ var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitAndRetryEnabled: true));
var (template, diagnostics, _) = CompilationHelper.Compile(services, @"
@waitUntil(x => x.ProvisionStatus == 'Succeeded')
");
@@ -87,7 +87,7 @@ public void WaitUntilDecorator_MissingParameters_ExpectedTwoParameters()
[TestMethod]
public void WaitUntilDecorator_WithModuleDeclaration_ShouldFail()
{
- var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitUntilEnabled: true));
+ var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitAndRetryEnabled: true));
var mainUri = new Uri("file:///main.bicep");
var moduleUri = new Uri("file:///module.bicep");
@@ -126,7 +126,7 @@ param inputb string
[TestMethod]
public void WaitUntilDecorator_FirstArgumentIsntLambda()
{
- var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitUntilEnabled: true));
+ var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitAndRetryEnabled: true));
var (template, diagnostics, _) = CompilationHelper.Compile(services, $@"
@waitUntil('PT20S', x => x.ProvisionStatus == 'Succeeded')
@@ -148,7 +148,7 @@ public void WaitUntilDecorator_FirstArgumentIsntLambda()
[TestMethod]
public void WaitUntilDecorator_SecondArgumentIsntString()
{
- var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitUntilEnabled: true));
+ var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitAndRetryEnabled: true));
var (template, diagnostics, _) = CompilationHelper.Compile(services, $@"
@waitUntil( x => x.ProvisionStatus == 'Succeeded', 1)
@@ -172,7 +172,7 @@ public void WaitUntilDecorator_SecondArgumentIsntString()
[DataRow("@waitUntil(x => x.ProvisionStatus == 'Succeeded' && x.routingState == 'Provisioned', 'PT20S')", "[lambda('x', and(equals(lambdaVariables('x').ProvisionStatus, 'Succeeded'), equals(lambdaVariables('x').routingState, 'Provisioned')))]")]
public void WaitUntilDecoratorWithCollection_ValidScenario(string input, string output)
{
- var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitUntilEnabled: true));
+ var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitAndRetryEnabled: true));
var fileContent = $@"
{input}
resource sqlServer 'Microsoft.Sql/servers@2021-11-01' = [for i in range(0, 2) :{{
@@ -200,7 +200,7 @@ public void WaitUntilDecoratorWithCollection_ValidScenario(string input, string
[TestMethod]
public void WaitUntilDecoratorWithCollection_FirstArgumentIsntLambda()
{
- var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitUntilEnabled: true));
+ var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitAndRetryEnabled: true));
var (template, diagnostics, _) = CompilationHelper.Compile(services, $@"
@waitUntil('PT20S', x => x.ProvisionStatus == 'Succeeded')
@@ -222,7 +222,7 @@ public void WaitUntilDecoratorWithCollection_FirstArgumentIsntLambda()
[TestMethod]
public void WaitUntilDecoratorWithCollection_SecondArgumentIsntString()
{
- var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitUntilEnabled: true));
+ var services = new ServiceBuilder().WithFeatureOverrides(new FeatureProviderOverrides(TestContext, WaitAndRetryEnabled: true));
var (template, diagnostics, _) = CompilationHelper.Compile(services, $@"
@waitUntil( x => x.ProvisionStatus == 'Succeeded', 1)
diff --git a/src/Bicep.Core.Samples/Files/baselines/InvalidOutputs_CRLF/Completions/decorators.json b/src/Bicep.Core.Samples/Files/baselines/InvalidOutputs_CRLF/Completions/decorators.json
index 25c0fa308c9..0c36ef0c0d3 100644
--- a/src/Bicep.Core.Samples/Files/baselines/InvalidOutputs_CRLF/Completions/decorators.json
+++ b/src/Bicep.Core.Samples/Files/baselines/InvalidOutputs_CRLF/Completions/decorators.json
@@ -222,27 +222,6 @@
"newText": "onlyIfNotExists()$0"
}
},
- {
- "label": "retryOn",
- "kind": "function",
- "documentation": {
- "kind": "markdown",
- "value": "```bicep\nretryOn(exceptionCodes: string[], [retryCount: int]): any\n\n``` \n \n"
- },
- "deprecated": false,
- "preselect": false,
- "sortText": "3_retryOn",
- "insertTextFormat": "snippet",
- "insertTextMode": "adjustIndentation",
- "textEdit": {
- "range": {},
- "newText": "retryOn($0)"
- },
- "command": {
- "title": "signature help",
- "command": "editor.action.triggerParameterHints"
- }
- },
{
"label": "sealed",
"kind": "function",
diff --git a/src/Bicep.Core.Samples/Files/baselines/InvalidOutputs_CRLF/Completions/decoratorsPlusNamespace.json b/src/Bicep.Core.Samples/Files/baselines/InvalidOutputs_CRLF/Completions/decoratorsPlusNamespace.json
index ff8e3922958..f3786fa7604 100644
--- a/src/Bicep.Core.Samples/Files/baselines/InvalidOutputs_CRLF/Completions/decoratorsPlusNamespace.json
+++ b/src/Bicep.Core.Samples/Files/baselines/InvalidOutputs_CRLF/Completions/decoratorsPlusNamespace.json
@@ -222,27 +222,6 @@
"newText": "onlyIfNotExists()$0"
}
},
- {
- "label": "retryOn",
- "kind": "function",
- "documentation": {
- "kind": "markdown",
- "value": "```bicep\nretryOn(exceptionCodes: string[], [retryCount: int]): any\n\n``` \n \n"
- },
- "deprecated": false,
- "preselect": false,
- "sortText": "3_retryOn",
- "insertTextFormat": "snippet",
- "insertTextMode": "adjustIndentation",
- "textEdit": {
- "range": {},
- "newText": "retryOn($0)"
- },
- "command": {
- "title": "signature help",
- "command": "editor.action.triggerParameterHints"
- }
- },
{
"label": "sealed",
"kind": "function",
diff --git a/src/Bicep.Core.UnitTests/Configuration/ConfigurationManagerTests.cs b/src/Bicep.Core.UnitTests/Configuration/ConfigurationManagerTests.cs
index 85677b3c181..35f4480c418 100644
--- a/src/Bicep.Core.UnitTests/Configuration/ConfigurationManagerTests.cs
+++ b/src/Bicep.Core.UnitTests/Configuration/ConfigurationManagerTests.cs
@@ -107,7 +107,7 @@ public void GetBuiltInConfiguration_NoParameter_ReturnsBuiltInConfigurationWithA
"legacyFormatter": false,
"testFramework": false,
"assertions": false,
- "waitUntil": false,
+ "waitAndRetry": false,
"localDeploy": false,
"resourceInfoCodegen": false,
"userDefinedConstraints": false,
@@ -190,7 +190,7 @@ public void GetBuiltInConfiguration_DisableAllAnalyzers_ReturnsBuiltInConfigurat
"legacyFormatter": false,
"testFramework": false,
"assertions": false,
- "waitUntil": false,
+ "waitAndRetry": false,
"localDeploy": false,
"resourceInfoCodegen": false,
"moduleExtensionConfigs": false,
@@ -296,7 +296,7 @@ public void GetBuiltInConfiguration_DisableAnalyzers_ReturnsBuiltInConfiguration
"legacyFormatter": false,
"testFramework": false,
"assertions": false,
- "waitUntil": false,
+ "waitAndRetry": false,
"localDeploy": false,
"resourceInfoCodegen": false,
"moduleExtensionConfigs": false,
@@ -383,7 +383,7 @@ public void GetBuiltInConfiguration_EnableExperimentalFeature_ReturnsBuiltInConf
LegacyFormatter: false,
TestFramework: false,
Assertions: false,
- WaitUntil: false,
+ WaitAndRetry: false,
LocalDeploy: false,
ResourceInfoCodegen: false,
ModuleExtensionConfigs: false,
@@ -468,7 +468,7 @@ public void GetBuiltInConfiguration_EnableExperimentalFeature_ReturnsBuiltInConf
"legacyFormatter": false,
"testFramework": false,
"assertions": false,
- "waitUntil": false,
+ "waitAndRetry": false,
"localDeploy": false,
"resourceInfoCodegen": false,
"moduleExtensionConfigs": false,
@@ -820,7 +820,7 @@ public void GetConfiguration_ValidCustomConfiguration_OverridesBuiltInConfigurat
"legacyFormatter": false,
"testFramework": false,
"assertions": false,
- "waitUntil": false,
+ "waitAndRetry": false,
"localDeploy": false,
"resourceInfoCodegen": false,
"moduleExtensionConfigs": false,
diff --git a/src/Bicep.Core.UnitTests/Features/FeatureProviderOverrides.cs b/src/Bicep.Core.UnitTests/Features/FeatureProviderOverrides.cs
index 90e90324550..3d8c408b78e 100644
--- a/src/Bicep.Core.UnitTests/Features/FeatureProviderOverrides.cs
+++ b/src/Bicep.Core.UnitTests/Features/FeatureProviderOverrides.cs
@@ -17,7 +17,7 @@ public record FeatureProviderOverrides(
bool? LegacyFormatterEnabled = default,
bool? TestFrameworkEnabled = default,
bool? AssertsEnabled = default,
- bool? WaitUntilEnabled = default,
+ bool? WaitAndRetryEnabled = default,
bool? LocalDeployEnabled = default,
bool? ResourceInfoCodegenEnabled = default,
bool? ExtendableParamFilesEnabled = default,
@@ -38,7 +38,7 @@ public FeatureProviderOverrides(
bool? LegacyFormatterEnabled = default,
bool? TestFrameworkEnabled = default,
bool? AssertsEnabled = default,
- bool? WaitUntilEnabled = default,
+ bool? WaitAndRetryEnabled = default,
bool? LocalDeployEnabled = default,
bool? ResourceInfoCodegenEnabled = default,
bool? ExtendableParamFilesEnabled = default,
@@ -57,7 +57,7 @@ public FeatureProviderOverrides(
LegacyFormatterEnabled,
TestFrameworkEnabled,
AssertsEnabled,
- WaitUntilEnabled,
+ WaitAndRetryEnabled,
LocalDeployEnabled,
ResourceInfoCodegenEnabled,
ExtendableParamFilesEnabled,
diff --git a/src/Bicep.Core.UnitTests/Features/OverriddenFeatureProvider.cs b/src/Bicep.Core.UnitTests/Features/OverriddenFeatureProvider.cs
index d4070cfa517..03bf13d3fb1 100644
--- a/src/Bicep.Core.UnitTests/Features/OverriddenFeatureProvider.cs
+++ b/src/Bicep.Core.UnitTests/Features/OverriddenFeatureProvider.cs
@@ -33,7 +33,7 @@ public OverriddenFeatureProvider(IFeatureProvider features, FeatureProviderOverr
public bool AssertsEnabled => overrides.AssertsEnabled ?? features.AssertsEnabled;
- public bool WaitUntilEnabled => overrides.WaitUntilEnabled ?? features.WaitUntilEnabled;
+ public bool WaitAndRetryEnabled => overrides.WaitAndRetryEnabled ?? features.WaitAndRetryEnabled;
public bool LocalDeployEnabled => overrides.LocalDeployEnabled ?? features.LocalDeployEnabled;
diff --git a/src/Bicep.Core/Configuration/ExperimentalFeaturesEnabled.cs b/src/Bicep.Core/Configuration/ExperimentalFeaturesEnabled.cs
index f268cb3f2f7..64cd7911e95 100644
--- a/src/Bicep.Core/Configuration/ExperimentalFeaturesEnabled.cs
+++ b/src/Bicep.Core/Configuration/ExperimentalFeaturesEnabled.cs
@@ -17,7 +17,7 @@ public record ExperimentalFeaturesEnabled(
bool LegacyFormatter,
bool TestFramework,
bool Assertions,
- bool WaitUntil,
+ bool WaitAndRetry,
bool LocalDeploy,
bool ResourceInfoCodegen,
bool ModuleExtensionConfigs,
@@ -39,7 +39,7 @@ public static ExperimentalFeaturesEnabled Bind(JsonElement element)
LegacyFormatter: false,
TestFramework: false,
Assertions: false,
- WaitUntil: false,
+ WaitAndRetry: false,
LocalDeploy: false,
ResourceInfoCodegen: false,
ModuleExtensionConfigs: false,
diff --git a/src/Bicep.Core/CoreResources.Designer.cs b/src/Bicep.Core/CoreResources.Designer.cs
index 70da42aa53c..cfa5abe6a16 100644
--- a/src/Bicep.Core/CoreResources.Designer.cs
+++ b/src/Bicep.Core/CoreResources.Designer.cs
@@ -223,11 +223,11 @@ internal static string ExperimentalFeatureNames_TestFramework {
}
///
- /// Looks up a localized string similar to Enable waitUntil feature on resource bicep types.
+ /// Looks up a localized string similar to Enable wait and retry feature.
///
- internal static string ExperimentalFeatureNames_WaitUntil {
+ internal static string ExperimentalFeatureNames_WaitAndRetry {
get {
- return ResourceManager.GetString("ExperimentalFeatureNames_WaitUntil", resourceCulture);
+ return ResourceManager.GetString("ExperimentalFeatureNames_WaitAndRetry", resourceCulture);
}
}
diff --git a/src/Bicep.Core/CoreResources.resx b/src/Bicep.Core/CoreResources.resx
index 24a0e6985a2..3b9f9973830 100644
--- a/src/Bicep.Core/CoreResources.resx
+++ b/src/Bicep.Core/CoreResources.resx
@@ -498,8 +498,8 @@
Test framework
-
- Enable waitUntil feature on resource bicep types
+
+ Enable wait and retry feature
Nested deployment resources cannot refer to top-level symbols from within the 'template' property when inner-scoped evaluation is used.
diff --git a/src/Bicep.Core/Emit/EmitterSettings.cs b/src/Bicep.Core/Emit/EmitterSettings.cs
index 7ba58400b5c..ef59c51452c 100644
--- a/src/Bicep.Core/Emit/EmitterSettings.cs
+++ b/src/Bicep.Core/Emit/EmitterSettings.cs
@@ -60,8 +60,7 @@ syntax is UnionTypeSyntax ||
function: (found, syntax) => found ||
(syntax is ResourceDeclarationSyntax rds && ResourceRequiresSymbolicNames(model, rds)),
resultSelector: result => result,
- continuationFunction: (result, syntax) => !result) ||
- model.Root.ResourceDeclarations.Any(resource => resource.TryGetDecorator(model, SystemNamespaceType.BuiltInName, LanguageConstants.RetryOnPropertyName) is not null);
+ continuationFunction: (result, syntax) => !result);
}
///
diff --git a/src/Bicep.Core/Features/FeatureProvider.cs b/src/Bicep.Core/Features/FeatureProvider.cs
index 1ba7aee0a08..3e9bc7de0b8 100644
--- a/src/Bicep.Core/Features/FeatureProvider.cs
+++ b/src/Bicep.Core/Features/FeatureProvider.cs
@@ -42,7 +42,7 @@ public FeatureProvider(RootConfiguration configuration, IFileExplorer fileExplor
public static bool HasTracingVerbosity(TraceVerbosity verbosity) => TracingVerbosity >= verbosity;
- public bool WaitUntilEnabled => configuration.ExperimentalFeaturesEnabled.WaitUntil;
+ public bool WaitAndRetryEnabled => configuration.ExperimentalFeaturesEnabled.WaitAndRetry;
public bool LocalDeployEnabled => configuration.ExperimentalFeaturesEnabled.LocalDeploy;
diff --git a/src/Bicep.Core/Features/IFeatureProvider.cs b/src/Bicep.Core/Features/IFeatureProvider.cs
index d86a8aec003..27ad458e318 100644
--- a/src/Bicep.Core/Features/IFeatureProvider.cs
+++ b/src/Bicep.Core/Features/IFeatureProvider.cs
@@ -23,7 +23,7 @@ public interface IFeatureProvider
bool AssertsEnabled { get; }
- bool WaitUntilEnabled { get; }
+ bool WaitAndRetryEnabled { get; }
bool LocalDeployEnabled { get; }
@@ -55,7 +55,7 @@ public interface IFeatureProvider
(SourceMappingEnabled, CoreResources.ExperimentalFeatureNames_SourceMapping, true, false),
(TestFrameworkEnabled, CoreResources.ExperimentalFeatureNames_TestFramework, false, false),
(AssertsEnabled, CoreResources.ExperimentalFeatureNames_Asserts, true, true),
- (WaitUntilEnabled, CoreResources.ExperimentalFeatureNames_WaitUntil, true, true),
+ (WaitAndRetryEnabled, CoreResources.ExperimentalFeatureNames_WaitAndRetry, true, true),
(LocalDeployEnabled, "Enable local deploy", true, true),
(ExtendableParamFilesEnabled, "Enable extendable parameters", true, false),
(ModuleExtensionConfigsEnabled, "Enable defining extension configs for modules", true, true),
diff --git a/src/Bicep.Core/Features/RecordBasedFeatureProvider.cs b/src/Bicep.Core/Features/RecordBasedFeatureProvider.cs
index 0e58789bf5d..3ddadf1412e 100644
--- a/src/Bicep.Core/Features/RecordBasedFeatureProvider.cs
+++ b/src/Bicep.Core/Features/RecordBasedFeatureProvider.cs
@@ -18,7 +18,7 @@ public class RecordBasedFeatureProvider(ExperimentalFeaturesEnabled features) :
public bool LegacyFormatterEnabled => features.LegacyFormatter;
public bool TestFrameworkEnabled => features.TestFramework;
public bool AssertsEnabled => features.Assertions;
- public bool WaitUntilEnabled => features.WaitUntil;
+ public bool WaitAndRetryEnabled => features.WaitAndRetry;
public bool LocalDeployEnabled => features.LocalDeploy;
public bool ExtendableParamFilesEnabled => features.ExtendableParamFiles;
public bool ResourceInfoCodegenEnabled => features.ResourceInfoCodegen;
diff --git a/src/Bicep.Core/Semantics/Namespaces/SystemNamespaceType.cs b/src/Bicep.Core/Semantics/Namespaces/SystemNamespaceType.cs
index 14c5a685934..622275c4231 100644
--- a/src/Bicep.Core/Semantics/Namespaces/SystemNamespaceType.cs
+++ b/src/Bicep.Core/Semantics/Namespaces/SystemNamespaceType.cs
@@ -2030,7 +2030,7 @@ static IEnumerable GetBicepTemplateDecorators(IFeatureProvider featur
})
.Build();
- if (featureProvider.WaitUntilEnabled)
+ if (featureProvider.WaitAndRetryEnabled)
{
yield return new DecoratorBuilder(LanguageConstants.WaitUntilPropertyName)
.WithDescription("Causes the resource deployment to wait until the given condition is satisfied")
@@ -2047,15 +2047,16 @@ static IEnumerable GetBicepTemplateDecorators(IFeatureProvider featur
.WithFlags(FunctionFlags.ResourceDecorator)// the decorator is constrained to resources
.WithEvaluator(AddDecoratorConfigToResource)
.Build();
+
+ yield return new DecoratorBuilder(LanguageConstants.RetryOnPropertyName)
+ .WithDescription("Causes the resource deployment to retry when deployment failed with one of the exceptions listed")
+ .WithParameter("exceptionCodes", LanguageConstants.StringArray, "List of exceptions.", FunctionParameterFlags.Required | FunctionParameterFlags.Constant)
+ .WithParameter("retryCount", TypeFactory.CreateIntegerType(minValue: 1), "Maximum number if retries on the exception.", FunctionParameterFlags.Constant)
+ .WithFlags(FunctionFlags.ResourceDecorator)// the decorator is constrained to resources
+ .WithEvaluator(AddDecoratorConfigToResource)
+ .Build();
}
- yield return new DecoratorBuilder(LanguageConstants.RetryOnPropertyName)
- .WithDescription("Causes the resource deployment to retry when deployment failed with one of the exceptions listed")
- .WithParameter("exceptionCodes", LanguageConstants.StringArray, "List of exceptions.", FunctionParameterFlags.Required | FunctionParameterFlags.Constant)
- .WithParameter("retryCount", TypeFactory.CreateIntegerType(minValue: 1), "Maximum number if retries on the exception.", FunctionParameterFlags.Constant)
- .WithFlags(FunctionFlags.ResourceDecorator)// the decorator is constrained to resources
- .WithEvaluator(AddDecoratorConfigToResource)
- .Build();
yield return new DecoratorBuilder(LanguageConstants.OnlyIfNotExistsPropertyName)
.WithDescription("Causes the resource deployment to be skipped if the resource already exists")
diff --git a/src/vscode-bicep/schemas/bicepconfig.schema.json b/src/vscode-bicep/schemas/bicepconfig.schema.json
index 76ff978997d..3e09e2e8966 100644
--- a/src/vscode-bicep/schemas/bicepconfig.schema.json
+++ b/src/vscode-bicep/schemas/bicepconfig.schema.json
@@ -910,9 +910,9 @@
"type": "boolean",
"description": "Enabling this feature turns on support for local Bicep deployments. See https://aka.ms/bicep/experimental-features#localdeploy"
},
- "waitUntil": {
+ "waitAndRetry": {
"type": "boolean",
- "description": "Allows to enable waitUntil feature on resource type. See https://aka.ms/bicep/experimental-features#waituntil"
+ "description": "Allows to enable wait and retry feature on resource type. See https://aka.ms/bicep/experimental-features#waitandretry"
},
"resourceInfoCodegen": {
"type": "boolean",