Skip to content
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

[HDInsight] Add Capabilities to Stable API version,Modify ApplicationType,AccessModes to enum #6665

Merged

Conversation

aim-for-better
Copy link
Member

@aim-for-better aim-for-better commented Jul 18, 2019

[HDInsight]

  • Add capabilities to stable/2018-06-01-preview/locations.json.
  • Modify applicationType and accessModes to enum in both stable and preview api version.
  • In order to be consistent with response from RP side, Add suppression DefinitionsPropertiesNamesCamelCase

Latest improvements:

MSFT employees can try out our new experience at OpenAPI Hub - one location for using our validation tools and finding your workflow.

Contribution checklist:

  • I have reviewed the documentation for the workflow.
  • Validation tools were run on swagger spec(s) and have all been fixed in this PR.
  • The OpenAPI Hub was used for checking validation status and next steps.

ARM API Review Checklist

  • Service team MUST add the "WaitForARMFeedback" label if the management plane API changes fall into one of the below categories.
  • adding/removing APIs.
  • adding/removing properties.
  • adding/removing API-version.
  • adding a new service in Azure.

Failure to comply may result in delays for manifest application. Note this does not apply to data plane APIs.

  • If you are blocked on ARM review and want to get the PR merged urgently, please get the ARM oncall for reviews (RP Manifest Approvers team under Azure Resource Manager service) from IcM and reach out to them.
    Please follow the link to find more details on API review process.

@openapi-sdkautomation
Copy link

openapi-sdkautomation bot commented Jul 18, 2019

SDK Automation [Logs] (Generated from a22cf02, Iteration 12)

Failed Go: Azure/azure-sdk-for-go [Logs] [Diff]
  • Failed preview/hdinsight/mgmt/2015-03-01-preview [Logs]
  • Failed preview/hdinsight/mgmt/2018-06-01-preview [Logs]
Failed Java: Azure/azure-sdk-for-java [Logs] [Diff]
  • Failed hdinsight/resource-manager/v2015_03_01_preview [Logs]
  • Failed hdinsight/resource-manager/v2018_06_01_preview [Logs]
Failed Python: Azure/azure-sdk-for-python [Logs] [Diff]
  • Failed azure-mgmt-hdinsight [Logs]
Failed JavaScript: Azure/azure-sdk-for-js [Logs] [Diff]
  • Failed @azure/arm-hdinsight [Logs]

@AutorestCI
Copy link

AutorestCI commented Jul 18, 2019

Automation for azure-sdk-for-python

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-python#6082

@AutorestCI
Copy link

AutorestCI commented Jul 18, 2019

Automation for azure-sdk-for-go

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-go#5369

@azuresdkci
Copy link
Contributor

Can one of the admins verify this patch?

@AutorestCI
Copy link

AutorestCI commented Jul 18, 2019

Automation for azure-sdk-for-java

A PR has been created for you based on this PR content.

Once this PR will be merged, content will be added to your service PR:
Azure/azure-sdk-for-java#3285

@aim-for-better aim-for-better force-pushed the AddCapabilitiesModifyApplication branch 3 times, most recently from ecb5ee7 to f8c3994 Compare July 18, 2019 13:09
"x-ms-enum": {
"name": "ApplicationHttpsEndpointAccessMode",
"modelAsString": true
}
Copy link
Member

Choose a reason for hiding this comment

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

This is a breaking change. Also a bit confused why do we have preview-api-version under stable directory?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a breaking change. Also a bit confused why do we have preview-api-version under stable directory?

@anuchandy This is intentional. It’s a little confusing, but per rule #5 here, whether the swagger spec is in the preview or stable folder “is not a direct analog for whether or not an API Version has the ‘-preview’ suffix or not. SDKs that are generated from 'preview' folder items should indicate to their customers in the most idiomatic way that breaking changes may still be coming.”

