Skip to content

Adding new API version 2018-01-10 fixing swagger violations.#2419

Merged
fearthecowboy merged 6 commits intoAzure:masterfrom
AsrOneSdk:masterASR20180110
Feb 20, 2018
Merged

Adding new API version 2018-01-10 fixing swagger violations.#2419
fearthecowboy merged 6 commits intoAzure:masterfrom
AsrOneSdk:masterASR20180110

Conversation

@avneeshrai
Copy link
Copy Markdown

@avneeshrai avneeshrai commented Feb 5, 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

@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

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

@avneeshrai
Copy link
Copy Markdown
Author

This PR introduces new API version with following changes as compared to last version:

  1. Fixes for swagger violations: a) Camel casing. b) Unwanted top level properties in Job model.
  2. Introducing few new APIs like (TargetComputeSizes_ListByReplicationProtectedItem)
  3. Having operations and models in sorted order in the spec.

@avneeshrai
Copy link
Copy Markdown
Author

Note:

  1. Testing for the changes is in progress, PRs would be updated with the fixes if required.
  2. We will soon update the swagger PR with right API examples (instances which are currently being flagged by model validator).

Copy link
Copy Markdown
Contributor

@jianghaolu jianghaolu left a comment

Choose a reason for hiding this comment

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

Please add the new api version in your readme.

@jianghaolu jianghaolu added the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Feb 5, 2018
@avneeshrai
Copy link
Copy Markdown
Author

Updated the readme

@AutorestCI
Copy link
Copy Markdown

AutorestCI commented Feb 6, 2018

Automation for azure-sdk-for-python

Nothing to generate for azure-sdk-for-python

@AutorestCI
Copy link
Copy Markdown

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

Command: profileBuilder -s preview -name preview
Finished with return code 127
and output:

/bin/sh: 1: profileBuilder: not found

@jianghaolu
Copy link
Copy Markdown
Contributor

@avneeshrai Can you please add the new api version to the README? Without that our validation tool will not be able to run correctly. After that I'll be able to review based on the validation results. Thanks!

@avneeshrai
Copy link
Copy Markdown
Author

@jianghaolu I have already updated the readme in commit 2cad803 . Did i miss something there?

@AutorestCI
Copy link
Copy Markdown

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

Command: profileBuilder -s preview -name preview
Finished with return code 127
and output:

/bin/sh: 1: profileBuilder: not found

@avneeshrai
Copy link
Copy Markdown
Author

And please help with the error: Swagger to SDK encountered a Subprocess error: (Azure/azure-sdk-for-go)

/bin/sh: 1: profileBuilder: not found

what needs to be done here?

@fearthecowboy
Copy link
Copy Markdown
Contributor

@mozehgir -- Why was this reassigned?

@mozehgir
Copy link
Copy Markdown
Contributor

mozehgir commented Feb 7, 2018

Hey Garrett(@fearthecowboy ), I believe Jianghao is OOF for a week and if this PR can be reviewed before the next fundamentals meeting (Feb 13th) - it would be great.
Ideally if we could have it merged this week, we can represent the team accordingly in the meeting.

@fearthecowboy
Copy link
Copy Markdown
Contributor

Hey @avneeshrai , @mozehgir

The new service.json file for the new API version has everything in a completely different order. This significantly increases the effort to review, since the diffs are useless to correlate against.

Is it possible that you can leave the file in the same order the original file was in?

@avneeshrai
Copy link
Copy Markdown
Author

@fearthecowboy I have reverted alphabetical sorting of path and definitions for most of the cases so that review efforts are saved.
We will update the PR again just by sorting definitions and paths
Let me know if there are any other action item on us w.r.t PR.

@AutorestCI
Copy link
Copy Markdown

AutorestCI commented Feb 9, 2018

Automation for azure-sdk-for-go

Encountered a Subprocess error: (azure-sdk-for-go)

Command: dep ensure
Finished with return code 127
and output:

/bin/sh: 1: dep: not found

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

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

