Skip to content

update Role based calls to new api version to support dataActions#2356

Merged
mcardosos merged 10 commits intoAzure:masterfrom
darshanhs90:current
Feb 2, 2018
Merged

update Role based calls to new api version to support dataActions#2356
mcardosos merged 10 commits intoAzure:masterfrom
darshanhs90:current

Conversation

@darshanhs90
Copy link
Contributor

@darshanhs90 darshanhs90 commented Jan 29, 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

@darshanhs90 darshanhs90 changed the title update Role based calls to new api version to support dataActions update Role based calls to new api version to support dataActions[DONOT merge] Jan 29, 2018
@AutorestCI
Copy link

Did a commit to Azure/azure-sdk-for-python:
Azure/azure-sdk-for-python@04e8425

@AutorestCI
Copy link

Did a commit to Azure/azure-sdk-for-go:
Azure/azure-sdk-for-go@da0d03b

@darshanhs90
Copy link
Contributor Author

@mcardosos what can be done to remove the semantic issue for this PR,as the path mentioned in the error isn't used anywhere before
Reason for /roleassignmentId and /roledefinitionid to be different is as per the example for each
/roleassignmentid example:
id=/subscriptions//providers/Microsoft.Authorization/roleAssignments/fa1a4d3b-2cca-406b-8956-6b6b32377641

/roledefinitionid example: id=/subscriptions//providers/Microsoft.Authorization/roleDefinitions/f0885aa8-0107-4e65-9a00-541286195838

@darshanhs90 darshanhs90 changed the title update Role based calls to new api version to support dataActions[DONOT merge] update Role based calls to new api version to support dataActions Jan 30, 2018
"required": true,
"type": "string",
"description": "The API version to use for this operation."
},
Copy link
Contributor

@mcardosos mcardosos Jan 31, 2018

Choose a reason for hiding this comment

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

Why not use the API version parameter already defined in the parameters section? #Resolved

