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

Adding new preview version for DNC API to expose optional "purpose" parameter when creating a controller #24097

Conversation

thomasricci
Copy link
Contributor

@thomasricci thomasricci commented May 22, 2023

ARM API Information (Control Plane)

We are creating a new API preview version to allow customers to provision "test" controllers via AZ CLI.
This change is allowed by setting an extra (optional) parameter in the PUT request body (named purpose) that would let specify the type of controller you are going to create. If the parameter is not set the RP will default to "prod" for back compatibility with the existing behavior. No breaking changes to our RP API surface.

Changelog

Add a changelog entry for this PR by answering the following questions:

  1. What's the purpose of the update?
    • new service onboarding
    • new API version
    • update existing version for new feature
    • update existing version to fix swagger quality issue in s360
    • Other, please clarify
  2. When are you targeting to deploy the new service/feature to public regions? June 2023
  3. When do you expect to publish the swagger? May/June 2023
  4. By default, Azure SDKs of all languages (.NET/Python/Java/JavaScript for both management-plane SDK and data-plane SDK, Go for management-plane SDK only ) MUST be refreshed with/after swagger of new version is published. If you prefer NOT to refresh any specific SDK language upon swagger updates in the current PR, please leave details with justification here.

Contribution checklist (MS Employees Only):

If any further question about AME onboarding or validation tools, please view the FAQ.

ARM API Review Checklist

Applicability: ⚠️

If your changes encompass only the following scenarios, you should SKIP this section, as these scenarios do not require ARM review.

  • Change to data plane APIs
  • Adding new properties
  • All removals

Otherwise your PR may be subject to ARM review requirements. Complete the following:

  • Check this box if any of the following apply to the PR so that the label "ARMReview" and "WaitForARMFeedback" will be added by bot to kick off ARM API Review. Missing to check this box in the following scenario may result in delays to the ARM manifest review and deployment.

    • Adding a new service
    • Adding new API(s)
    • Adding a new API version
      -[x] To review changes efficiently, ensure you copy the existing version into the new directory structure for first commit and then push new changes, including version updates, in separate commits. You can use OpenAPIHub to initialize the PR for adding a new version. For more details refer to the wiki. Note that this doesn't apply if you are trying to merge a PR that was previously in the private repository.
  • Ensure you've reviewed following guidelines including ARM resource provider contract and REST guidelines. Estimated time (4 hours). This is required before you can request review from ARM API Review board.

  • If you are blocked on ARM review and want to get the PR merged with urgency, please get the ARM oncall for reviews (RP Manifest Approvers team under Azure Resource Manager service) from IcM and reach out to them.

Breaking Change Review Checklist

If you have any breaking changes as defined in the Breaking Change Policy, request approval from the Breaking Change Review Board.

Action: to initiate an evaluation of the breaking change, create a new intake using the template for breaking changes. Additional details on the process and office hours are on the Breaking Change Wiki.

NOTE: To update API(s) in public preview for over 1 year (refer to Retirement of Previews)

Please follow the link to find more details on PR review process.

@openapi-workflow-bot
Copy link

