-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Fix ARMViolations for Microsoft.Resources #3912
Fix ARMViolations for Microsoft.Resources #3912
Conversation
Automation for azure-sdk-for-pythonThe initial PR has been merged into your service PR: |
Automation for azure-sdk-for-rubyNothing to generate for azure-sdk-for-ruby |
Automation for azure-sdk-for-nodeThe initial PR has been merged into your service PR: |
Can one of the admins verify this patch? |
@@ -34,6 +34,31 @@ | |||
} |
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.
In this file, when we use autorest to check ARM violations, we always have ARMViolations for "TagDetails". The error is that we must have name and type properties for it, and "TagDetails" has extra properties ['tagName', 'count', 'values']. I checked resources.json for 2018-02-01, the definition for "TagDetails" is the same, but there is no such errors in autorest. Do you know how I can address it?
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.
Hi @zjpjack
Please add a suppression rule for the TagDetails object in the Readme. You can tag example on the compute file, this should look like this:
directive:
- where:
- $.definitions.TagDetails
suppress:
- NameOfYourErrorInCamelCase
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.
I will let @ravbhatnagar knows this suppression, he or I will send another PR for these suppression rules.
Automation for azure-sdk-for-goThe initial PR has been merged into your service PR: |
Automation for azure-sdk-for-javaThe initial PR has been merged into your service PR: |
@lmazuel Can you please take a look? Thanks |
Hi @zjpjack somehow I missed your PR in my notification, which is unusual :(. Taking a look right now. |
...fication/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json
Outdated
Show resolved
Hide resolved
specification/resources/resource-manager/Microsoft.Resources/stable/2016-09-01/links.json
Outdated
Show resolved
Hide resolved
specification/resources/resource-manager/Microsoft.Resources/stable/2018-05-01/resources.json
Outdated
Show resolved
Hide resolved
"type": "string", | ||
"description": "The name of the deployment." | ||
}, | ||
"type": { |
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.
I just checked the CLI recording that is supposed to return this object:
https://github.com/Azure/azure-cli/blob/dev/src/command_modules/azure-cli-resource/azure/cli/command_modules/resource/tests/latest/recordings/test_subscription_level_deployment.yaml#L66-L68
There is no "type" in the JSON. Could you give me more context why you think it's necessary?
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.
According to Autorest, if there is no "type", then we get the following error
ERROR (RequiredPropertiesMissingInResourceModel/R2020/ARMViolation): Model definition 'DeploymentExtended' must have the properties 'name', 'id' and 'type' in its hierarchy and these properties must be marked as readonly.
Any suggestion for this?
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.
The most important is that the Swagger represent the absolute truth about the server. This is indeed an ARM violation, the linter is right that this call does not respect ARM.
Correct to handle this is to send an email to @ravbhatnagar to describe the issue and ask for a ARM suppression rule. So at least the non-conformance is known and documented. Adding type here just shut off the alarm and doesn't solve anything.
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.
I will let @ravbhatnagar knows this suppression, he or I will send another PR for these suppression rules.
@@ -34,6 +34,31 @@ | |||
} |
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.
Hi @zjpjack
Please add a suppression rule for the TagDetails object in the Readme. You can tag example on the compute file, this should look like this:
directive:
- where:
- $.definitions.TagDetails
suppress:
- NameOfYourErrorInCamelCase
specification/resources/resource-manager/Microsoft.Resources/stable/2016-09-01/links.json
Show resolved
Hide resolved
specification/resources/resource-manager/Microsoft.Resources/stable/2018-05-01/resources.json
Outdated
Show resolved
Hide resolved
specification/resources/resource-manager/Microsoft.Resources/stable/2018-05-01/resources.json
Outdated
Show resolved
Hide resolved
...fication/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json
Show resolved
Hide resolved
specification/resources/resource-manager/Microsoft.Resources/stable/2016-09-01/links.json
Show resolved
Hide resolved
specification/resources/resource-manager/Microsoft.Resources/stable/2018-05-01/resources.json
Show resolved
Hide resolved
…into msft-jizen/resources_violations
@lmazuel Replied your comments. Can you please take a look? |
@zjpjack Added comments. Thanks! |
@lmazuel For those comments about missing discription for display, I already had them in this PR, it is just below the display |
...fication/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json
Show resolved
Hide resolved
Automation for azure-sdk-for-jsNothing to generate for azure-sdk-for-js |
Fix ARMViolations for Microsoft.Resources