Add API Management Version Sets#2483
Conversation
Automation for azure-sdk-for-pythonNothing to generate for azure-sdk-for-python |
Automation for azure-sdk-for-goEncountered a Subprocess error: (azure-sdk-for-go)
Command: ['/usr/local/bin/autorest', '/tmp/tmp3qny2epj/rest/specification/apimanagement/resource-manager/readme.md', '--go', '--go-sdk-folder=/tmp/tmp3qny2epj/sdk', '--multiapi', '--package-version=latest', '--use=@microsoft.azure/autorest.go@~2.1.87', "--user-agent='Azure-SDK-For-Go/latest services'", '--verbose'] AutoRest code generation utility [version: 2.0.4251; node: v7.10.1]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
Loading AutoRest core '/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4251/node_modules/@microsoft.azure/autorest-core/dist' (2.0.4251)
FATAL: AutoRest exited unexpectedly after launching autorest-core module @microsoft.azure/autorest-core from /tmp/.autorest/@microsoft.azure_autorest-core@2.0.4251
Loading AutoRest extension '@microsoft.azure/autorest.go' (~2.1.87->2.1.87)
Loading AutoRest extension '@microsoft.azure/autorest.modeler' (2.3.38->2.3.38)
Processing batch task - {"tag":"package-2017-03"} .
FATAL: System.InvalidOperationException: method RegionsClient.ListByService contains a null nextLinkName so it shouldn't be treated as a pageable operation
at AutoRest.Go.Model.PageTypeGo..ctor(MethodGo method) in C:\Users\ci\AppData\Local\Temp\PUBLISHwf52p\100_20180220T231516\autorest.go\src\Model\PageTypeGo.cs:line 41
at AutoRest.Go.Model.CodeModelGo.CreatePageableTypeForMethod(MethodGo method) in C:\Users\ci\AppData\Local\Temp\PUBLISHwf52p\100_20180220T231516\autorest.go\src\Model\CodeModelGo.cs:line 342
at AutoRest.Go.TransformerGo.TransformMethods(CodeModelGo cmg) in C:\Users\ci\AppData\Local\Temp\PUBLISHwf52p\100_20180220T231516\autorest.go\src\TransformerGo.cs:line 288
at AutoRest.Go.TransformerGo.TransformCodeModel(CodeModel cm) in C:\Users\ci\AppData\Local\Temp\PUBLISHwf52p\100_20180220T231516\autorest.go\src\TransformerGo.cs:line 25
at AutoRest.Go.Program.<ProcessInternal>d__3.MoveNext() in C:\Users\ci\AppData\Local\Temp\PUBLISHwf52p\100_20180220T231516\autorest.go\src\Program.cs:line 100
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NewPlugin.<Process>d__15.MoveNext()
FATAL: go/generate - FAILED
FATAL: Error: Plugin go reported failure.
Process() cancelled due to exception : Plugin go reported failure.
Failure during batch task - {"tag":"package-2017-03"} -- Error: Plugin go reported failure..
Error: Plugin go reported failure. |
anuchandy
left a comment
There was a problem hiding this comment.
Please take a look at the model and linter errors
https://travis-ci.org/Azure/azure-rest-api-specs/jobs/340790418
https://travis-ci.org/Azure/azure-rest-api-specs/jobs/340790417
Also it seems swagger is missing definition for userCollection model
|
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 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. |
|
Hey! @anuchandy I believe I have resolved all the issues with this PR. Thanks! |
| "apiVersionSet" : { | ||
| "description": "Version set details", | ||
| "$ref" : "#/definitions/ApiVersionSetContract" | ||
| "$ref" : "./apimversionsets.json#/definitions/ApiVersionSetContractProperties" |
There was a problem hiding this comment.
Note that changing the type of the property apiVersionSet in this model is breaking change.
If we take the diff of ApiVersionSetContract (old type) and ApiVersionSetContractProperties (new type), it looks like the read-only properties id, name and type won't be available for consumer any more.
Changing the type is a SDK breaking change. This requires major SDK version upgrade.
Removing properties in the response of a stable api call (without bumping api version) is service side breaking change, which requires ARM approval.
There was a problem hiding this comment.
@anuchandy This isn't breaking a change to the current API, this is fixing an incorrect description. Customer's who attempt to update those fields in the GA release will not be able to.
In the preview release of this API, the customers could create ApiVersionSet directly when creating the API, but it was decided that the ARM guidelines prevented this from being allowed. Therefore we had to remove this functionality for our customers in our GA release. The change to make the fields read-only was missed when doing the update. Our customers are now waiting for the documentation to be updated so they can use the new ARM compliant way of creating these things in a two step process.
If you could unblock this PR so that we can get that documentation to the customer, it would be most appreciated.
/cc @ravbhatnagar
There was a problem hiding this comment.
@darrelmiller -
One question, is it the case that service never used to return id, name and type hence swagger was wrong and we are fixing that issue in this PR?
Let me also explain the reason I am thinking this as SDK breaking change. All below SDK issues can be addressed by bumping up SDK version.
The ApiRevisionInfoContract in the current SDK
class ApiRevisionInfoContract {
....
public ApiVersionSetContract apiVersionSet {get; set;}
}The ApiRevisionInfoContract in the new SDK (based on this PR)
class ApiRevisionInfoContract {
....
public ApiVersionSetContractProperties apiVersionSet {get; set;}
}application code using current sdk
ApiRevisionInfoContract revisionContract = ...;
ApiVersionSetContract c = revisionContract.apiVersionSet;application code using new sdk (based on this PR) [broken]
ApiRevisionInfoContract revisionContract = ...;
ApiVersionSetContract c = revisionContract.apiVersionSet; // Compiler error due to different return typeIn this prespective this is a SDK breaking change. When an existing application based on current SDK switch to new SDK (generated from this PR), if their application is using ApiRevisionInfoContract.apiVersionSet property then they need to change the type.
This issue can be addressed by bumping up the major version of the SDK.
As i mentioned earlier, the read-only properties id, name and type won't be available when customer access ApiRevisionInfoContract.apiVersionSet, right?
application code using current sdk
ApiRevisionInfoContract revisionContract = ...;
System.out.println(revisionContract.id); // no compiler errorapplication code using new sdk (based on this PR) [broken]
ApiRevisionInfoContract revisionContract = ...;
System.out.println(revisionContract.id); // compiler error, id property does not exists.again if we bump up SDK version then this is fine.
There was a problem hiding this comment.
Also we need ARM review because there is a new swagger apimversionsets.json, this is the first PR adding this swagger. So as per the established process, it is required to have this sign-ed off by ARM in this repo. I'm sending an email thread requesting ARM to take a look.
There was a problem hiding this comment.
@anuchandy - I think what @darrelmiller is saying is that at GA, customer could not update/assign the value of id, name, type since they were read only. Swagger didnt reflect it. And so now, swagger is updating the description correctly to reflect the service state. If true, this is not a breaking change, since it would have never worked for the customer even if he tried to update.
There was a problem hiding this comment.
thanks @ravbhatnagar got it. Still when customer compiles existing application (that was based current SDK) with the new sdk (generated from this PR), they will see compiler error. That should be fine given it's a side effect of correcting the swagger to reflect actual service state.
There was a problem hiding this comment.
@anuchandy The current SDK is from March 2017 and is a preview https://www.nuget.org/packages/Microsoft.Azure.Management.ApiManagement/3.4.0-preview
There was a problem hiding this comment.
@darrelmiller thanks for letting me know. Based on the process we established, i'll add potential SDK breaking changes tag for future reference.
Once we conclude the below discussion with ARM team, will merge this PR.
|
@ravbhatnagar please take a look at new swagger and breaking change in existing stable api version |
ravbhatnagar
left a comment
There was a problem hiding this comment.
Looks good, just one comment
| } | ||
| }, | ||
| "paths": { | ||
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets": { |
There was a problem hiding this comment.
@darrelmiller - is this resource type already supported on the service side?
There was a problem hiding this comment.
The resource type names should be lower camel cased and only contain alphanumeric characters. Which is why I was checking.
There was a problem hiding this comment.
@ravbhatnagar Are you saying that path segment api-version-sets should actually be apiVersionSets ? It is currently implemented as the former, but we could change it and make sure will still support the old value as well so we don't break any existing users.
There was a problem hiding this comment.
@ravbhatnagar We can do this rename in our 2018-01-01 version which is what we are building the new .net client against.
There was a problem hiding this comment.
@darrelmiller - sounds good. we can target this change in the new api-version.
|
Signing off! |
Adding vhdFormatType and isHA properties
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