diff --git a/src/Bicep.Core.IntegrationTests/CompileTimeImportTests.cs b/src/Bicep.Core.IntegrationTests/CompileTimeImportTests.cs index c6f48d5f239..34ae159a1b3 100644 --- a/src/Bicep.Core.IntegrationTests/CompileTimeImportTests.cs +++ b/src/Bicep.Core.IntegrationTests/CompileTimeImportTests.cs @@ -2180,7 +2180,7 @@ public void Resource_derived_typed_compile_time_imports_raise_diagnostic_when_im result.Should().HaveDiagnostics(new[] { - ("BCP081", DiagnosticLevel.Warning, """Resource type "Microsoft.Foo/bars@2022-09-01" does not have types available."""), + ("BCP081", DiagnosticLevel.Warning, """Resource type "Microsoft.Foo/bars@2022-09-01" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."""), }); } diff --git a/src/Bicep.Core.IntegrationTests/ExamplesTests.cs b/src/Bicep.Core.IntegrationTests/ExamplesTests.cs index e8ac3e1aba5..284575017c5 100644 --- a/src/Bicep.Core.IntegrationTests/ExamplesTests.cs +++ b/src/Bicep.Core.IntegrationTests/ExamplesTests.cs @@ -131,7 +131,7 @@ private static bool IsPermittedMissingTypeDiagnostic(IDiagnostic diagnostic) var permittedMissingTypeDiagnostics = new HashSet(StringComparer.OrdinalIgnoreCase) { // To exclude a particular type for BCP081 (if there are missing types), add an entry of format: - // "Resource type \"\" does not have types available.", + // "Resource type \"\" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed.", }; return permittedMissingTypeDiagnostics.Contains(diagnostic.Message); diff --git a/src/Bicep.Core.IntegrationTests/ExtensibilityTests.cs b/src/Bicep.Core.IntegrationTests/ExtensibilityTests.cs index 72f8b1d7b0c..9873cd75bac 100644 --- a/src/Bicep.Core.IntegrationTests/ExtensibilityTests.cs +++ b/src/Bicep.Core.IntegrationTests/ExtensibilityTests.cs @@ -364,7 +364,7 @@ public void Kubernetes_CustomResourceType_EmitWarning() result.Should().GenerateATemplate(); result.Should().HaveDiagnostics(new[] { - ("BCP081", DiagnosticLevel.Warning, @"Resource type ""custom/Foo@v1"" does not have types available."), + ("BCP081", DiagnosticLevel.Warning, @"Resource type ""custom/Foo@v1"" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."), }); } @@ -397,8 +397,8 @@ public void Kubernetes_AmbiguousFallbackType_MustFullyQualify() result.Should().HaveDiagnostics(new[] { ("BCP264", DiagnosticLevel.Error, @"Resource type ""Microsoft.Compute/availabilitySets@2023-01-01"" is declared in multiple imported namespaces (""az"", ""kubernetes""), and must be fully-qualified."), ("BCP035", DiagnosticLevel.Error, @"The specified ""resource"" declaration is missing the following required properties: ""name""."), - ("BCP081", DiagnosticLevel.Warning, @"Resource type ""Microsoft.Compute/availabilitySets@2023-01-01"" does not have types available."), - ("BCP081", DiagnosticLevel.Warning, @"Resource type ""Microsoft.Foo/bar@2023-01-01"" does not have types available."), + ("BCP081", DiagnosticLevel.Warning, @"Resource type ""Microsoft.Compute/availabilitySets@2023-01-01"" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."), + ("BCP081", DiagnosticLevel.Warning, @"Resource type ""Microsoft.Foo/bar@2023-01-01"" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."), }); } @@ -466,7 +466,7 @@ public void Child_resource_with_parent_namespace_mismatch_returns_error() "); result.ExcludingLinterDiagnostics().Should().HaveDiagnostics(new[] { - ("BCP081", DiagnosticLevel.Warning, "Resource type \"Microsoft.Storage/storageAccounts@2020-01-01\" does not have types available."), + ("BCP081", DiagnosticLevel.Warning, "Resource type \"Microsoft.Storage/storageAccounts@2020-01-01\" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."), ("BCP210", DiagnosticLevel.Error, "Resource type belonging to namespace \"stg\" cannot have a parent resource type belonging to different namespace \"az\"."), }); } diff --git a/src/Bicep.Core.IntegrationTests/ModuleTests.cs b/src/Bicep.Core.IntegrationTests/ModuleTests.cs index 0b44a48659c..0cefc21923e 100644 --- a/src/Bicep.Core.IntegrationTests/ModuleTests.cs +++ b/src/Bicep.Core.IntegrationTests/ModuleTests.cs @@ -657,14 +657,14 @@ public void Module_with_unknown_resourcetype_as_parameter_and_output_has_diagnos { diagnosticsMap[InMemoryFileResolver.GetFileUri("/path/to/module.bicep")].Should().HaveDiagnostics(new[] { - ("BCP081", DiagnosticLevel.Warning, "Resource type \"Some.Fake/Type@2019-06-01\" does not have types available."), - ("BCP081", DiagnosticLevel.Warning, "Resource type \"Another.Fake/Type@2019-06-01\" does not have types available."), - ("BCP081", DiagnosticLevel.Warning, "Resource type \"Another.Fake/Type@2019-06-01\" does not have types available."), + ("BCP081", DiagnosticLevel.Warning, "Resource type \"Some.Fake/Type@2019-06-01\" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."), + ("BCP081", DiagnosticLevel.Warning, "Resource type \"Another.Fake/Type@2019-06-01\" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."), + ("BCP081", DiagnosticLevel.Warning, "Resource type \"Another.Fake/Type@2019-06-01\" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."), }); diagnosticsMap[InMemoryFileResolver.GetFileUri("/path/to/main.bicep")].Should().HaveDiagnostics(new[] { - ("BCP230", DiagnosticLevel.Warning, "The referenced module uses resource type \"Some.Fake/Type@2019-06-01\" which does not have types available."), - ("BCP230", DiagnosticLevel.Warning, "The referenced module uses resource type \"Another.Fake/Type@2019-06-01\" which does not have types available."), + ("BCP230", DiagnosticLevel.Warning, "The referenced module uses resource type \"Some.Fake/Type@2019-06-01\" which does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."), + ("BCP230", DiagnosticLevel.Warning, "The referenced module uses resource type \"Another.Fake/Type@2019-06-01\" which does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."), ("BCP036", DiagnosticLevel.Error, "The property \"p\" expected a value of type \"Some.Fake/Type\" but the provided value is of type \"'something'\"."), }); } diff --git a/src/Bicep.Core.IntegrationTests/OutputsTests.cs b/src/Bicep.Core.IntegrationTests/OutputsTests.cs index 7ed623ad35a..bc09c79efe8 100644 --- a/src/Bicep.Core.IntegrationTests/OutputsTests.cs +++ b/src/Bicep.Core.IntegrationTests/OutputsTests.cs @@ -206,8 +206,8 @@ public void Output_can_have_warnings_for_missing_type() result.ExcludingLinterDiagnostics().Should().HaveDiagnostics(new[] { // There are two warnings because there are two places in code to correct the missing type. - ("BCP081", DiagnosticLevel.Warning, "Resource type \"Some.Fake/Type@2019-06-01\" does not have types available."), - ("BCP081", DiagnosticLevel.Warning, "Resource type \"Some.Fake/Type@2019-06-01\" does not have types available."), + ("BCP081", DiagnosticLevel.Warning, "Resource type \"Some.Fake/Type@2019-06-01\" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."), + ("BCP081", DiagnosticLevel.Warning, "Resource type \"Some.Fake/Type@2019-06-01\" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."), }); } @@ -226,7 +226,7 @@ public void Output_can_have_warnings_for_missing_type_but_we_dont_duplicate_them result.ExcludingLinterDiagnostics().Should().HaveDiagnostics(new[] { - ("BCP081", DiagnosticLevel.Warning, "Resource type \"Some.Fake/Type@2019-06-01\" does not have types available."), + ("BCP081", DiagnosticLevel.Warning, "Resource type \"Some.Fake/Type@2019-06-01\" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."), }); } diff --git a/src/Bicep.Core.IntegrationTests/ParametersTests.cs b/src/Bicep.Core.IntegrationTests/ParametersTests.cs index 051481a5f8a..b0eeb6819e4 100644 --- a/src/Bicep.Core.IntegrationTests/ParametersTests.cs +++ b/src/Bicep.Core.IntegrationTests/ParametersTests.cs @@ -169,7 +169,7 @@ public void Parameter_can_have_warnings_for_missing_type() "); result.ExcludingLinterDiagnostics().Should().HaveDiagnostics(new[] { - ("BCP081", DiagnosticLevel.Warning, "Resource type \"Some.Fake/Type@2019-06-01\" does not have types available."), + ("BCP081", DiagnosticLevel.Warning, "Resource type \"Some.Fake/Type@2019-06-01\" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."), }); } @@ -204,7 +204,7 @@ public void Parameter_with_resource_type_cannot_be_used_as_extension_scope() result.ExcludingLinterDiagnostics().Should().HaveDiagnostics(new[] { - ("BCP081", DiagnosticLevel.Warning, "Resource type \"My.Rp/myResource@2020-01-01\" does not have types available."), + ("BCP081", DiagnosticLevel.Warning, "Resource type \"My.Rp/myResource@2020-01-01\" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."), ("BCP229", DiagnosticLevel.Error, "The parameter \"p\" cannot be used as a resource scope or parent. Resources passed as parameters cannot be used as a scope or parent of a resource."), }); } @@ -227,7 +227,7 @@ public void Parameter_with_resource_type_cannot_be_used_as_parent() result.ExcludingLinterDiagnostics().Should().HaveDiagnostics(new[] { - ("BCP081", DiagnosticLevel.Warning, "Resource type \"Microsoft.Storage/storageAccounts/tableServices@2020-06-01\" does not have types available."), + ("BCP081", DiagnosticLevel.Warning, "Resource type \"Microsoft.Storage/storageAccounts/tableServices@2020-06-01\" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."), ("BCP229", DiagnosticLevel.Error, "The parameter \"p\" cannot be used as a resource scope or parent. Resources passed as parameters cannot be used as a scope or parent of a resource."), ("BCP169", DiagnosticLevel.Error, "Expected resource name to contain 1 \"/\" character(s). The number of name segments must match the number of segments in the resource type."), }); diff --git a/src/Bicep.Core.IntegrationTests/RegistryProviderTests.cs b/src/Bicep.Core.IntegrationTests/RegistryProviderTests.cs index 831375476c2..d7fec9cd7f8 100644 --- a/src/Bicep.Core.IntegrationTests/RegistryProviderTests.cs +++ b/src/Bicep.Core.IntegrationTests/RegistryProviderTests.cs @@ -497,7 +497,7 @@ public async Task Warning_generated_and_fallback_type_type_accepted() result.Template.Should().HaveValueAtPath("$.resources['dadJoke']['properties']['bodyProp']", "fallback body"); result.Should().HaveDiagnostics(new[]{ - ("BCP081", DiagnosticLevel.Warning, "Resource type \"test@v1\" does not have types available.") + ("BCP081", DiagnosticLevel.Warning, "Resource type \"test@v1\" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed.") }); } diff --git a/src/Bicep.Core.IntegrationTests/ScenarioTests.cs b/src/Bicep.Core.IntegrationTests/ScenarioTests.cs index 04e8bc8d43e..60674d76873 100644 --- a/src/Bicep.Core.IntegrationTests/ScenarioTests.cs +++ b/src/Bicep.Core.IntegrationTests/ScenarioTests.cs @@ -1060,9 +1060,9 @@ public void Test_Issue1941() result.Template.Should().NotBeNull(); result.ExcludingLinterDiagnostics().Should().HaveDiagnostics(new[] { - ("BCP081", DiagnosticLevel.Warning, "Resource type \"Rp.A/providers@2020-06-01\" does not have types available."), - ("BCP081", DiagnosticLevel.Warning, "Resource type \"Rp.A/providers/a/b@2020-06-01\" does not have types available."), - ("BCP081", DiagnosticLevel.Warning, "Resource type \"Rp.A/a/b/providers@2020-06-01\" does not have types available."), + ("BCP081", DiagnosticLevel.Warning, "Resource type \"Rp.A/providers@2020-06-01\" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."), + ("BCP081", DiagnosticLevel.Warning, "Resource type \"Rp.A/providers/a/b@2020-06-01\" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."), + ("BCP081", DiagnosticLevel.Warning, "Resource type \"Rp.A/a/b/providers@2020-06-01\" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."), }); result = CompilationHelper.Compile(@" @@ -3305,7 +3305,7 @@ public void Test_Issue_3356_Warn_On_Bad_Type_Definitions() "); result.ExcludingLinterDiagnostics().Should().HaveDiagnostics(new[] { - ("BCP081", DiagnosticLevel.Warning, "Resource type \"Microsoft.Storage/storageAccounts@2021-09-00\" does not have types available."), + ("BCP081", DiagnosticLevel.Warning, "Resource type \"Microsoft.Storage/storageAccounts@2021-09-00\" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."), ("BCP036", DiagnosticLevel.Warning, "The property \"name\" expected a value of type \"string\" but the provided value is of type \"123\". If this is an inaccuracy in the documentation, please report it to the Bicep Team."), ("BCP036", DiagnosticLevel.Warning, "The property \"capacity\" expected a value of type \"int\" but the provided value is of type \"'1'\". If this is an inaccuracy in the documentation, please report it to the Bicep Team."), ("BCP036", DiagnosticLevel.Warning, "The property \"type\" expected a value of type \"string\" but the provided value is of type \"1\". If this is an inaccuracy in the documentation, please report it to the Bicep Team."), diff --git a/src/Bicep.Core.IntegrationTests/Scenarios/InliningResourcesAndModulesTests.cs b/src/Bicep.Core.IntegrationTests/Scenarios/InliningResourcesAndModulesTests.cs index 71135c342dd..37872a60171 100644 --- a/src/Bicep.Core.IntegrationTests/Scenarios/InliningResourcesAndModulesTests.cs +++ b/src/Bicep.Core.IntegrationTests/Scenarios/InliningResourcesAndModulesTests.cs @@ -491,8 +491,8 @@ public void ObjectVariablesWithUnknownTypeResourceReference_ShouldBeInlined() ")); result.ExcludingLinterDiagnostics().Should().GenerateATemplate().And.HaveDiagnostics(new[] { - ("BCP081", DiagnosticLevel.Warning, "Resource type \"My.Rp/myResourceType@2020-01-01\" does not have types available."), - ("BCP081", DiagnosticLevel.Warning, "Resource type \"My.Rp/myResourceType@2020-01-01\" does not have types available.") + ("BCP081", DiagnosticLevel.Warning, "Resource type \"My.Rp/myResourceType@2020-01-01\" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."), + ("BCP081", DiagnosticLevel.Warning, "Resource type \"My.Rp/myResourceType@2020-01-01\" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed.") }); using (new AssertionScope()) { diff --git a/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/SecureParamsInNestedDeploymentsRuleTests.cs b/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/SecureParamsInNestedDeploymentsRuleTests.cs index 14279fe9f6d..031e4eaaa3d 100644 --- a/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/SecureParamsInNestedDeploymentsRuleTests.cs +++ b/src/Bicep.Core.UnitTests/Diagnostics/LinterRuleTests/SecureParamsInNestedDeploymentsRuleTests.cs @@ -450,7 +450,7 @@ public void NotDeployment_Pass() }", new string[] { - "[6] Resource type \"Microsoft.Resources/notDeployments@2021-04-01\" does not have types available." + "[6] Resource type \"Microsoft.Resources/notDeployments@2021-04-01\" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed." }); } diff --git a/src/Bicep.Core.UnitTests/TypeSystem/Az/AzResourceTypeProviderTests.cs b/src/Bicep.Core.UnitTests/TypeSystem/Az/AzResourceTypeProviderTests.cs index 883c123b9f5..da8afb23636 100644 --- a/src/Bicep.Core.UnitTests/TypeSystem/Az/AzResourceTypeProviderTests.cs +++ b/src/Bicep.Core.UnitTests/TypeSystem/Az/AzResourceTypeProviderTests.cs @@ -160,7 +160,7 @@ public void AzResourceTypeProvider_should_warn_for_missing_resource_types() } "); compilation.Should().HaveDiagnostics(new[] { - ("BCP081", DiagnosticLevel.Warning, "Resource type \"Mock.Rp/madeUpResourceType@2020-01-01\" does not have types available.") + ("BCP081", DiagnosticLevel.Warning, "Resource type \"Mock.Rp/madeUpResourceType@2020-01-01\" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed.") }); } diff --git a/src/Bicep.Core/Diagnostics/DiagnosticBuilder.cs b/src/Bicep.Core/Diagnostics/DiagnosticBuilder.cs index 020159cd064..648790590a4 100644 --- a/src/Bicep.Core/Diagnostics/DiagnosticBuilder.cs +++ b/src/Bicep.Core/Diagnostics/DiagnosticBuilder.cs @@ -549,7 +549,7 @@ public ErrorDiagnostic ArgumentCountMismatch(int argumentCount, int minimumArgum TextSpan, DiagnosticLevel.Warning, "BCP081", - $"Resource type \"{resourceTypeReference.FormatName()}\" does not have types available."); + $"Resource type \"{resourceTypeReference.FormatName()}\" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."); public FixableErrorDiagnostic SymbolicNameDoesNotExistWithSuggestion(string name, string suggestedName) => new( TextSpan, @@ -1367,7 +1367,7 @@ public ErrorDiagnostic ExpectedProviderSpecification() TextSpan, DiagnosticLevel.Warning, "BCP230", - $"The referenced module uses resource type \"{resourceTypeReference.FormatName()}\" which does not have types available."); + $"The referenced module uses resource type \"{resourceTypeReference.FormatName()}\" which does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed."); public ErrorDiagnostic ParamOrOutputResourceTypeUnsupported() => new( TextSpan,