Basically the short version is that HDInsight is a GA service that still has an API with a -preview tag. Somebody made the decision several years ago to release stable versions of Hydra/Hyak SDKs for .NET, JavaScript, etc. that consumed this the -preview API. We are now releasing stable swagger-based SDKs so we can at least finally deprecate the Hydra/Hyak SDKs. As a result, we are making a commitment that we will not make breaking changes to this swagger spec version so we can GA some swagger-based SDKs.

Copy link
Member

Choose a reason for hiding this comment

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

@aim-for-better to address the "is this a breaking change" question - as per my comment on the other enum change, please confirm that WebPage is the only actual value the server can accept and return, and I think we're good.

"x-ms-enum": {
"name": "ApplicationType",
"modelAsString": true
}
Copy link
Member

Choose a reason for hiding this comment

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

breaking change.

Copy link
Member Author

Choose a reason for hiding this comment

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

breaking change.

Hi anuchandy, Why do you think it is a breaking change?
I have tested the generated .NET SDK based this swagger spec. In .NET SDK, it is not a breaking change. Because the modelAsString is true, it will change it to enum in .NET SDK
Can you give me a example that confirm that it will bring up a breaking change.

Copy link
Member

Choose a reason for hiding this comment

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

IMO this is only a breaking change if server can return a value (or allow setting a value) that isn't specified in this list. Otherwise, I don't see a problem. @aim-for-better please confirm.

Copy link
Member Author

Choose a reason for hiding this comment

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

IMO this is only a breaking change if server can return a value (or allow setting a value) that isn't specified in this list. Otherwise, I don't see a problem. @aim-for-better please confirm.

@antmarti-microsoft Thanks for you opinion. Now Rp server side only support these two types. So I think there is no problem.

Copy link
Member

Choose a reason for hiding this comment

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

@aim-for-better - the scope of breaking change is different for different languages, for example in java this cause generating a model that extends from ExpandableStringEnum with one value WebPage, like this. I agree that this is not a breaking change in API Level.

Copy link
Member Author

Choose a reason for hiding this comment

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

@aim-for-better - the scope of breaking change is different for different languages, for example in java this cause generating a model that extends from ExpandableStringEnum with one value WebPage, like this. I agree that this is not a breaking change in API Level.

Hi @anuchandy I have tested the java code, I think you are right. However the PR has been merged. So I will pull a new request to fix this breaking change.

"$ref": "#/definitions/QuotaCapability"
}
}
},
Copy link
Member

Choose a reason for hiding this comment

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

I guess all properties of CapabilitiesResult model and the model it composes should be readonly, could you double check?

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess all properties of CapabilitiesResult model and the model it composes should be readonly, could you double check?

Hi anuchandy, I have added the readonly parameter

