Skip to content
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

Improved error message on existing resource properties #1881

Merged

Conversation

miqm
Copy link
Collaborator

@miqm miqm commented Mar 15, 2021

Fixes #1507

Contributing a Pull Request

If you haven't already, read the full contribution guide. The guide may have changed since the last time you read it, so please double-check. Once you are done and ready to submit your PR, run through the relevant checklist below.

Contributing a feature

  • I have opened a new issue for the proposal, or commented on an existing one, and ensured that the Bicep maintainers are good with the design of the feature being implemented
  • I have included "Fixes #{issue_number}" in the PR description, so GitHub can link to the issue and close it when the PR is merged
  • I have appropriate test coverage of my new feature

@miqm miqm force-pushed the feature/existing-resources-error-message-1507 branch from f991267 to 5eedf2b Compare March 15, 2021 21:32
@codecov-io
Copy link

codecov-io commented Mar 15, 2021

Codecov Report

Merging #1881 (5eedf2b) into main (ea8526c) will decrease coverage by 0.00%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1881      +/-   ##
==========================================
- Coverage   95.11%   95.11%   -0.01%     
==========================================
  Files         371      371              
  Lines       21962    21969       +7     
  Branches       15       15              
==========================================
+ Hits        20890    20896       +6     
- Misses       1072     1073       +1     
Flag Coverage Δ
dotnet 95.55% <88.88%> (-0.01%) ⬇️
typescript 26.61% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/Bicep.Core/TypeSystem/TypeValidator.cs 98.26% <75.00%> (-0.42%) ⬇️
src/Bicep.Core/Diagnostics/DiagnosticBuilder.cs 100.00% <100.00%> (ø)

@@ -1501,3 +1501,9 @@ resource vnet 'Microsoft.Network/virtualNetworks@2020-06-01' = {
}
}

resource existngResProperty 'Mock.Rp/mockExistingResource@2020-01-01' = {
//@[28:69) [BCP081 (Warning)] Resource type "Mock.Rp/mockExistingResource@2020-01-01" does not have types available. |'Mock.Rp/mockExistingResource@2020-01-01'|
Copy link
Member

@majastrz majastrz Mar 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BCP081 [](start = 12, length = 6)

This isn't the diagnostic that was added (BCP167) Can probably change it to a real resource type to get that one.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Member

@majastrz majastrz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment.

Copy link
Member

@majastrz majastrz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great!

@majastrz majastrz merged commit 6197043 into Azure:main Mar 17, 2021
@miqm miqm deleted the feature/existing-resources-error-message-1507 branch March 17, 2021 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Errors when attempting to set properties for existing resources are not very descriptive
3 participants