Hi, @thomasricci 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. vscswagger@microsoft.com

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented May 22, 2023

    Swagger Validation Report

    ️️✔️BreakingChange succeeded [Detail] [Expand]
    There are no breaking changes.
    ️️✔️Breaking Change(Cross-Version) succeeded [Detail] [Expand]
    There are no breaking changes.
    compared swaggers (via Oad v0.10.4)] new version base version
    common-types.json 2023-05-18-preview(3360493) 2021-03-15(main)
    common-types.json 2023-05-18-preview(3360493) 2020-08-08-preview(main)
    controller.json 2023-05-18-preview(3360493) 2021-03-15(main)
    controller.json 2023-05-18-preview(3360493) 2020-08-08-preview(main)
    delegatedSubnets.json 2023-05-18-preview(3360493) 2021-03-15(main)
    delegatedSubnets.json 2023-05-18-preview(3360493) 2020-08-08-preview(main)
    operations.json 2023-05-18-preview(3360493) 2021-03-15(main)
    operations.json 2023-05-18-preview(3360493) 2020-08-08-preview(main)
    orchestrators.json 2023-05-18-preview(3360493) 2021-03-15(main)
    orchestrators.json 2023-05-18-preview(3360493) 2020-08-08-preview(main)
    ️⚠️LintDiff: 0 Warnings warning [Detail]
    compared tags (via openapi-validator v2.1.2) new version base version
    package-2023-05-18-preview package-2023-05-18-preview(3360493) default(thomasricci-dnc-Microsoft.DelegatedNetwork-2021-03-15)

    The following errors/warnings exist before current PR submission:

    Only 30 items are listed, please refer to log for more details.

    Rule Message
    PutResponseSchemaDescription Description of 200 response code of a PUT operation MUST include term 'update'.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/controller.json#L112
    PutResponseSchemaDescription Description of 201 response code of a PUT operation MUST include term 'create'.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/controller.json#L112
    DeleteOperationAsyncResponseValidation An async DELETE operation must set long running operation options 'x-ms-long-running-operation-options'
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/controller.json#L134
    LroLocationHeader A 202 response should include an Location response header.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/controller.json#L163
    ProvisioningStateValidation ProvisioningState must have terminal states: Succeeded, Failed and Canceled.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/controller.json#L403
    PutResponseSchemaDescription Description of 200 response code of a PUT operation MUST include term 'update'.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/delegatedSubnets.json#L112
    PutResponseSchemaDescription Description of 201 response code of a PUT operation MUST include term 'create'.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/delegatedSubnets.json#L112
    PatchResponseCode LRO PATCH must have 200 and 202 return codes.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/delegatedSubnets.json#L134
    LroPatch202 The async patch operation should return 202.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/delegatedSubnets.json#L168
    DeleteOperationAsyncResponseValidation An async DELETE operation must set long running operation options 'x-ms-long-running-operation-options'
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/delegatedSubnets.json#L184
    LroLocationHeader A 202 response should include an Location response header.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/delegatedSubnets.json#L216
    MissingTypeObject The schema 'ResourceUpdateParameters' is considered an object but without a 'type:object', please add the missing 'type:object'.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/delegatedSubnets.json#L348
    ProvisioningStateValidation ProvisioningState must have terminal states: Succeeded, Failed and Canceled.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/delegatedSubnets.json#L406
    PutResponseSchemaDescription Description of 200 response code of a PUT operation MUST include term 'update'.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/orchestrators.json#L112
    PutResponseSchemaDescription Description of 201 response code of a PUT operation MUST include term 'create'.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/orchestrators.json#L112
    DeleteOperationAsyncResponseValidation An async DELETE operation must set long running operation options 'x-ms-long-running-operation-options'
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/orchestrators.json#L134
    LroLocationHeader A 202 response should include an Location response header.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/orchestrators.json#L166
    PatchIdentityProperty The patch operation body parameter schema should contains property 'identity'.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/orchestrators.json#L205
    MissingTypeObject The schema 'OrchestratorResourceUpdateParameters' is considered an object but without a 'type:object', please add the missing 'type:object'.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/orchestrators.json#L365
    ProvisioningStateValidation ProvisioningState must have terminal states: Succeeded, Failed and Canceled.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/orchestrators.json#L422
    MissingTypeObject The schema 'OrchestratorIdentity' is considered an object but without a 'type:object', please add the missing 'type:object'.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/orchestrators.json#L466
    ⚠️ RequiredReadOnlySystemData The response of operation:'Controller_GetDetails' is defined without 'systemData'. Consider adding the systemData to the response.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/controller.json#L38
    ⚠️ RequiredReadOnlySystemData The response of operation:'Controller_Create' is defined without 'systemData'. Consider adding the systemData to the response.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/controller.json#L78
    ⚠️ XmsLongRunningOperationOptions The x-ms-long-running-operation-options should be specified explicitly to indicate the type of response header to track the async operation.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/controller.json#L78
    ⚠️ XmsLongRunningOperationOptions The x-ms-long-running-operation-options should be specified explicitly to indicate the type of response header to track the async operation.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/controller.json#L134
    ⚠️ ProvisioningStateSpecifiedForLRODelete 200 response schema in long running DELETE operation is missing ProvisioningState property. A LRO DELETE operations 200 response schema must have ProvisioningState specified.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/controller.json#L160
    ⚠️ RequiredReadOnlySystemData The response of operation:'Controller_Patch' is defined without 'systemData'. Consider adding the systemData to the response.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/controller.json#L178
    ⚠️ PatchInOperationName 'PATCH' operation 'Controller_Patch' should use method name 'Update'. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/controller.json#L188
    ⚠️ LocationMustHaveXmsMutability Property location must have 'x-ms-mutability':['read', 'create'] extension defined.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/controller.json#L330
    ⚠️ RequiredReadOnlySystemData The response of operation:'DelegatedSubnetService_GetDetails' is defined without 'systemData'. Consider adding the systemData to the response.
    Location: Microsoft.DelegatedNetwork/preview/2023-05-18-preview/delegatedSubnets.json#L38
    ️️✔️Avocado succeeded [Detail] [Expand]
    Validation passes for Avocado.
    ️️✔️SwaggerAPIView succeeded [Detail] [Expand]
    ️️✔️CadlAPIView succeeded [Detail] [Expand]
    ️️✔️TypeSpecAPIView succeeded [Detail] [Expand]
    ️️✔️ModelValidation succeeded [Detail] [Expand]
    Validation passes for ModelValidation.
    ️️✔️SemanticValidation succeeded [Detail] [Expand]
    Validation passes for SemanticValidation.
    ️️✔️PrettierCheck succeeded [Detail] [Expand]
    Validation passes for PrettierCheck.
    ️️✔️SpellCheck succeeded [Detail] [Expand]
    Validation passes for SpellCheck.
    ️️✔️CadlValidation succeeded [Detail] [Expand]
    Validation passes for CadlValidation.
    ️️✔️TypeSpec Validation succeeded [Detail] [Expand]
    Validation passes for TypeSpec Validation.
    ️️✔️PR Summary succeeded [Detail] [Expand]
    Validation passes for Summary.
    Posted by Swagger Pipeline | How to fix these errors?

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented May 22, 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 succeeded [Detail] [Expand]
    • ️✔️Succeeded [Logs] Generate from aa409e2512b71e1bcd02c0e82af605a0388ffc78. 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
      command	autorest --version=2.0.4421 --csharp --reflect-api-versions --license-header=MICROSOFT_MIT_NO_VERSION --use=@microsoft.azure/autorest.csharp@2.3.101 --csharp-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-net/sdk ../azure-rest-api-specs/specification/dnc/resource-manager/readme.md
      cmderr	[Autorest] realpath(): Permission denied
      cmderr	[Autorest] realpath(): Permission denied
      cmderr	[Autorest] realpath(): Permission denied
    • ️✔️Microsoft.Azure.Management.DelegatedNetwork [View full logs]  [Preview SDK Changes]
      warn	Skip artifact folder because it doesn't exist: artifacts/packages
    ️⚠️ azure-sdk-for-python-track2 warning [Detail]
    • ⚠️Warning [Logs] Generate from aa409e2512b71e1bcd02c0e82af605a0388ffc78. 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.
      command	sh scripts/automation_generate.sh ../azure-sdk-for-python_tmp/generateInput.json ../azure-sdk-for-python_tmp/generateOutput.json
      cmderr	[automation_generate.sh] npm notice
      cmderr	[automation_generate.sh] npm notice New minor version of npm available! 9.5.1 -> 9.6.7
      cmderr	[automation_generate.sh] npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.6.7>
      cmderr	[automation_generate.sh] npm notice Run `npm install -g npm@9.6.7` to update!
      cmderr	[automation_generate.sh] npm notice
    • ️✔️track2_azure-mgmt-dnc [View full logs]  [Preview SDK Changes]
      info	[Changelog]   - Initial Release
    ️⚠️ azure-sdk-for-java warning [Detail]
    • ⚠️Warning [Logs] Generate from aa409e2512b71e1bcd02c0e82af605a0388ffc78. 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.1.2
      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.1.2
      cmderr	[init.sh] [notice] To update, run: pip install --upgrade pip
      command	./eng/mgmt/automation/generate.py ../azure-sdk-for-java_tmp/generateInput.json ../azure-sdk-for-java_tmp/generateOutput.json
    • ️✔️azure-resourcemanager-delegatednetwork [View full logs]  [Preview SDK Changes]
    ️️✔️ azure-sdk-for-go succeeded [Detail] [Expand]
    • ️✔️Succeeded [Logs] Generate from aa409e2512b71e1bcd02c0e82af605a0388ffc78. 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
      command	generator automation-v2 ../../../../../azure-sdk-for-go_tmp/generateInput.json ../../../../../azure-sdk-for-go_tmp/generateOutput.json
    • ️✔️sdk/resourcemanager/delegatednetwork/armdelegatednetwork [View full logs]  [Preview SDK Changes]
      info	[Changelog] ### Other Changes
      info	[Changelog]
      info	[Changelog] Total 0 breaking change(s), 0 additive change(s).
    ️⚠️ azure-sdk-for-js warning [Detail]
    • ⚠️Warning [Logs] Generate from aa409e2512b71e1bcd02c0e82af605a0388ffc78. 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
      command	sh .scripts/automation_generate.sh ../azure-sdk-for-js_tmp/generateInput.json ../azure-sdk-for-js_tmp/generateOutput.json
      warn	No file changes detected after generation
      warn	No package detected after generation
    ️❌ azure-powershell failed [Detail]
    • Pipeline Framework Failed [Logs] Generate from aa409e2512b71e1bcd02c0e82af605a0388ffc78. SDK Automation 14.0.0
      command	sh ./tools/SwaggerCI/init.sh ../azure-powershell_tmp/initInput.json ../azure-powershell_tmp/initOutput.json
      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.dnc.DefaultTag [View full logs
      error	Fatal error: SSL error: syscall failure: Broken pipe
      error	The following packages are still pending:
      error		Az.dnc.DefaultTag
    Posted by Swagger Pipeline | How to fix these errors?

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented May 22, 2023

    Generated ApiView

    Language Package Name ApiView Link
    Swagger Microsoft.DelegatedNetwork https://apiview.dev/Assemblies/Review/f2a6c1788cf8439580b7ae5204248937
    Go sdk/resourcemanager/delegatednetwork/armdelegatednetwork There is no API change compared with the previous version
    Java azure-resourcemanager-delegatednetwork https://apiview.dev/Assemblies/Review/7620165b03e541af83fed0e2c15fe999

    @openapi-workflow-bot openapi-workflow-bot bot added ARMReview WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels May 22, 2023
    @openapi-workflow-bot
    Copy link

    Hi, @thomasricci your PR are labelled with WaitForARMFeedback. A notification email will be sent out shortly afterwards to notify ARM review board(armapireview@microsoft.com).

    @thomasricci thomasricci changed the title Adding new preview version for DNC API to expose extra optional "purpose" parameter when creating a controller Adding new preview version for DNC API to expose optional "purpose" parameter when creating a controller May 22, 2023
    @thomasricci thomasricci marked this pull request as ready for review May 22, 2023 23:07
    @visingla-ms visingla-ms added the ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review label May 23, 2023
    @openapi-workflow-bot openapi-workflow-bot bot removed the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label May 23, 2023
    @openapi-workflow-bot
    Copy link

    Hi @thomasricci, Your PR has some issues. Please fix the CI sequentially by following the order of Avocado, semantic validation, model validation, breaking change, lintDiff. If you have any questions, please post your questions in this channel https://aka.ms/swaggersupport.

    TaskHow to fixPriority
    AvocadoFix-AvocadoHigh
    Semantic validationFix-SemanticValidation-ErrorHigh
    Model validationFix-ModelValidation-ErrorHigh
    LintDiffFix-LintDiffhigh
    If you need further help, please feedback via swagger feedback.

    @AzureRestAPISpecReview AzureRestAPISpecReview added the BreakingChangeReviewRequired <valid label in PR review process>add this label when breaking change review is required label May 23, 2023
    @openapi-workflow-bot
    Copy link

    Hi @thomasricci, 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.

    @AzureRestAPISpecReview AzureRestAPISpecReview removed the BreakingChangeReviewRequired <valid label in PR review process>add this label when breaking change review is required label May 23, 2023
    @ArcturusZhang ArcturusZhang merged commit 729c99d into Azure:thomasricci-dnc-Microsoft.DelegatedNetwork-2021-03-15 May 24, 2023
    rkmanda pushed a commit that referenced this pull request Jun 26, 2023
    …version preview/2023-05-18 (#24148)
    
    * Adding new preview version for DNC API to expose optional "purpose" parameter when creating a controller (#24097)
    
    * creating new preview version "2013-05-18-preview" for DNC API
    
    * updating api version in files
    
    * adding purpose flag
    
    * updating readme files
    
    * moving "purpose" to custom props section
    
    * setting default for back compat
    
    * fix tests
    
    * adding location header to DELETE APIs
    
    * Removing 202 for deletes since not used in our RP
    
    * removing long running op flag from DELETE apis
    
    * rollback 202 changes for DELETE APIs and adding the LRO Location header
    
    * adding operations list test for new preview version
    
    * updating scenarios based on autorest generate-api-scenario static
    harryli0108 pushed a commit to harryli0108/azure-rest-api-specs that referenced this pull request Jul 28, 2023
    …version preview/2023-05-18 (Azure#24148)
    
    * Adding new preview version for DNC API to expose optional "purpose" parameter when creating a controller (Azure#24097)
    
    * creating new preview version "2013-05-18-preview" for DNC API
    
    * updating api version in files
    
    * adding purpose flag
    
    * updating readme files
    
    * moving "purpose" to custom props section
    
    * setting default for back compat
    
    * fix tests
    
    * adding location header to DELETE APIs
    
    * Removing 202 for deletes since not used in our RP
    
    * removing long running op flag from DELETE apis
    
    * rollback 202 changes for DELETE APIs and adding the LRO Location header
    
    * adding operations list test for new preview version
    
    * updating scenarios based on autorest generate-api-scenario static
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    ARMReview ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review resource-manager
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    4 participants