"description": "The namespace of the resource provider."
},
{
"name": "api-version",
Copy link
Contributor

Choose a reason for hiding this comment

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

api-version [](start = 21, length = 11)

Same here. If the parameter is already defined somewhere else why not use it?

Copy link
Contributor

Choose a reason for hiding this comment

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

Solved

"tags": [
"ProviderOperationsMetadata"
],
"operationId": "ProviderOperationsMetadata_Get",
Copy link
Contributor

Choose a reason for hiding this comment

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

ProviderOperationsMetadata_Get [](start = 24, length = 30)

Odata extension can be useful here

"tags": [
"ProviderOperationsMetadata"
],
"operationId": "ProviderOperationsMetadata_List",
Copy link
Contributor

Choose a reason for hiding this comment

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

ProviderOperationsMetadata_List [](start = 24, length = 31)

Odata extension is useful here too

"description": "Gets all permissions the caller has for a resource group.",
"parameters": [
{
"name": "resourceGroupName",
Copy link
Contributor

Choose a reason for hiding this comment

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

resourceGroupName [](start = 21, length = 17)

If resource group name parameter is used in many operation, it also can be defined in the parameter section

Copy link
Contributor

Choose a reason for hiding this comment

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

Solved

@mcardosos
Copy link
Contributor

mcardosos commented Jan 31, 2018

Hello @darshanhs90 !
The main issue is that swagger does not allow to define the same path more than once (for swagger /{roleassignmentid} and /{roledefinitionid} are equivalents.
x-ms-paths can be used to avoid that.

@mcardosos
Copy link
Contributor

On the other hand, we are moving away from current branch.

"x-ms-pageable": {
"nextLinkName": "nextLink"
},
"x-ms-odata": "#/definitions/RoleAssignmentFilter",
Copy link
Contributor

Choose a reason for hiding this comment

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

RoleAssignmentFilter [](start = 37, length = 20)

Not just RoleAssignment ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no it takes in the filter parameters as query parameter in the url,hence not the roleassignment


In reply to: 164927815 [](ancestors = 164927815)

@darshanhs90
Copy link
Contributor Author

@mcardosos when i added the x-ms-path,i got an error regarding that also
{
"type": "Error",
"code": "XmsPathsMustOverloadPaths",
"message": "Paths in x-ms-paths must overload a normal path in the paths section, i.e. a path in the x-ms-paths must either be same as a path in the paths section or a path in the paths sections followed by additional parameters.",

Not sure what it expects in x-ms-path

@AutorestCI
Copy link

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

@AutorestCI
Copy link

Did a commit to Azure/azure-sdk-for-python:
Azure/azure-sdk-for-python@eb3fbd5

@mcardosos
Copy link
Contributor

@darshanhs90 It expects that paths in the x-ms-path section also have a query (a dumb query ), just for disambiguation/

@AutorestCI
Copy link

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

@AutorestCI
Copy link

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

@darshanhs90
Copy link
Contributor Author

@mcardosos does autorest expect me to have both /roleassignment and /roledefinition in paths and add another /roledefintion?dummy in x-ms paths?

@mcardosos
Copy link
Contributor

No, just /roleassignment in paths, and /roledefinition with dummy in x-ms-paths

@darshanhs90
Copy link
Contributor Author

@mcardosos included as mentioned by you,but still the linter is showing an error in this PR

@AutorestCI
Copy link

Did a commit to Azure/azure-sdk-for-python:
Azure/azure-sdk-for-python@abba98d

@AutorestCI
Copy link

Did a commit to Azure/azure-sdk-for-go:
Azure/azure-sdk-for-go@daaa1ec

@AutorestCI
Copy link

Did a commit to Azure/azure-sdk-for-python:
Azure/azure-sdk-for-python@1647759

@AutorestCI
Copy link

Did a commit to Azure/azure-sdk-for-go:
Azure/azure-sdk-for-go@5972911

@AutorestCI
Copy link

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

Command: ['/usr/local/bin/autorest', '/tmp/tmp0j9huvcm/rest/specification/authorization/resource-manager/readme.md', '--perform-load=false', '--swagger-to-sdk', '--output-artifact=configuration.json', '--input-file=foo', '--output-folder=/tmp/tmpb3is22rb']
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)
ERROR: Syntax Error Encountered: Syntax error: can not read a block mapping entry; a multiline key may not be an implicit key
    - file:///tmp/tmp0j9huvcm/rest/specification/authorization/resource-manager/readme.md:181:4
[OperationAbortedException] Error occurred. Exiting.

@AutorestCI
Copy link

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

Command: ['/usr/local/bin/autorest', '/tmp/tmphnqjrlbt/rest/specification/authorization/resource-manager/readme.md', '--perform-load=false', '--swagger-to-sdk', '--output-artifact=configuration.json', '--input-file=foo', '--output-folder=/tmp/tmp20281fs2']
Finished with return code 1
and output:

AutoRest code generation utility [version: 2.0.4245; node: v7.10.1]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
   Loading AutoRest core      '/tmp/.autorest/@microsoft.azure_autorest-core@2.0.4245/node_modules/@microsoft.azure/autorest-core/dist' (2.0.4245)
ERROR: Syntax Error Encountered: Syntax error: can not read a block mapping entry; a multiline key may not be an implicit key
    - file:///tmp/tmphnqjrlbt/rest/specification/authorization/resource-manager/readme.md:181:4
[OperationAbortedException] Error occurred. Exiting.

@AutorestCI
Copy link

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

@azuresdkciprbot
Copy link

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:

💡 Please review potentially introduced Error(s)/Warning(s): Analysis Report 💡

File: specification/authorization/resource-manager/readme.md
Before the PR: Warning(s): 0 Error(s): 0
After the PR: Warning(s): 0 Error(s): 1

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@AutorestCI
Copy link

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

},
"x-ms-paths":{
"/{roleDefinitionId}?disambiguation_dummy": {
"get": {
Copy link
Contributor

Choose a reason for hiding this comment

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

To get rid of the linter error, both disambiguated paths should look exactly the same (and the one here with the disambiguation query). Example: /{hello} and /{hello}?waves. Not /{hello} and /{world}?waves

@mcardosos
Copy link
Contributor

Since there are new operations, also adding @ravbhatnagar for review

@mcardosos mcardosos added the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Feb 2, 2018
@mcardosos
Copy link
Contributor

On the other hand, we are moving away from current branch, please poke @marstr if you need help migrating the PR

@AutorestCI
Copy link

Did a commit to Azure/azure-sdk-for-python:
Azure/azure-sdk-for-python@0fafe0b

@darshanhs90 darshanhs90 changed the base branch from current to master February 2, 2018 00:35
@AutorestCI
Copy link

Did a commit to Azure/azure-sdk-for-go:
Azure/azure-sdk-for-go@3299b1c

@azuresdkciprbot
Copy link

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

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@mcardosos
Copy link
Contributor

Sorry @ravbhatnagar , I thought there were new operations, but that is not the case :)

@mcardosos mcardosos removed the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Feb 2, 2018
@mcardosos mcardosos merged commit 88d2938 into Azure:master Feb 2, 2018
@AutorestCI
Copy link

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

@AutorestCI
Copy link

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

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