@anuchandy anuchandy added the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Jul 18, 2019
@aim-for-better aim-for-better force-pushed the AddCapabilitiesModifyApplication branch 2 times, most recently from cef6f97 to 1a06967 Compare July 19, 2019 03:06
},
"subDomainSuffix": {
"type": "string",
"description": "The subDomainSuffix of the application and can not greater than 3 characters."
Copy link
Member

Choose a reason for hiding this comment

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

Please improve the readability of these descriptions (correct grammar, use words instead of writing subDomainSuffix). Note you can use the "maxLength" property to enforce the 3 character restriction.

Copy link
Member Author

Choose a reason for hiding this comment

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

Please improve the readability of these descriptions (correct grammar, use words instead of writing subDomainSuffix). Note you can use the "maxLength" property to enforce the 3 character restriction.

Updated. Remove "can not greater than 3 characters" and don't use maxLength

},
"disableGatewayAuth": {
"type": "boolean",
"description": "The value indicates whether to disable GatewayAuth."
Copy link
Member

Choose a reason for hiding this comment

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

What about something simpler like "Disable gateway authentication"

Copy link
Member Author

Choose a reason for hiding this comment

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

What about something simpler like "Disable gateway authentication"

Updated

"x-ms-enum": {
"name": "ApplicationType",
"modelAsString": true
}
Copy link
Member

Choose a reason for hiding this comment

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

IMO this is only a breaking change if server can return a value (or allow setting a value) that isn't specified in this list. Otherwise, I don't see a problem. @aim-for-better please confirm.

"x-ms-enum": {
"name": "ApplicationHttpsEndpointAccessMode",
"modelAsString": true
}
Copy link
Member

Choose a reason for hiding this comment

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

@aim-for-better to address the "is this a breaking change" question - as per my comment on the other enum change, please confirm that WebPage is the only actual value the server can accept and return, and I think we're good.

},
"QuotaCapability": {
"description": "The regional quota capability.",
"properties": {
"cores_used": {
Copy link
Member

Choose a reason for hiding this comment

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

Please ensure you address this naming in your next API version

Copy link
Member Author

Choose a reason for hiding this comment

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

Please ensure you address this naming in your next API version

Yes. I have created a issue #6724

"type": "integer",
"format": "int64"
},
"max_cores_allowed": {
Copy link
Member

Choose a reason for hiding this comment

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

Please ensure you address this naming in your next API version

Copy link
Member Author

Choose a reason for hiding this comment

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

Please ensure you address this naming in your next API version

Yes. I have created a issue #6724

where:
- $.definitions.CapabilitiesResult.properties.vmSize_filters
- $.definitions.RegionalQuotaCapability.properties.cores_available
- $.definitions.RegionalQuotaCapability.properties.cores_used
- $.definitions.RegionalQuotaCapability.properties.region_name
- $.definitions.QuotaCapability.properties.cores_used
- $.definitions.QuotaCapability.properties.max_cores_allowed
- $.definitions.VmSizeCompatibilityFilter.properties.ClusterVersions
Copy link
Member

Choose a reason for hiding this comment

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

What's the problem with $.definitions.VmSizeCompatibilityFilter.properties.ClusterVersions and all the other $.definitions.VmSizeCompatibilityFilter.properties.* property names. The casing looks fine - do they need to be added to this suppression?

Copy link
Member Author

@aim-for-better aim-for-better Jul 25, 2019

Choose a reason for hiding this comment

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

What's the problem with $.definitions.VmSizeCompatibilityFilter.properties.ClusterVersions and all the other $.definitions.VmSizeCompatibilityFilter.properties.* property names. The casing looks fine - do they need to be added to this suppression?

@antmarti-microsoft In fact swagger violation tools require lowerCamelCase. So the recommended usage is clusterVersions etc. This is why we need add this suppression.

…Mode to Enum.

In order to be consistent with the response from RP side, add suppression for DefinitionsPropertiesNamesCamelCase
@aim-for-better aim-for-better force-pushed the AddCapabilitiesModifyApplication branch from 1a06967 to a22cf02 Compare July 25, 2019 02:32
"cores_used": {
"description": "The number of cores used in the subscription.",
"type": "integer",
"format": "int64"
Copy link
Contributor

Choose a reason for hiding this comment

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

Would int32 make more sense size-wise?

Copy link
Member Author

Choose a reason for hiding this comment

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

Would int32 make more sense size-wise?

No, server data type is long

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't envy someone with a over a 2 billion core bill 😆

@anthony-c-martin anthony-c-martin added ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review and removed ARMReviewInProgress WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Jul 26, 2019
@anuchandy anuchandy merged commit c3a81d4 into Azure:master Jul 29, 2019
aim-for-better pushed a commit to aim-for-better/azure-rest-api-specs that referenced this pull request Jul 30, 2019
…ionType to enum, this will bring breaking change in java sdk. Solution: remove the two enum, change it to string type
anuchandy pushed a commit that referenced this pull request Jul 31, 2019
…pe to enum, this will bring breaking change in java sdk. Solution: remove the two enum, change it to string type (#6785)
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 HDInsight potential-sdk-breaking-change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants