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

Align the casing of LifetimeActionsType with the service. #24475

Merged
merged 4 commits into from
Aug 24, 2023

Conversation

adarce
Copy link
Member

@adarce adarce commented Jun 16, 2023

Data Plane (and Control Plane) API - Pull Request

Azure Key Vault's data plane has been using PascalCase for the LifetimeActionsType enum values, while the REST API spec incorrectly specifies the casing to be camelCase. This PR aligns the REST API spec (of both data plane and control plane) with the service.

Note that this is not a breaking change in the service (which has been using PascalCase since GA).

API Info: The Basics

Is this review for (select one):

  • a private preview
  • a public preview
  • GA release

@adarce adarce requested review from heaths and jlichwa as code owners June 16, 2023 00:23
@openapi-workflow-bot
Copy link

Hi, @adarce Thanks for your PR. I am workflow bot for review process. Here are some small tips.

  • Please ensure to do self-check against checklists in first PR comment.
  • PR assignee is the person auto-assigned and responsible for your current PR reviewing and merging.
  • For specs comparison cross API versions, Use API Specs Comparison Report Generator
  • If there is CI failure(s), to fix CI error(s) is mandatory for PR merging; or you need to provide justification in PR comment for explanation. How to fix?

  • Any feedback about review process or workflow bot, pls contact swagger and tools team. [email protected]

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Jun 16, 2023

    Swagger Validation Report

    ️❌BreakingChange: 30 Errors, 0 Warnings failed [Detail]
    compared swaggers (via Oad v0.10.4)] new version base version
    keys.json 7.3-preview(a424071) 7.3-preview(main)
    keys.json 7.4-preview.1(a424071) 7.4-preview.1(main)
    keys.json 7.5-preview.1(a424071) 7.5-preview.1(main)
    keys.json 7.3(a424071) 7.3(main)
    keys.json 7.4(a424071) 7.4(main)
    keys.json 2021-04-01-preview(a424071) 2021-04-01-preview(main)
    keys.json 2021-06-01-preview(a424071) 2021-06-01-preview(main)
    keys.json 2021-11-01-preview(a424071) 2021-11-01-preview(main)
    keys.json 2022-02-01-preview(a424071) 2022-02-01-preview(main)
    keys.json 2022-07-01(a424071) 2022-07-01(main)
    keys.json 2022-11-01(a424071) 2022-11-01(main)
    keysManagedHsm.json 2022-11-01(a424071) 2022-11-01(main)
    keys.json 2023-02-01(a424071) 2023-02-01(main)
    keysManagedHsm.json 2023-02-01(a424071) 2023-02-01(main)
    Rule Message
    1019 - RemovedEnumValue The new version is removing enum value(s) 'notify' from the old version.
    New: Microsoft.KeyVault/preview/7.3-preview/keys.json#L2194:9
    Old: Microsoft.KeyVault/preview/7.3-preview/keys.json#L2194:9
    1019 - RemovedEnumValue The new version is removing enum value(s) 'notify' from the old version.
    New: Microsoft.KeyVault/preview/7.4-preview.1/keys.json#L2222:9
    Old: Microsoft.KeyVault/preview/7.4-preview.1/keys.json#L2222:9
    1019 - RemovedEnumValue The new version is removing enum value(s) 'notify' from the old version.
    New: Microsoft.KeyVault/preview/7.5-preview.1/keys.json#L2200:9
    Old: Microsoft.KeyVault/preview/7.5-preview.1/keys.json#L2200:9
    1019 - RemovedEnumValue The new version is removing enum value(s) 'notify' from the old version.
    New: Microsoft.KeyVault/stable/7.3/keys.json#L2195:9
    Old: Microsoft.KeyVault/stable/7.3/keys.json#L2195:9
    1019 - RemovedEnumValue The new version is removing enum value(s) 'notify' from the old version.
    New: Microsoft.KeyVault/stable/7.4/keys.json#L2195:9
    Old: Microsoft.KeyVault/stable/7.4/keys.json#L2195:9
    1019 - RemovedEnumValue The new version is removing enum value(s) 'notify' from the old version.
    New: Microsoft.KeyVault/preview/2021-04-01-preview/keys.json#L594:9
    Old: Microsoft.KeyVault/preview/2021-04-01-preview/keys.json#L594:9
    1019 - RemovedEnumValue The new version is removing enum value(s) 'notify' from the old version.
    New: Microsoft.KeyVault/preview/2021-06-01-preview/keys.json#L612:9
    Old: Microsoft.KeyVault/preview/2021-06-01-preview/keys.json#L612:9
    1019 - RemovedEnumValue The new version is removing enum value(s) 'notify' from the old version.
    New: Microsoft.KeyVault/preview/2021-11-01-preview/keys.json#L612:9
    Old: Microsoft.KeyVault/preview/2021-11-01-preview/keys.json#L612:9
    1019 - RemovedEnumValue The new version is removing enum value(s) 'notify' from the old version.
    New: Microsoft.KeyVault/preview/2022-02-01-preview/keys.json#L613:9
    Old: Microsoft.KeyVault/preview/2022-02-01-preview/keys.json#L613:9
    1019 - RemovedEnumValue The new version is removing enum value(s) 'notify' from the old version.
    New: Microsoft.KeyVault/stable/2022-07-01/keys.json#L614:9
    Old: Microsoft.KeyVault/stable/2022-07-01/keys.json#L614:9
    1019 - RemovedEnumValue The new version is removing enum value(s) 'notify' from the old version.
    New: Microsoft.KeyVault/stable/2022-11-01/keys.json#L614:9
    Old: Microsoft.KeyVault/stable/2022-11-01/keys.json#L614:9
    1019 - RemovedEnumValue The new version is removing enum value(s) 'notify' from the old version.
    New: Microsoft.KeyVault/stable/2022-11-01/keysManagedHsm.json#L543:9
    Old: Microsoft.KeyVault/stable/2022-11-01/keysManagedHsm.json#L543:9
    1019 - RemovedEnumValue The new version is removing enum value(s) 'notify' from the old version.
    New: Microsoft.KeyVault/stable/2023-02-01/keys.json#L614:9
    Old: Microsoft.KeyVault/stable/2023-02-01/keys.json#L614:9
    1019 - RemovedEnumValue The new version is removing enum value(s) 'notify' from the old version.
    New: Microsoft.KeyVault/stable/2023-02-01/keysManagedHsm.json#L543:9
    Old: Microsoft.KeyVault/stable/2023-02-01/keysManagedHsm.json#L543:9
    1020 - AddedEnumValue The new version is adding enum value(s) 'Rotate, Notify' from the old version.
    New: Microsoft.KeyVault/preview/7.3-preview/keys.json#L2194:9
    Old: Microsoft.KeyVault/preview/7.3-preview/keys.json#L2194:9
    1020 - AddedEnumValue The new version is adding enum value(s) 'Rotate, Notify' from the old version.
    New: Microsoft.KeyVault/preview/7.4-preview.1/keys.json#L2222:9
    Old: Microsoft.KeyVault/preview/7.4-preview.1/keys.json#L2222:9
    1020 - AddedEnumValue The new version is adding enum value(s) 'Rotate, Notify' from the old version.
    New: Microsoft.KeyVault/preview/7.5-preview.1/keys.json#L2200:9
    Old: Microsoft.KeyVault/preview/7.5-preview.1/keys.json#L2200:9
    1020 - AddedEnumValue The new version is adding enum value(s) 'Rotate, Notify' from the old version.
    New: Microsoft.KeyVault/stable/7.3/keys.json#L2195:9
    Old: Microsoft.KeyVault/stable/7.3/keys.json#L2195:9
    1020 - AddedEnumValue The new version is adding enum value(s) 'Rotate, Notify' from the old version.
    New: Microsoft.KeyVault/stable/7.4/keys.json#L2195:9
    Old: Microsoft.KeyVault/stable/7.4/keys.json#L2195:9
    1020 - AddedEnumValue The new version is adding enum value(s) 'Rotate, Notify' from the old version.
    New: Microsoft.KeyVault/preview/2021-04-01-preview/keys.json#L594:9
    Old: Microsoft.KeyVault/preview/2021-04-01-preview/keys.json#L594:9
    1020 - AddedEnumValue The new version is adding enum value(s) 'Rotate, Notify' from the old version.
    New: Microsoft.KeyVault/preview/2021-06-01-preview/keys.json#L612:9
    Old: Microsoft.KeyVault/preview/2021-06-01-preview/keys.json#L612:9
    1020 - AddedEnumValue The new version is adding enum value(s) 'Rotate, Notify' from the old version.
    New: Microsoft.KeyVault/preview/2021-11-01-preview/keys.json#L612:9
    Old: Microsoft.KeyVault/preview/2021-11-01-preview/keys.json#L612:9
    1020 - AddedEnumValue The new version is adding enum value(s) 'Rotate, Notify' from the old version.
    New: Microsoft.KeyVault/preview/2022-02-01-preview/keys.json#L613:9
    Old: Microsoft.KeyVault/preview/2022-02-01-preview/keys.json#L613:9
    1020 - AddedEnumValue The new version is adding enum value(s) 'Rotate, Notify' from the old version.
    New: Microsoft.KeyVault/stable/2022-07-01/keys.json#L614:9
    Old: Microsoft.KeyVault/stable/2022-07-01/keys.json#L614:9
    1020 - AddedEnumValue The new version is adding enum value(s) 'Rotate, Notify' from the old version.
    New: Microsoft.KeyVault/stable/2022-11-01/keys.json#L614:9
    Old: Microsoft.KeyVault/stable/2022-11-01/keys.json#L614:9
    1020 - AddedEnumValue The new version is adding enum value(s) 'Rotate, Notify' from the old version.
    New: Microsoft.KeyVault/stable/2022-11-01/keysManagedHsm.json#L543:9
    Old: Microsoft.KeyVault/stable/2022-11-01/keysManagedHsm.json#L543:9
    1020 - AddedEnumValue The new version is adding enum value(s) 'Rotate, Notify' from the old version.
    New: Microsoft.KeyVault/stable/2023-02-01/keys.json#L614:9
    Old: Microsoft.KeyVault/stable/2023-02-01/keys.json#L614:9
    1020 - AddedEnumValue The new version is adding enum value(s) 'Rotate, Notify' from the old version.
    New: Microsoft.KeyVault/stable/2023-02-01/keysManagedHsm.json#L543:9
    Old: Microsoft.KeyVault/stable/2023-02-01/keysManagedHsm.json#L543:9
    1047 - XmsEnumChanged The new version has a different x-ms-enum 'name' than the previous one.
    New: Microsoft.KeyVault/preview/7.5-preview.1/keys.json#L2200:9
    Old: Microsoft.KeyVault/preview/7.5-preview.1/keys.json#L2200:9
    1047 - XmsEnumChanged The new version has a different x-ms-enum 'name' than the previous one.
    New: Microsoft.KeyVault/stable/7.4/keys.json#L2195:9
    Old: Microsoft.KeyVault/stable/7.4/keys.json#L2195:9
    ️️✔️Breaking Change(Cross-Version) succeeded [Detail] [Expand]
    There are no breaking changes.
    ️️✔️CredScan succeeded [Detail] [Expand]
    There is no credential detected.
    ️🔄LintDiff inProgress [Detail]
    ️️✔️Avocado succeeded [Detail] [Expand]
    Validation passes for Avocado.
    ️️✔️SwaggerAPIView succeeded [Detail] [Expand]
    ️️✔️TypeSpecAPIView succeeded [Detail] [Expand]
    ️️✔️ModelValidation succeeded [Detail] [Expand]
    Validation passes for ModelValidation.
    ️️✔️SemanticValidation succeeded [Detail] [Expand]
    Validation passes for SemanticValidation.
    ️️✔️PoliCheck succeeded [Detail] [Expand]
    Validation passed for PoliCheck.
    ️️✔️PrettierCheck succeeded [Detail] [Expand]
    Validation passes for PrettierCheck.
    ️️✔️SpellCheck succeeded [Detail] [Expand]
    Validation passes for SpellCheck.
    ️️✔️Lint(RPaaS) succeeded [Detail] [Expand]
    Validation passes for Lint(RPaaS).
    ️️✔️PR Summary succeeded [Detail] [Expand]
    Validation passes for Summary.
    ️️✔️Automated merging requirements met succeeded [Detail] [Expand]
    Posted by Swagger Pipeline | How to fix these errors?

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Jun 16, 2023

    Swagger Generation Artifacts

    ️️✔️ApiDocPreview succeeded [Detail] [Expand]
     Please click here to preview with your @microsoft account. 
    ️️✔️SDK Breaking Change Tracking succeeded [Detail] [Expand]

    Breaking Changes Tracking



    ️⚠️ azure-sdk-for-net-track2 warning [Detail]
    • ⚠️Warning [Logs]Release - Generate from c06b7c2. SDK Automation 14.0.0
      command	pwsh ./eng/scripts/Automation-Sdk-Init.ps1 ../azure-sdk-for-net_tmp/initInput.json ../azure-sdk-for-net_tmp/initOutput.json
      warn		specification/keyvault/data-plane/readme.md skipped due to azure-sdk-for-net-track2 not found in swagger-to-sdk
      command	pwsh ./eng/scripts/Invoke-GenerateAndBuildV2.ps1 ../azure-sdk-for-net_tmp/generateInput.json ../azure-sdk-for-net_tmp/generateOutput.json
      warn	No file changes detected after generation
    • ️✔️Azure.ResourceManager.KeyVault [View full logs
      info	[Changelog]
    ️⚠️ azure-sdk-for-python-track2 warning [Detail]
    • ⚠️Warning [Logs]Release - Generate from c06b7c2. SDK Automation 14.0.0
      command	sh scripts/automation_init.sh ../azure-sdk-for-python_tmp/initInput.json ../azure-sdk-for-python_tmp/initOutput.json
      cmderr	[automation_init.sh] WARNING: Skipping azure-nspkg as it is not installed.
      warn		specification/keyvault/data-plane/readme.md skipped due to azure-sdk-for-python-track2 not found in swagger-to-sdk
      command	sh scripts/automation_generate.sh ../azure-sdk-for-python_tmp/generateInput.json ../azure-sdk-for-python_tmp/generateOutput.json
      cmderr	[automation_generate.sh]
      cmderr	[automation_generate.sh] npm notice New minor version of npm available! 9.6.7 -> 9.8.1
      cmderr	[automation_generate.sh] npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.8.1>
      cmderr	[automation_generate.sh] npm notice Run `npm install -g [email protected]` to update!
      cmderr	[automation_generate.sh] npm notice
    • ️✔️track2_azure-mgmt-keyvault [View full logs]  [Release SDK Changes]
      info	[Changelog] change log generation failed!!!
    ️⚠️ azure-sdk-for-java warning [Detail]
    • ⚠️Warning [Logs]Release - Generate from c06b7c2. SDK Automation 14.0.0
      command	./eng/mgmt/automation/init.sh ../azure-sdk-for-java_tmp/initInput.json ../azure-sdk-for-java_tmp/initOutput.json
      cmderr	[init.sh] [notice] A new release of pip is available: 23.0.1 -> 23.2.1
      cmderr	[init.sh] [notice] To update, run: pip install --upgrade pip
      cmderr	[init.sh] [notice] A new release of pip is available: 23.0.1 -> 23.2.1
      cmderr	[init.sh] [notice] To update, run: pip install --upgrade pip
      warn		specification/keyvault/data-plane/readme.md skipped due to azure-sdk-for-java not found in swagger-to-sdk
      command	./eng/mgmt/automation/generate.py ../azure-sdk-for-java_tmp/generateInput.json ../azure-sdk-for-java_tmp/generateOutput.json
    • ️✔️azure-resourcemanager-keyvault-generated [View full logs]  [Release SDK Changes]
    ️️✔️ azure-sdk-for-go succeeded [Detail] [Expand]
    • ️✔️Succeeded [Logs]Release - Generate from c06b7c2. SDK Automation 14.0.0
      command	sh ./eng/scripts/automation_init.sh ../../../../../azure-sdk-for-go_tmp/initInput.json ../../../../../azure-sdk-for-go_tmp/initOutput.json
      warn		specification/keyvault/data-plane/readme.md skipped due to azure-sdk-for-go not found in swagger-to-sdk
      command	generator automation-v2 ../../../../../azure-sdk-for-go_tmp/generateInput.json ../../../../../azure-sdk-for-go_tmp/generateOutput.json
    • ️✔️sdk/resourcemanager/keyvault/armkeyvault [View full logs]  [Release SDK Changes]
      info	[Changelog] ### Features Added
      info	[Changelog]
      info	[Changelog] - New value `ManagedHsmSKUNameCustomB6` added to enum type `ManagedHsmSKUName`
      info	[Changelog]
      info	[Changelog] Total 0 breaking change(s), 1 additive change(s).
    ️️✔️ azure-sdk-for-js succeeded [Detail] [Expand]
    • ️✔️Succeeded [Logs]Release - Generate from c06b7c2. SDK Automation 14.0.0
      command	sh .scripts/automation_init.sh ../azure-sdk-for-js_tmp/initInput.json ../azure-sdk-for-js_tmp/initOutput.json
      warn	File azure-sdk-for-js_tmp/initOutput.json not found to read
      warn		specification/keyvault/data-plane/readme.md skipped due to azure-sdk-for-js not found in swagger-to-sdk
      command	sh .scripts/automation_generate.sh ../azure-sdk-for-js_tmp/generateInput.json ../azure-sdk-for-js_tmp/generateOutput.json
      cmderr	[automation_generate.sh] [ERROR] Cannot generate changelog because the codes of local and npm may be the same.
    • ️✔️@azure/arm-keyvault [View full logs]  [Release SDK Changes]
      info	[Changelog]
      error	breakingChangeTracking is enabled, but version or changelogItem is not found in output.
    ️️✔️ azure-resource-manager-schemas succeeded [Detail] [Expand]
    • ️✔️Succeeded [Logs]Release - Generate from c06b7c2. Schema Automation 14.0.0
      command	.sdkauto/initScript.sh ../azure-resource-manager-schemas_tmp/initInput.json ../azure-resource-manager-schemas_tmp/initOutput.json
      warn	File azure-resource-manager-schemas_tmp/initOutput.json not found to read
      warn		specification/keyvault/data-plane/readme.md skipped due to azure-resource-manager-schemas not found in swagger-to-sdk
      command	.sdkauto/generateScript.sh ../azure-resource-manager-schemas_tmp/generateInput.json ../azure-resource-manager-schemas_tmp/generateOutput.json
    • ️✔️keyvault [View full logs]  [Release Schema Changes]
    ️❌ azure-powershell failed [Detail]
    • Pipeline Framework Failed [Logs]Release - Generate from c06b7c2. SDK Automation 14.0.0
      command	sh ./tools/SwaggerCI/init.sh ../azure-powershell_tmp/initInput.json ../azure-powershell_tmp/initOutput.json
      warn		specification/keyvault/data-plane/readme.md skipped due to azure-powershell not found in swagger-to-sdk
      command	pwsh ./tools/SwaggerCI/psci.ps1 ../azure-powershell_tmp/generateInput.json ../azure-powershell_tmp/generateOutput.json
      SSL error: syscall failure: Broken pipe
      Error: SSL error: syscall failure: Broken pipe
    • ⚠️Az.keyvault.DefaultTag [View full logs
      error	Fatal error: SSL error: syscall failure: Broken pipe
      error	The following packages are still pending:
      error		Az.keyvault.DefaultTag
    Posted by Swagger Pipeline | How to fix these errors?

    @ghost ghost added the KeyVault label Jun 16, 2023
    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Jun 16, 2023

    Generated ApiView

    Language Package Name ApiView Link
    Go sdk/resourcemanager/keyvault/armkeyvault https://apiview.dev/Assemblies/Review/8ab3940281cc4abe8689ecfe070548e5
    Java azure-resourcemanager-keyvault-generated https://apiview.dev/Assemblies/Review/d1662e9c0f0943eeac4ce02129962c0e
    .Net Azure.ResourceManager.KeyVault There is no API change compared with the previous version
    JavaScript @azure/arm-keyvault https://apiview.dev/Assemblies/Review/1f366ad839ac492092365403696ddbf0

    @AzureRestAPISpecReview AzureRestAPISpecReview added BreakingChangeReviewRequired <valid label in PR review process>add this label when breaking change review is required data-plane labels Jun 16, 2023
    @openapi-workflow-bot
    Copy link

    Hi @adarce, one or multiple breaking change(s) is detected in your PR. Please check out the breaking change(s), and provide business justification in the PR comment and @ PR assignee why you must have these change(s), and how external customer impact can be mitigated. Please ensure to follow breaking change policy to request breaking change review and approval before proceeding swagger PR review.
    Action: To initiate an evaluation of the breaking change, create a new intake using the template for breaking changes. Addition details on the process and office hours are on the Breaking change Wiki.
    If you want to know the production traffic statistic, please see ARM Traffic statistic.
    If you think it is false positive breaking change, please provide the reasons in the PR comment, report to Swagger Tooling Team via https://aka.ms/swaggerfeedback.
    Note: To avoid breaking change, you can refer to Shift Left Solution for detecting breaking change in early phase at your service code repository.

    Copy link
    Member

    @heaths heaths left a comment

    Choose a reason for hiding this comment

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

    When will the service roll out?

    @adarce
    Copy link
    Member Author

    adarce commented Jun 16, 2023

    When will the service roll out?

    The change to revert the service back to using "Notify"/"Rotate" instead of lowercase has been merged. The next deployment will probably begin early next week, and it takes 5 business days to complete.

    @heaths
    Copy link
    Member

    heaths commented Jun 16, 2023

    @JeffreyRichter @mikekistler this is aligning the swagger to match the service - or at least what the service did do and will soon again. Can you approve?

    @mikekistler mikekistler added the Approved-BreakingChange DO NOT USE! OBSOLETE label. See https://github.com/Azure/azure-sdk-tools/issues/6374 label Jun 16, 2023
    Copy link
    Contributor

    @jlichwa jlichwa left a comment

    Choose a reason for hiding this comment

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

    Lets Add CP to it, so we are consistent.

    @adarce
    Copy link
    Member Author

    adarce commented Jun 16, 2023

    Lets Add CP to it, so we are consistent.

    Updated.

    @heaths
    Copy link
    Member

    heaths commented Jun 19, 2023

    Lets Add CP to it, so we are consistent.

    @jlichwa is that actually what CP returns though? In a previous conversation, you indicated that DP was likely changed to align with CP.

    @jlichwa
    Copy link
    Contributor

    jlichwa commented Jun 19, 2023

    Lets Add CP to it, so we are consistent.

    @jlichwa is that actually what CP returns though? In a previous conversation, you indicated that DP was likely changed to align with CP.

    I checked CP has lower case. We aligned service to Swagger specs which all had lower case, as we now change service back to PascalCase- I want it to be consistent everywhere, so swagger needs to be updated as well as service change rolled back.

    I believe @adarce created separate PR for CP

    @adarce
    Copy link
    Member Author

    adarce commented Jun 19, 2023

    Lets Add CP to it, so we are consistent.

    @jlichwa is that actually what CP returns though? In a previous conversation, you indicated that DP was likely changed to align with CP.

    I checked CP has lower case. We aligned service to Swagger specs which all had lower case, as we now change service back to PascalCase- I want it to be consistent everywhere, so swagger needs to be updated as well as service change rolled back.

    I believe @adarce created separate PR for CP

    CP's implementation does not attempt to perform any normalization for casing.

    • It accepts any casing for the LifetimeActionType (e.g.: "ROTATE" or "NoTiFy"), delegates the operation to DP, then returns to the caller whatever response came from DP.
    • So CP is currently using lowercase because of the regression with DP, which changed to use lowercase.
    • When DP is reverted to go back to "Rotate"/"Notify", we should automatically see the same behavior with CP. I did not make any changes to the CP service.

    @jlichwa
    Copy link
    Contributor

    jlichwa commented Jun 20, 2023

    Lets Add CP to it, so we are consistent.

    @jlichwa is that actually what CP returns though? In a previous conversation, you indicated that DP was likely changed to align with CP.

    I checked CP has lower case. We aligned service to Swagger specs which all had lower case, as we now change service back to PascalCase- I want it to be consistent everywhere, so swagger needs to be updated as well as service change rolled back.
    I believe @adarce created separate PR for CP

    CP's implementation does not attempt to perform any normalization for casing.

    • It accepts any casing for the LifetimeActionType (e.g.: "ROTATE" or "NoTiFy"), delegates the operation to DP, then returns to the caller whatever response came from DP.
    • So CP is currently using lowercase because of the regression with DP, which changed to use lowercase.
    • When DP is reverted to go back to "Rotate"/"Notify", we should automatically see the same behavior with CP. I did not make any changes to the CP service.

    Great so just the swagger update on CP - in general it is ok to accept anything, the only thing return value has to be normalized to swagger to align with REST API guidelines for DP.

    @heaths
    Copy link
    Member

    heaths commented Jun 20, 2023

    CP should not be changed. It's a breaking change. They may be inconsistent, but that is how the service behavior shipped and should be retained. Only the swaggers should be updated. CP is still case sensitive - only case-insensitive URLs are allowed. /cc @JeffreyRichter

    @openapi-pipeline-app
    Copy link

    Swagger Generation Artifacts

    ️️✔️ApiDocPreview succeeded [Detail] [Expand]
     Please click here to preview with your @microsoft account. 
    ️️✔️SDK Breaking Change Tracking succeeded [Detail] [Expand]

    Breaking Changes Tracking



    ️⌛ azure-sdk-for-net-track2 pending [Detail]
    ️⌛ azure-sdk-for-python-track2 pending [Detail]
    ️⌛ azure-sdk-for-java pending [Detail]
    ️⌛ azure-sdk-for-go pending [Detail]
    ️⌛ azure-sdk-for-js pending [Detail]
    ️⌛ azure-resource-manager-schemas pending [Detail]
    ️❌ azure-powershell failed [Detail]
    • Pipeline Framework Failed [Logs] Generate from 34e5544ad7d71ad8814714371c5dc58694b04238. SDK Automation 14.0.0
      command	sh ./tools/SwaggerCI/init.sh ../azure-powershell_tmp/initInput.json ../azure-powershell_tmp/initOutput.json
      warn		specification/keyvault/data-plane/readme.md skipped due to azure-powershell not found in swagger-to-sdk
      command	pwsh ./tools/SwaggerCI/psci.ps1 ../azure-powershell_tmp/generateInput.json ../azure-powershell_tmp/generateOutput.json
      SSL error: syscall failure: Broken pipe
      Error: SSL error: syscall failure: Broken pipe
    • ⚠️Az.keyvault.DefaultTag [View full logs
      error	Fatal error: SSL error: syscall failure: Broken pipe
      error	The following packages are still pending:
      error		Az.keyvault.DefaultTag
    Posted by Swagger Pipeline | How to fix these errors?

    @tombuildsstuff
    Copy link
    Contributor

    @heaths @JeffreyRichter @mikekistler unfortunately having the same constant defined in different casings as here is going to cause us issues:

    https://github.com/Azure/azure-rest-api-specs/pull/24475/files#diff-0fb3add5c037b0d51386242d02493c73ce8fc135802dfeab0fa345e18686f586R597-R618

    To workaround API inconsistencies we're now normalizing whatever value the API returns to the value defined in the API Definition, for example:

    https://github.com/hashicorp/go-azure-sdk/blob/40cb41efbd8e726fe45858604be45b49a203caf1/resource-manager/dns/2018-05-01/zones/constants.go#L26-L51

    To do that, we're outputting a map of the possible values, with the key being the value lower-cased, and then iterating over those until we find a match - which would lead to a compile time issue for us here since these 4 values (or rather, 2 sets of the same value in different casings) get output into the same map/dictionary, which isn't valid e.g.:

    https://github.com/hashicorp/go-azure-sdk/blob/40cb41efbd8e726fe45858604be45b49a203caf1/resource-manager/dns/2018-05-01/zones/constants.go#L41-L42

    The intention from our side there is to allow our side to provide case-sensitive validation for the Create/Update payloads and normalize the values from API Responses to ensure this matches the casing - with the intention of trying to workaround casing inconsistencies within the API.

    Whilst we can look to update that functionality to use a different approach, the same issue remains of which casing should be used - which I'm assuming is why the linter error called out in this comment exists?

    However, ultimately even outside of our use-case, I believe is going to cause a considerable amount of user confusion/lost time for consumers of the SDK/API. For example, consider that you're typing in an IDE/editor and autocomplete suggests the value Notify on which you hit enter (whilst an alternate value notify is present, you might assume this is an editor/autocomplete bug). Whilst that may sound unlikely I've seen developers lose a considerable amount of time to this in the past in different projects - even in cases where the API returns an error message along the lines of the value must be 'notify', I've seen developers not note the casing difference and lose a considerable amount of time to this.


    I'm assuming that both Key Vault and Managed HSM have likely started out from the same set of endpoints/payloads and may even be the same codebase with conditionals behind the scenes - however as there's sufficient differences between these now which are are causing confusion (since these are only described in the documentation), and are also now causing issues on the API Definitions side (e.g. this issue) - is it worth splitting the API Definitions for Key Vault and Managed HSMs into separate folders to remove these issues?

    Whilst I appreciate that would be more work for the Service Team to maintain, it'd better reflect the behaviour of the API today given the differences in these two APIs.


    Alternatively, per this comment from @jlichwa:

    @heaths ARM API just call data plane, so we would like to be consistent across all interfaces. We can't store one value for ARM and one value for DP. Once we changed DP, both planes are affected here.

    Rather than having SDK Consumers have to determine which casing is relevant here - given the ARM API is proxying the call for the Data Plane API, and thus presumably has context of what it's talking to (e.g. the type field for the ARM Resource is a differentiator) - I'd argue it'd make more sense for a single set of casing to be defined within the API Definitions and to have the ARM API determine the appropriate casing for the Data Plane as needed, based on whether it's communicating with the Data Plane API for a Key Vault or a Managed HSM - which would remove this issue.


    However unfortunately in it's current state this is going to cause us issues - as such is it possible for this PR to be reverted temporarily for the moment until the issues described above are addressed?

    @heaths
    Copy link
    Member

    heaths commented Aug 25, 2023

    @tombuildsstuff the swagger now matches what the service has been doing for the past couple years. So code either wasn't impacted before, or already normalized for this. The SDKs will normalize the value, but any other REST callers would've already compensated. Given how long the services were returning these values, we made the least bad decision to fix the swaggers and have the differently cased enum values.

    @danielrbradley
    Copy link

    danielrbradley commented Aug 31, 2023

    @heaths I'd also like to raise that the duplicate enum value left in here has broken us downstream. It appears that the old value of notify was removed, but the rotate value wasn't.

    heaths added a commit to heaths/azure-rest-api-specs that referenced this pull request Sep 7, 2023
    Original goal was to properly document "Rotate" that Key Vault returned and "rotate" that Managed HSM returned (and was originally in the swagger), but that case-insensitively duplicative value caused issues with some code generators.
    
    Reverts parts of Azure#24475
    @heaths
    Copy link
    Member

    heaths commented Sep 7, 2023

    @tombuildsstuff @danielrbradley after internal discussions, we appreciate that having both Rotate and rotate - though technically correct and matching services' behavior - causes more problems and are reverting that change in #25714. It seems many callers are already comparing case-insensitively, and the services are doing so in request handlers already.

    Generally, though, we recommend case-sensitive comparisons for data plane APIs, per our guidelines linked above. This is what our Azure SDKs do normally. In this particular case, however, we are already updating our code to do case-insensitive comparisons - which was always the plan and the swagger change had nothing to do with that.

    @tombuildsstuff
    Copy link
    Contributor

    @tombuildsstuff @danielrbradley after internal discussions, we appreciate that having both Rotate and rotate - though technically correct and matching services' behavior - causes more problems and are reverting that change in #25714.

    Awesome, that's great thanks for that 👍

    It seems many callers are already comparing case-insensitively, and the services are doing so in request handlers already.
    [..]
    In this particular case, however, we are already updating our code to do case-insensitive comparisons - which was always the plan and the swagger change had nothing to do with that.

    That's great to hear - out of interest is that change being applied to the entire Key Vault API?

    We've noted that the Access Policies API is particularly case-sensitive, insofar as the exact casing has to be specified when removing an Access Policy - so I'm wondering if that API is included in the insensitivity changes?

    Thanks!

    @heaths
    Copy link
    Member

    heaths commented Sep 8, 2023

    The Azure SDK APIs will only be comparing the key rotation lifetime action enum case-insensitively. All other enum comparisons are case-sensitive per guidelines.

    As for the rest of the Key Vault REST API, I can't say. The service team indicated that at least key rotation lifetime actions are case-insensitive on the service back end, but I don't know if others are. Given our guidelines I've linked to above, I would assume they are not and stick to what documentation says unless you notice the docs (based on OpenAPI) are wrong - in which case we'd appreciate a bug to fix the docs so they are accurate. :)

    rkmanda pushed a commit that referenced this pull request Sep 13, 2023
    * Remove redundant "rotate" from Keys API
    
    Original goal was to properly document "Rotate" that Key Vault returned and "rotate" that Managed HSM returned (and was originally in the swagger), but that case-insensitively duplicative value caused issues with some code generators.
    
    Reverts parts of #24475
    
    * Remove now-unnecessary exemptions
    
    * Fix description on Notify
    jnlycklama pushed a commit that referenced this pull request Nov 8, 2023
    * Remove redundant "rotate" from Keys API
    
    Original goal was to properly document "Rotate" that Key Vault returned and "rotate" that Managed HSM returned (and was originally in the swagger), but that case-insensitively duplicative value caused issues with some code generators.
    
    Reverts parts of #24475
    
    * Remove now-unnecessary exemptions
    
    * Fix description on Notify
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    Approved-BreakingChange DO NOT USE! OBSOLETE label. See https://github.com/Azure/azure-sdk-tools/issues/6374 Approved-Suppression ARMReview ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review BreakingChangeReviewRequired <valid label in PR review process>add this label when breaking change review is required data-plane KeyVault ReadyForApiTest <valid label in PR review process>add this label when swagger and service APIs are ready for test resource-manager SuppressionReviewRequired
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    10 participants