-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Adding examples and fixing the DSC related lint issues #2415
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
Adding examples and fixing the DSC related lint issues #2415
Conversation
|
Did a commit to Azure/azure-sdk-for-go: |
|
This commit was treated and no generation was made for Azure/azure-sdk-for-go |
|
Did a commit to Azure/azure-sdk-for-go: |
|
Hey @vrdmr , I was about to start reviewing the PR, but it still has an awful lot of validation errors. See: https://travis-ci.org/Azure/azure-rest-api-specs/jobs/337677030 Can you review those, and see what you can do to get it to pass? |
|
Hi @fearthecowboy, Thanks. I'll take a look. I am trying to run the model-validator but I am hitting the following: and when using the Could you please help me with this. Thanks, |
|
Hey @vrdmr , I'm seeing the problem using In the mean time, you can use the model-validator outside of autorest on individual swagger files: Example # ensure the module globally
> npm install -g oav
# example: run it against a swagger file directly.
> oav validate-example Microsoft.Automation/stable/2015-10-31/dscCompilationJob.jsonI'm looking into why using it as a plugin isn't working right now. |
|
FYI @vrdmr This was the correct syntax (even tho it fails)
autorest --model-validator readme.md Using |
|
Hey @vrdmr, I've asked the OAV author to fix the autorest extension, I think we've got a few glitches he has to take care of. in the mean time, fall back to using oav manually on each of the files. |
Automation for azure-sdk-for-pythonA PR has been created for you: |
Swagger to SDK encountered a Subprocess error: (Azure/azure-sdk-for-go)
Command: ['/usr/local/bin/autorest', '/tmp/tmpauiawjcr/rest/specification/automation/resource-manager/readme.md', '--go', '--go-sdk-folder=/tmp/tmpauiawjcr/sdk', '--multiapi', '--package-version=v12.2.1-beta', '[email protected]/autorest.go@preview', "--user-agent='Azure-SDK-For-Go/v12.2.1-beta services'", '--verbose'] AutoRest code generation utility [version: 2.0.4244; node: v7.10.1]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
There is a new version of AutoRest available (2.0.4245).
> You can install the newer version with with npm install -g autorest@latest
Loading AutoRest core '/tmp/.autorest/@[email protected]/node_modules/@microsoft.azure/autorest-core/dist' (2.0.4244)
Loading AutoRest extension '@microsoft.azure/autorest.go' (preview->2.1.70)
Loading AutoRest extension '@microsoft.azure/autorest.modeler' (2.3.38->2.3.38)
Processing batch task - {"tag":"package-2015-10"} .
ERROR: Schema violation: Data does not match any schemas from 'oneOf'
- file:///tmp/tmpauiawjcr/rest/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/dscConfiguration.json:256:10 ($.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}/content"].get.responses["200"])
FATAL: swagger-document/individual/schema-validator - FAILED
FATAL: Error: [OperationAbortedException] Error occurred. Exiting.
Process() cancelled due to exception : [OperationAbortedException] Error occurred. Exiting.
Failure during batch task - {"tag":"package-2015-10"} -- false. |
|
Did a commit to Azure/azure-sdk-for-go: |
|
Hi Garrett, I have fixed most of the DSC related issues and am working with other teams to fix their resources specs. Could you please take a look at this PR now and merge it in when you get a chance? Thanks, |
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.
Ouch!
You're changing enum values here.
Did the service change, or was this an error in the spec before? If this is a service change, we're potentially breaking an API.
As it is, this means that current clients are incorrect. Is this so?
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 Spec was incorrect here and I just changed it to reflect what we are sending from the service. And we are in the process of releasing new Automation SDKs based on Swagger and are still in preview mode.
Our last stable release of SDK was based on Hyak.
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.
Why has this allOf been removed?
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 resource is a ProxyResource and does not have all the requirements of the Resource (like Location, Tags etc.). Thus I removed the allOf - Resource and just added the tag.
To make it better, I can go and take this route as mentioned here - #2368 (comment). By creating a separate Proxy Resource.
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.
And this one?
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.
Explained above.
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.
Is this adding a new API or documenting an existing one that wasn't listed before?
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.
Documenting existing API which wasn't listed earlier.
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.
Why was this deleted? This may result in a breaking change in the generated clients.
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.
It returns only 200 and not 201. As mentioned earlier, we don't have any swagger-based stable clients and are in the process of releasing them.
I'll confirm the response code with Fiddler.
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.
Validation Failure: https://travis-ci.org/Azure/azure-rest-api-specs/jobs/338705368#L755
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.
Hey, I checked with the team and I resolved the issue. They had added new flags and it wasn't documented in the spec, which caused the validation failures in DSCCompilationJob. Fixed it.
|
Hey @vrdmr -- we're getting closer. Just a few things i need you to look at. It's a bit tricky, since there are other validation failures and examples failing -- is it possible that whoever owns the examples that are failing could look at those and update this PR? |
Automation for azure-sdk-for-goA PR has been created for you: |
|
@fearthecowboy Hi Garrett, Could you please have a look at this PR. If you have any questions, we can have a quick sync. Thanks. |
|
@vrdmr - I'll get back to it first thing in the morning. |
|
@vrdmr -- You're still showing validator problems: |
|
Hi There, I am the AutoRest Linter Azure bot. I am here to help. My task is to analyze the situation from the AutoRest linter perspective. Please review the below analysis result: File: AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback Thanks for your co-operation. |
|
Hi @fearthecowboy, For the issues you specified in the build, related to linting issues, we have active work going on to get them down to 0. There are actively three PRs (#2360, #2466 and this one) from our team and I would be sending one more PR for DSC issues. For the first set of issues related to x-ms-example, I will push in the changes. |
|
Hi There, I am the AutoRest Linter Azure bot. I am here to help. My task is to analyze the situation from the AutoRest linter perspective. Please review the below analysis result: File: AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback Thanks for your co-operation. |
This checklist is used to make sure that common issues in a pull request are addressed. This will expedite the process of getting your pull request merged and avoid extra work on your part to fix issues discovered during the review process.
PR information
api-versionin the path should match theapi-versionin the spec).Quality of Swagger