Skip to content

AzureApiManagement new entity "Tag" documented#2257

Merged
fearthecowboy merged 11 commits intoAzure:masterfrom
vfedonkin:master
Feb 7, 2018
Merged

AzureApiManagement new entity "Tag" documented#2257
fearthecowboy merged 11 commits intoAzure:masterfrom
vfedonkin:master

Conversation

@vfedonkin
Copy link
Copy Markdown
Contributor

@vfedonkin vfedonkin commented Jan 11, 2018

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

  • [ * ] The title of the PR is clear and informative.
  • [ * ] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • [ * ] Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
  • [ * ] If applicable, the PR references the bug/issue that it fixes.
  • [ * ] Swagger files are correctly named (e.g. the api-version in the path should match the api-version in the spec).

Quality of Swagger

@vfedonkin
Copy link
Copy Markdown
Contributor Author

@solankisamir (Samir Solanski) , could you please also review this PR?

@solankisamir
Copy link
Copy Markdown
Member

solankisamir commented Jan 11, 2018

Update the readme.md file with the new resource files for tags. #Resolved

"$ref": "./apimanagement.json#/definitions/Resource"
}
],
"description": "Contract details."
Copy link
Copy Markdown
Member

@solankisamir solankisamir Jan 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Contract [](start = 22, length = 8)

Tag Contract Details. #Resolved

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