"application/json"
],
"paths": {
"/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationProtectionContainers/{protectionContainerName}/replicationProtectedItems/{replicatedProtectedItemName}/targetComputeSizes": {
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.

FYI - new API

}
}
},
"/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationVaultHealth/default/refresh": {
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.

FYI - New API

"in": "path",
"description": "Unique fabric name.",
"required": true,
"
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.

New member -- can we provide an enum of the possible values for this?

"in": "path",
"description": "Unique fabric name.",
"required": true,
"
Copy link
Copy Markdown
Contributor

@fearthecowboy fearthecowboy Feb 9, 2018

Choose a reason for hiding this comment

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

instanceType and multiVmGroupCreateOption seem like they could have enum to indicate the possible values.

If you use x-ms-enum and modelAsString:true you can add more values later without a breaking change.

"in": "path",
"description": "Unique fabric name.",
"required": true,
"
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.

You're adding enum values (which is a breaking change, but ok in a new API version). You might think about making this modelAsString:true so that it can be expanded without making a breaking change later.

"in": "path",
"description": "Unique fabric name.",
"required": true,
"
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.

I'd recommend that enums are generally modelAsString true to avoid breaking changes in the future.

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.

Much Better! at least I was able to go thru it and see whats new much easier.

You have a few enums, which you might want to consider using x-ms-enum/modelAsString:true so that values can be changed in the future.

You also have a few things that end in 'type' or 'option' which makes me wonder if there are enums that describe valid values for those.

@fearthecowboy
Copy link
Copy Markdown
Contributor

Tagging @ravbhatnagar for ARM review/feedback.

@avneeshrai
Copy link
Copy Markdown
Author

avneeshrai commented Feb 12, 2018

@fearthecowboy are we talking about just one instance for multiVmGroupCreateOption to be represented as enum here? or you are referring to some other fields as well? Sorry couldn't get it from the comments.

@fearthecowboy
Copy link
Copy Markdown
Contributor

Hey @avneeshrai

I was looking at multiVmGroupCreateOption when I then noticed the same thing throughout the file. Any time you have a string field that ends in ..option or ..type it piques my curiosity to see if there is an enum that contains the acceptable values.

If you don't have an enum and there are specific values that mean something, then we're really doing consumers a disservice by not listing them.

using x-ms-enum and specifying modelAsString: true will make it so you can add more values later without making it a breaking change (since, we store the value even if it's not known, and older clients won't die when they see an unknown value.)

Given that you have a new API version here, I strongly suggest you take the opportunity to fill in details on types like multiVmGroupCreateOption to make sure we've got the best possible documentation for your service, and enable us to generate the best possible SDK we can. 😄

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

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@avneeshrai
Copy link
Copy Markdown
Author

@fearthecowboy we have made multiVmGroupCreateOption as enum as suggested however kept modelAsString: false, to keep it consistent with other enum fields in our APIs.
Just a question here: multiVmGroupCreateOption is also used for odata query filtering in one of the case, hope that works?

@avneeshrai
Copy link
Copy Markdown
Author

@fearthecowboy and yeah let us know if there is any other action item on us :)

@fearthecowboy
Copy link
Copy Markdown
Contributor

I guess I'm ok with this; we're just waiting for ARM signoff from @ravbhatnagar

@ravbhatnagar
Copy link
Copy Markdown
Contributor

Signing off! most of these, if not all, are existing APis which have already been reviewed. It looks like they are getting added to swagger now. @avneeshrai - please correct if I am wrong here.

@ravbhatnagar ravbhatnagar added ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review and removed WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Feb 15, 2018
@avneeshrai
Copy link
Copy Markdown
Author

avneeshrai commented Feb 17, 2018

Right @ravbhatnagar, as per my understanding approval have been taken by ASR team for most of these APIs.

@fearthecowboy I will now update the PR after sorting API paths and definitions as discussed in the thread. Please merge (if you dont see any issue there).

@avneeshrai
Copy link
Copy Markdown
Author

@fearthecowboy could you please review and merge this :)

@fearthecowboy fearthecowboy merged commit a98fa16 into Azure:master Feb 20, 2018
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.

9 participants