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

Fix ARMViolations for Microsoft.Resources #3912

Merged
merged 3 commits into from
Sep 25, 2018
Merged

Fix ARMViolations for Microsoft.Resources #3912

merged 3 commits into from
Sep 25, 2018

Conversation

zjpjack
Copy link
Contributor

@zjpjack zjpjack commented Sep 14, 2018

Fix ARMViolations for Microsoft.Resources

@AutorestCI
Copy link

AutorestCI commented Sep 14, 2018

Automation for azure-sdk-for-python

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-python#3187

@AutorestCI
Copy link

AutorestCI commented Sep 14, 2018

Automation for azure-sdk-for-ruby

Nothing to generate for azure-sdk-for-ruby

@AutorestCI
Copy link

AutorestCI commented Sep 14, 2018

Automation for azure-sdk-for-node

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-node#3692

@azuresdkci
Copy link
Contributor

Can one of the admins verify this patch?

@@ -34,6 +34,31 @@
}
Copy link
Contributor Author

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?

Copy link
Member

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

Copy link
Contributor Author

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.

@AutorestCI
Copy link

AutorestCI commented Sep 14, 2018

Automation for azure-sdk-for-go

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-go#2818

@AutorestCI
Copy link

AutorestCI commented Sep 14, 2018

Automation for azure-sdk-for-java

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-java#2194

@zjpjack
Copy link
Contributor Author

zjpjack commented Sep 19, 2018

@lmazuel Can you please take a look? Thanks

@lmazuel
Copy link
Member

lmazuel commented Sep 19, 2018

Hi @zjpjack somehow I missed your PR in my notification, which is unusual :(. Taking a look right now.

"type": "string",
"description": "The name of the deployment."
},
"type": {
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

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 @@
}
Copy link
Member

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

@zjpjack
Copy link
Contributor Author

zjpjack commented Sep 24, 2018

@lmazuel Replied your comments. Can you please take a look?

@lmazuel
Copy link
Member

lmazuel commented Sep 24, 2018

@zjpjack Added comments. Thanks!

@zjpjack
Copy link
Contributor Author

zjpjack commented Sep 25, 2018

@lmazuel For those comments about missing discription for display, I already had them in this PR, it is just below the display

@AutorestCI
Copy link

AutorestCI commented Sep 25, 2018

Automation for azure-sdk-for-js

Nothing to generate for azure-sdk-for-js

@lmazuel lmazuel merged commit 793d150 into Azure:master Sep 25, 2018
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.

4 participants