"externalDocsDescription": {
"type": "string",
"description": "Description of the external resources describing the tag."
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can put these parameters in a base contract and do allOf in CreateParameterProperties and ContractProperties. would reduce redundancy

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Also got rid of some unnecessary duplicates in TagContract

},
"OperationEntityContract": {
"properties": {
"displayName": {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any max/min length to any of the properties in the contract.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is read-only contract, we never use in any put/patch requests. Should we specify min/max length anyway?

Copy link
Copy Markdown
Member

@solankisamir solankisamir Jan 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then we can specify "readonly": "true" #Resolved

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

"properties": {
"properties": {
"x-ms-client-flatten": true,
"$ref": "#/definitions/TagContractProperties",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is displayName a required property in the UpdateContract. if yes... then we dont need 2 contracts. you can just have one contract for both Create and Update.

},
"externalDocsDescription": {
"type": "string",
"description": "Description of the external resources describing the tag."
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a max min to these properties also?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we need for externalDocsUrl only. Added.

Copy link
Copy Markdown
Member

@solankisamir solankisamir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left some minor comments. rest looks good. Thanks @vfedonkin

"$ref": "#/parameters/ProductIdParameter"
},
{
"$ref": "#./apimtags.json#/parameters/TagIdParameter"
Copy link
Copy Markdown
Member

@solankisamir solankisamir Jan 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#./ [](start = 21, length = 3)

maybe this is what the CI job is complaining about. #Resolved

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

"$ref": "#/parameters/ProductIdParameter"
},
{
"$ref": "#./apimtags.json#/parameters/TagIdParameter"
Copy link
Copy Markdown
Member

@solankisamir solankisamir Jan 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#./ [](start = 21, length = 3)

check this #Resolved

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

"200": {
"description": "Gets the details of the tag specified by its identifier.",
"schema": {
"$ref": "#./apimtags.json#/definitions/TagContract"
Copy link
Copy Markdown
Member

@solankisamir solankisamir Jan 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#./ [](start = 23, length = 3)

check this. #Resolved

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

"$ref": "#/parameters/OperationIdParameter"
},
{
"$ref": "#./apimtags.json#/parameters/TagIdParameter"
Copy link
Copy Markdown
Member

@solankisamir solankisamir Jan 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#./ [](start = 21, length = 3)

check this and other references below. #Resolved

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

"$ref": "#/parameters/ApiIdParameter"
},
{
"$ref": "#./apimtags.json#/parameters/TagIdParameter"
Copy link
Copy Markdown
Member

@solankisamir solankisamir Jan 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#./ [](start = 21, length = 3)

you can fix this and run the tool https://github.com/Azure/oav locally before submitting again. #Resolved

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@fearthecowboy
Copy link
Copy Markdown
Contributor

Hey @solankisamir / vfedonkin

Can y'all ping me when you're ready for me to review this?

"tags": [
"ProductTags"
],
"operationId": "Tags_ListByProduct",
Copy link
Copy Markdown
Contributor

@fearthecowboy fearthecowboy Jan 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This operation is Tags_ListByProduct the next is Tag_HeadByProduct

The prefix should be consistent between operations (Tag or Tags, but not both)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have used a singular case in all other operations. @vfedonkin let's use Tag.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, using "Tag" everywhere.

"tags": [
"ProductTags"
],
"operationId": "Tag_DeleteFromProduct",
Copy link
Copy Markdown
Contributor

@fearthecowboy fearthecowboy Jan 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend this was just Tag_Delete -- the operation Id is used to generate method names, and unless there is an overriding or compelling reason, we'd like to stick to common patterns.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to Tag_DetachFromProduct. Same for Tag_DetachFromApi and Tag_DetachFromOperation

"tags": [
"ProductTags"
],
"operationId": "Tag_CreateOrUpdateForProduct",
Copy link
Copy Markdown
Contributor

@fearthecowboy fearthecowboy Jan 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend this was just Tag_CreateOrUpdate -- the operation Id is used to generate method names, and unless there is an overriding or compelling reason, we'd like to stick to common patterns.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to Tag_AssignToProduct. Same for Tag_AssignToApi and Tag_AssignToOperation

"tags": [
"ProductTags"
],
"operationId": "Tag_GetByProduct",
Copy link
Copy Markdown
Contributor

@fearthecowboy fearthecowboy Jan 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend this was just Tag_Get -- the operation Id is used to generate method names, and unless there is an overriding or compelling reason, we'd like to stick to common patterns.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fearthecowboy
We already have Tag_Get in apimtags.json with url like
".../service/{serviceName}/tags/{tagId}"
Can we use the same operationId for
".../service/{serviceName}/products/{productId}/tags/{tagId}" ?

"tags": [
"ProductTags"
],
"operationId": "Tag_HeadByProduct",
Copy link
Copy Markdown
Contributor

@fearthecowboy fearthecowboy Jan 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't see a lot of HEAD operations.

The operationId should describe what the operation does, not the HTTP Method used-- I'd suggest Tag_GetEntityState

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. The same for apis/operations/tags entities.

@fearthecowboy
Copy link
Copy Markdown
Contributor

@vfedonkin

We already have Tag_Get in apimtags.json with url like
".../service/{serviceName}/tags/{tagId}"
Can we use the same operationId for
".../service/{serviceName}/products/{productId}/tags/{tagId}" ?

Ah, I'm just seeing that.

HMMMM.

No, we definitely can't have duplicate operationIds.

In that case, this could remain the way it is.

@fearthecowboy
Copy link
Copy Markdown
Contributor

Adding @ravbhatnagar -- new APIs require ARM signoff.

Copy link
Copy Markdown
Contributor

@fearthecowboy fearthecowboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of things; nothing serious.

We should put a suppression in the readme.md for the two linter violations; add a section that looks like this:

# Suppressions

``` yaml
directive: 
  - suppress: R3016
     reason: existing properties, can't be changed without breaking API.
```

"ProductTags"
],
"operationId": "Tag_DeleteFromProduct",
"description": "Detach the tag from the Product.",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description "Detach the tag from the Product.", sounds like the tag still exists once deleted. Can we say Deletes or removes ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tag is really exists as an entity, it's just detached from the product.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. interesting.

"tags": [
"TagResources"
],
"operationId": "TagResources_ListByService",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this operationId prefix is plural- while that is the preferred way, the rest of the service is singular. These should be consistent.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

"tags": [
"OperationTags"
],
"operationId": "Tag_HeadByOperation",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps Tag_GetEntityStateByOperation ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@fearthecowboy fearthecowboy added the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Jan 22, 2018
Copy link
Copy Markdown
Contributor

@fearthecowboy fearthecowboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with the state of this. Awaiting ARM signoff from @ravbhatnagar

@AutorestCI
Copy link
Copy Markdown

Swagger to SDK encountered a Subprocess error: (Azure/azure-sdk-for-go)

Command: ['/usr/local/bin/autorest', '/tmp/tmpowe3k_jh/rest/specification/apimanagement/resource-manager/readme.md', '--go', '--go-sdk-folder=/tmp/tmpowe3k_jh/sdk', '--multiapi', '--package-version=v12.2.1-beta', '--use=@microsoft.azure/autorest.go@preview', "--user-agent='Azure-SDK-For-Go/v12.2.1-beta services'", '--verbose']
Finished with return code 1
and output:

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/@microsoft.azure_autorest-core@2.0.4244/node_modules/@microsoft.azure/autorest-core/dist' (2.0.4244)
   Loading AutoRest extension '@microsoft.azure/autorest.go' (preview->2.1.68)
   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\PUBLISHs0k5t\82_20180129T185436\autorest.go\src\Model\PageTypeGo.cs:line 41
   at AutoRest.Go.Model.CodeModelGo.CreatePageableTypeForMethod(MethodGo method) in C:\Users\ci\AppData\Local\Temp\PUBLISHs0k5t\82_20180129T185436\autorest.go\src\Model\CodeModelGo.cs:line 298
   at AutoRest.Go.TransformerGo.TransformMethods(CodeModelGo cmg) in C:\Users\ci\AppData\Local\Temp\PUBLISHs0k5t\82_20180129T185436\autorest.go\src\TransformerGo.cs:line 278
   at AutoRest.Go.TransformerGo.TransformCodeModel(CodeModel cm) in C:\Users\ci\AppData\Local\Temp\PUBLISHs0k5t\82_20180129T185436\autorest.go\src\TransformerGo.cs:line 32
   at AutoRest.Go.Program.<ProcessInternal>d__3.MoveNext() in C:\Users\ci\AppData\Local\Temp\PUBLISHs0k5t\82_20180129T185436\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.

@AutorestCI
Copy link
Copy Markdown

This commit was treated and no generation was made for Azure/azure-sdk-for-python

@vfedonkin
Copy link
Copy Markdown
Contributor Author

@fearthecowboy, conflicts solved, ok to merge.

@fearthecowboy
Copy link
Copy Markdown
Contributor

You have some validation issues : https://travis-ci.org/Azure/azure-rest-api-specs/jobs/335311496

@vfedonkin
Copy link
Copy Markdown
Contributor Author

@fearthecowboy, validation issues are not related to my changes but I will investigate what's wrong.

@vfedonkin
Copy link
Copy Markdown
Contributor Author

Moved all tags-related paths to apimtags.json file since apimapis.json is already too huge.

@AutorestCI
Copy link
Copy Markdown

This commit was treated and no generation was made for Azure/azure-sdk-for-python

@AutorestCI
Copy link
Copy Markdown

Swagger to SDK encountered a Subprocess error: (Azure/azure-sdk-for-go)

Command: ['/usr/local/bin/autorest', '/tmp/tmpxg4bg8iq/rest/specification/apimanagement/resource-manager/readme.md', '--go', '--go-sdk-folder=/tmp/tmpxg4bg8iq/sdk', '--multiapi', '--package-version=v12.2.1-beta', '--use=@microsoft.azure/autorest.go@preview', "--user-agent='Azure-SDK-For-Go/v12.2.1-beta services'", '--verbose']
Finished with return code 1
and output:

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/@microsoft.azure_autorest-core@2.0.4244/node_modules/@microsoft.azure/autorest-core/dist' (2.0.4244)
   Installing AutoRest extension '@microsoft.azure/autorest.go' (preview)
VERBOSE: [FYI- npm does not currently support progress... this may take a few moments]
VERBOSE: Running  npm install for @microsoft.azure/autorest.go, 2.1.69
VERBOSE: npm install completed @microsoft.azure/autorest.go, 2.1.69
   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\PUBLISHs0k5t\87_20180131T193539\autorest.go\src\Model\PageTypeGo.cs:line 41
   at AutoRest.Go.Model.CodeModelGo.CreatePageableTypeForMethod(MethodGo method) in C:\Users\ci\AppData\Local\Temp\PUBLISHs0k5t\87_20180131T193539\autorest.go\src\Model\CodeModelGo.cs:line 298
   at AutoRest.Go.TransformerGo.TransformMethods(CodeModelGo cmg) in C:\Users\ci\AppData\Local\Temp\PUBLISHs0k5t\87_20180131T193539\autorest.go\src\TransformerGo.cs:line 278
   at AutoRest.Go.TransformerGo.TransformCodeModel(CodeModel cm) in C:\Users\ci\AppData\Local\Temp\PUBLISHs0k5t\87_20180131T193539\autorest.go\src\TransformerGo.cs:line 32
   at AutoRest.Go.Program.<ProcessInternal>d__3.MoveNext() in C:\Users\ci\AppData\Local\Temp\PUBLISHs0k5t\87_20180131T193539\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.

@vfedonkin
Copy link
Copy Markdown
Contributor Author

@fearthecowboy, could you please check now? I left apimapis.json file as it was before, without any changes.

@azuresdkciprbot
Copy link
Copy Markdown

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: specification/apimanagement/resource-manager/readme.md
Before the PR: Warning(s): 0 Error(s): 2
After the PR: Warning(s): 0 Error(s): 0

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@AutorestCI
Copy link
Copy Markdown

Swagger to SDK encountered a Subprocess error: (Azure/azure-sdk-for-go)

Command: ['/usr/local/bin/autorest', '/tmp/tmpf7evxdb2/rest/specification/apimanagement/resource-manager/readme.md', '--go', '--go-sdk-folder=/tmp/tmpf7evxdb2/sdk', '--multiapi', '--package-version=v12.2.1-beta', '--use=@microsoft.azure/autorest.go@preview', "--user-agent='Azure-SDK-For-Go/v12.2.1-beta services'", '--verbose']
Finished with return code 1
and output:

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/@microsoft.azure_autorest-core@2.0.4244/node_modules/@microsoft.azure/autorest-core/dist' (2.0.4244)
   Loading AutoRest extension '@microsoft.azure/autorest.go' (preview->2.1.69)
   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\PUBLISHs0k5t\87_20180131T193539\autorest.go\src\Model\PageTypeGo.cs:line 41
   at AutoRest.Go.Model.CodeModelGo.CreatePageableTypeForMethod(MethodGo method) in C:\Users\ci\AppData\Local\Temp\PUBLISHs0k5t\87_20180131T193539\autorest.go\src\Model\CodeModelGo.cs:line 298
   at AutoRest.Go.TransformerGo.TransformMethods(CodeModelGo cmg) in C:\Users\ci\AppData\Local\Temp\PUBLISHs0k5t\87_20180131T193539\autorest.go\src\TransformerGo.cs:line 278
   at AutoRest.Go.TransformerGo.TransformCodeModel(CodeModel cm) in C:\Users\ci\AppData\Local\Temp\PUBLISHs0k5t\87_20180131T193539\autorest.go\src\TransformerGo.cs:line 32
   at AutoRest.Go.Program.<ProcessInternal>d__3.MoveNext() in C:\Users\ci\AppData\Local\Temp\PUBLISHs0k5t\87_20180131T193539\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.

@solankisamir
Copy link
Copy Markdown
Member

@fearthecowboy a gentle ping on this one.

@fearthecowboy
Copy link
Copy Markdown
Contributor

@solankisamir - there's a validation error (I don't think caused by this PR, happened somewhere along the way with all those being pushed thru this week).

https://travis-ci.org/Azure/azure-rest-api-specs/jobs/335805386#L741

It looks like it's pretty minor, can you take a quick look and see if we can fix up what went wrong so we have a clean validation with this one?

@vfedonkin
Copy link
Copy Markdown
Contributor Author

@fearthecowboy , we couldn't fix this issue, as we understand it's an issue with validation tool itself.
It doesn't support boolean parameters in examples.

Below is a parameter definition:
{
"name": "deleteSubscriptions",
"in": "query",
"required": false,
"type": "boolean",
"description": "Delete existing subscriptions to the product or not."
},

And this is a sample file:
{
"parameters": {
"serviceName": "apimService1",
"resourceGroupName": "rg1",
"api-version": "2017-03-01",
"subscriptionId": "subid",
"productId": "testproduct",
"deleteSubscriptions": "true",
"If-Match": "*"
},
"responses": {
"204": {}
}
}

What is the best way to fix it?
Thanks,
Vitaliy.

@fearthecowboy
Copy link
Copy Markdown
Contributor

true should not be in quotes. "true" is not a boolean value

@vfedonkin
Copy link
Copy Markdown
Contributor Author

We tried, it didn't help.
We have exactly the same error when we run this test tool locally:
oav validate-example <...>\specification\apimanagement\resource-manager\Microsoft.ApiManagement\stable\2017-03-01\apimproducts.json

@fearthecowboy
Copy link
Copy Markdown
Contributor

@vfedonkin - I'll try doing this locally and grab @amarzavery if it's not workable.

@solankisamir
Copy link
Copy Markdown
Member

@fearthecowboy any update on this.

@AutorestCI
Copy link
Copy Markdown

AutorestCI commented Feb 7, 2018

Automation for azure-sdk-for-python

Was unable to create SDK azure-sdk-for-python PR for this closed PR.

@AutorestCI
Copy link
Copy Markdown

Swagger to SDK encountered a Subprocess error: (Azure/azure-sdk-for-go)

Command: ['/usr/local/bin/autorest', '/tmp/tmphflqx9kw/rest/specification/apimanagement/resource-manager/readme.md', '--go', '--go-sdk-folder=/tmp/tmphflqx9kw/sdk', '--multiapi', '--package-version=nightly', '--use=@microsoft.azure/autorest.go@preview', "--user-agent='Azure-SDK-For-Go/nightly services'", '--verbose']
Finished with return code 1
and output:

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/@microsoft.azure_autorest-core@2.0.4244/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-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\PUBLISH8fzkm\78_20180205T234947\autorest.go\src\Model\PageTypeGo.cs:line 41
   at AutoRest.Go.Model.CodeModelGo.CreatePageableTypeForMethod(MethodGo method) in C:\Users\ci\AppData\Local\Temp\PUBLISH8fzkm\78_20180205T234947\autorest.go\src\Model\CodeModelGo.cs:line 298
   at AutoRest.Go.TransformerGo.TransformMethods(CodeModelGo cmg) in C:\Users\ci\AppData\Local\Temp\PUBLISH8fzkm\78_20180205T234947\autorest.go\src\TransformerGo.cs:line 278
   at AutoRest.Go.TransformerGo.TransformCodeModel(CodeModel cm) in C:\Users\ci\AppData\Local\Temp\PUBLISH8fzkm\78_20180205T234947\autorest.go\src\TransformerGo.cs:line 32
   at AutoRest.Go.Program.<ProcessInternal>d__3.MoveNext() in C:\Users\ci\AppData\Local\Temp\PUBLISH8fzkm\78_20180205T234947\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.

@azuresdkciprbot
Copy link
Copy Markdown

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: specification/apimanagement/resource-manager/readme.md
Before the PR: Warning(s): 0 Error(s): 2
After the PR: Warning(s): 0 Error(s): 0

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@fearthecowboy
Copy link
Copy Markdown
Contributor

@vfedonkin - It was exactly as I said; the quotes around "true" was causing it to fail. I fixed it in your branch for you.

@fearthecowboy fearthecowboy merged commit f633051 into Azure:master Feb 7, 2018
@AutorestCI
Copy link
Copy Markdown

Swagger to SDK encountered a Subprocess error: (Azure/azure-sdk-for-go)

Command: ['/usr/local/bin/autorest', '/tmp/tmp9t3lyyca/rest/specification/apimanagement/resource-manager/readme.md', '--go', '--go-sdk-folder=/tmp/tmp9t3lyyca/sdk', '--multiapi', '--package-version=nightly', '--use=@microsoft.azure/autorest.go@preview', "--user-agent='Azure-SDK-For-Go/nightly services'", '--verbose']
Finished with return code 1
and output:

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/@microsoft.azure_autorest-core@2.0.4244/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-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\PUBLISH8fzkm\78_20180205T234947\autorest.go\src\Model\PageTypeGo.cs:line 41
   at AutoRest.Go.Model.CodeModelGo.CreatePageableTypeForMethod(MethodGo method) in C:\Users\ci\AppData\Local\Temp\PUBLISH8fzkm\78_20180205T234947\autorest.go\src\Model\CodeModelGo.cs:line 298
   at AutoRest.Go.TransformerGo.TransformMethods(CodeModelGo cmg) in C:\Users\ci\AppData\Local\Temp\PUBLISH8fzkm\78_20180205T234947\autorest.go\src\TransformerGo.cs:line 278
   at AutoRest.Go.TransformerGo.TransformCodeModel(CodeModel cm) in C:\Users\ci\AppData\Local\Temp\PUBLISH8fzkm\78_20180205T234947\autorest.go\src\TransformerGo.cs:line 32
   at AutoRest.Go.Program.<ProcessInternal>d__3.MoveNext() in C:\Users\ci\AppData\Local\Temp\PUBLISH8fzkm\78_20180205T234947\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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants