-
Notifications
You must be signed in to change notification settings - Fork 814
Improve BCP081 diagnostic message and update corresponding unit tests #18860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| $"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."); | ||
| $"Resource type \"{resourceTypeReference.FormatName()}\" does not have type definitions available. " + | ||
| "Bicep cannot validate properties or provide IntelliSense for this resource; deployment will still be attempted by Azure Resource Manager. " + | ||
| "See https://learn.microsoft.com/azure/azure-resource-manager/bicep/diagnostics/bcp081 for details."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line isn't necessary - the CoreWarning method already fills out the Uri field, which contains a link to the docs, and should be surfaced by IDEs or CLI:
| { Uri = new($"https://aka.ms/bicep/core-diagnostics#{code}") }; |
| "BCP081", | ||
| $"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."); | ||
| $"Resource type \"{resourceTypeReference.FormatName()}\" does not have type definitions available. " + | ||
| "Bicep cannot validate properties or provide IntelliSense for this resource; deployment will still be attempted by Azure Resource Manager. " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should avoid referring to "Intellisense" or "Azure Resource Manager" because Bicep is used in non-Microsoft IDEs, and supports deploying of non-Azure resources through local deploy.
| "Bicep cannot validate properties or provide IntelliSense for this resource; deployment will still be attempted by Azure Resource Manager. " + | |
| "Property type validations and code completions are not available for this resource type, but the resource update operation will still be attempted if this file is deployed. " + |
| public Diagnostic ResourceTypesUnavailable(ResourceTypeReference resourceTypeReference) => CoreWarning( | ||
| "BCP081", | ||
| $"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."); | ||
| $"Resource type \"{resourceTypeReference.FormatName()}\" does not have type definitions available. " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about something like:
| $"Resource type \"{resourceTypeReference.FormatName()}\" does not have type definitions available. " + | |
| $"Bicep does not have type definitions available for resource type \"{resourceTypeReference.FormatName()}\". " + |
anthony-c-martin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing! See comments
Thanks for the review @anthony-c-martin! I've updated the message based on your feedback. |
Description
This PR improves the BCP081 diagnostic message to make it clearer:
All unit tests that reference BCP081 have been updated to match the new message.
Fixes #13287
Checklist
Microsoft Reviewers: Open in CodeFlow