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

AutoRest azure-validator erroneously fails on core version ~2.0.4413 but not ^3.2.0 #15654

Closed
forteddyt opened this issue Aug 16, 2021 · 5 comments
Assignees

Comments

@forteddyt
Copy link
Contributor

PR in question: #15439
LintDiff Logs in question: https://github.com/Azure/azure-rest-api-specs/pull/15439/checks?check_run_id=3333578400
Fails with: "Text": "Error: '$.definitions.Identity.properties.type.enum' has incompatible values (---\n- SystemAssigned\n- 'SystemAssigned,UserAssigned'\n- UserAssigned\n- None\n, ---\n- SystemAssigned\n)."

The issue lies in machineLearningServices' ResourceIdentityType enum sharing the same name as common-types' ResourceIdentityType enum. However, common-types' Identity definition is not referenced (neither directly not indirectly) anywhere in any of the specs defined in the readme.md. Interestingly, removing the reference to Identity from ResourceModelWithAllowedPropertySet resolves this issue. ResourceModelWithAllowedPropertySet is not referenced in any of the specs.

Running the validation command with --v3 (which uses AutoRest core version ^3.2.0, as opposed to AutoRest core version ~2.0.4413) does not produce this failure.

autorest --validation --azure-validator --v3 --semantic-validator=false --model-validator=false --message-format=json --openapi-type=arm [email protected]/[email protected] [email protected]/[email protected] --tag=package-2021-10-01 readme.md

Because of these reasons, I think this might be an issue with autorest core version ~2.0.4413. ~2.0.4413 is used in the LintDiff pipeline. The client generation gates also does not seem to use a 3.x version, as they are failing with the same issue.

@ghost ghost added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Aug 16, 2021
@leniatgh leniatgh assigned jianyexi and unassigned leniatgh Aug 16, 2021
@leniatgh leniatgh removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Aug 16, 2021
@jianyexi
Copy link
Contributor

@forteddyt this is a autorest v2 issue, as it failed within the autorest , not in the azure-validator, could you please file a issue to autorest ?

@forteddyt
Copy link
Contributor Author

@jianyexi sure - am I supposed to file the issue here: https://github.com/Azure/autorest?

Also, why does the azure-validator (and the validation gates in general, I guess) use AutoRest core version 2.x, instead of 3.x?

@jianyexi
Copy link
Contributor

@jianyexi Jianye Xi FTE sure - am I supposed to file the issue here: https://github.com/Azure/autorest?

Also, why does the azure-validator (and the validation gates in general, I guess) use AutoRest core version 2.x, instead of 3.x?

Yes, because the autorest v3 has many breaking changes against v2, we can't upgrade it to v3

@forteddyt
Copy link
Contributor Author

I see, that's unfortunate. I've opened up an issue, I'll close this one

Azure/autorest#4262

@forteddyt
Copy link
Contributor Author

forteddyt commented Aug 16, 2021

Also to temporarily side-step this issue, I'm going to remove the reference to Identity from ResourceModelWithAllowedPropertySet in the PR.

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

No branches or pull requests

3 participants