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

Fixing BaseResourceProperties having discriminator but no derived object #25154

Merged
merged 3 commits into from
Aug 23, 2023

Conversation

chandrasekarendran
Copy link
Contributor

@chandrasekarendran chandrasekarendran commented Aug 3, 2023

ARM (Control Plane) API Specification Update Pull Request

PR review workflow diagram

Please understand this diagram before proceeding. It explains how to get your PR approved & merged.

diagram

[1] public repo review queue, private repo review queue
The PRs are processed by time opened, ascending. Your PR may show up on 2nd or later page.
If you addressed Step 1 from the diagram and your PR is not showing up in the queue, ensure the label ARMChangesRequested
is removed from your PR. This should cause the label WaitForARMFeedback to be added.
[2] https://aka.ms/azsdk/support/specreview-channel
[3] List of SDK breaking changes approvers in pinned Teams announcement
[4] public repo merge queue, private repo merge queue

If you need further help with anything, see Getting help section below.

Purpose of this PR

What's the purpose of this PR? Check all that apply. This is mandatory!

  • New API version. (Such PR should have been generated with OpenAPI Hub, per this wiki doc.)
  • Update existing version for a new feature. (This is applicable only when you are revising a private preview API version.)
  • Update existing version to fix swagger quality issues in S360.
  • Other, please clarify:
    • edit this with your clarification

Due diligence checklist

To merge this PR, you must go through the following checklist and confirm you understood
and followed the instructions by checking all the boxes:

Breaking changes review (Step 1)

  • If the automation determines you have breaking changes, i.e. Step 1 from the diagram applies to you,
    you must follow the breaking changes process.
    IMPORTANT This applies even if:
    • The tool fails while it shouldn't, e.g. due to runtime exception, or incorrect detection of breaking changes.
    • You believe there is no need for you to request breaking change approval, for any reason.
      Such claims must be reviewed, and the process is the same.

ARM API changes review (Step 2)

  • If this PR is in purview of ARM review then automation will add the ARMReview label.
  • If you want to force ARM review, add the label yourself.
  • Proceed according to the diagram at the top of this comment.

Getting help

@openapi-workflow-bot
Copy link

Hi, @chandrasekarendran! Thank you for your pull request. To help get your PR merged:

  • Ensure you reviewed the checklists in the PR description.
  • Know that PR assignee is the person auto-assigned and responsible for your current PR review and approval.
  • For convenient view of the API changes made by this PR, refer to the URLs provided in the table in the Generated ApiView comment added to this PR. You can use ApiView to show API versions diff.
  • @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Aug 3, 2023

    Swagger Validation Report

    ️❌BreakingChange: 1 Errors, 0 Warnings failed [Detail]
    compared swaggers (via Oad v0.10.4)] new version base version
    dataprotection.json 2023-05-01(078a5e2) 2023-05-01(main)
    Rule Message
    1048 - AddedXmsEnum The new version adds a x-ms-enum extension.
    New: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L4989:9
    Old: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L4989:9
    ️️✔️Breaking Change(Cross-Version) succeeded [Detail] [Expand]
    There are no breaking changes.
    ️️✔️CredScan succeeded [Detail] [Expand]
    There is no credential detected.
    ️⚠️LintDiff: 0 Warnings warning [Detail]
    compared tags (via openapi-validator v2.1.4) new version base version
    package-2023-05 package-2023-05(078a5e2) package-2023-05(main)

    The following errors/warnings exist before current PR submission:

    Rule Message
    ParametersOrder The parameters:operationId,location should be kept in the same order as they present in the path.
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L64
    MissingTypeObject The schema 'AzureBackupFindRestorableTimeRangesRequestResource' is considered an object but without a 'type:object', please add the missing 'type:object'.
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L3942
    MissingTypeObject The schema 'AzureBackupFindRestorableTimeRangesResponseResource' is considered an object but without a 'type:object', please add the missing 'type:object'.
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L3973
    MissingTypeObject The schema 'AzureBackupRecoveryPointResource' is considered an object but without a 'type:object', please add the missing 'type:object'.
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L4239
    MissingTypeObject The schema 'BackupInstanceResource' is considered an object but without a 'type:object', please add the missing 'type:object'.
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L4682
    MissingTypeObject The schema 'BackupVaultResource' is considered an object but without a 'type:object', please add the missing 'type:object'.
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L4870
    MissingTypeObject The schema 'BaseBackupPolicyResource' is considered an object but without a 'type:object', please add the missing 'type:object'.
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L4930
    MissingTypeObject The schema 'CloudError' is considered an object but without a 'type:object', please add the missing 'type:object'.
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L5152
    MissingTypeObject The schema 'Error' is considered an object but without a 'type:object', please add the missing 'type:object'.
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L5786
    MissingTypeObject The schema 'ErrorAdditionalInfo' is considered an object but without a 'type:object', please add the missing 'type:object'.
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L5824
    MissingTypeObject The schema 'additionalDetails' is considered an object but without a 'type:object', please add the missing 'type:object'.
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L6090
    MissingTypeObject The schema 'additionalDetails' is considered an object but without a 'type:object', please add the missing 'type:object'.
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L6138
    ⚠️ DeprecatedXmsCodeGenerationSetting The x-ms-code-generation-setting extension is being deprecated. Please remove it and move settings to readme file for code generation.
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L6
    ⚠️ UniqueXmsExample Do not have duplicate name of x-ms-example, make sure every x-ms-example name unique. Duplicate x-ms-example: Get OperationStatus
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L228
    ⚠️ UniqueXmsExample Do not have duplicate name of x-ms-example, make sure every x-ms-example name unique. Duplicate x-ms-example: Get OperationStatus
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L276
    ⚠️ PostOperationIdContainsUrlVerb OperationId should contain the verb: 'validaterestore' in:'BackupInstances_ValidateForRestore'. Consider updating the operationId
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L2030
    ⚠️ PostOperationIdContainsUrlVerb OperationId should contain the verb: 'findrestorabletimeranges' in:'RestorableTimeRanges_Find'. Consider updating the operationId
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L2156
    ⚠️ PostOperationIdContainsUrlVerb OperationId should contain the verb: 'exportbackupjobs' in:'ExportJobs_Trigger'. Consider updating the operationId
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L2265
    ⚠️ UniqueXmsExample Do not have duplicate name of x-ms-example, make sure every x-ms-example name unique. Duplicate x-ms-example: List OperationsRequestObject
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L2927
    ⚠️ UniqueXmsExample Do not have duplicate name of x-ms-example, make sure every x-ms-example name unique. Duplicate x-ms-example: List OperationsRequestObject
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L2979
    ⚠️ UniqueXmsExample Do not have duplicate name of x-ms-example, make sure every x-ms-example name unique. Duplicate x-ms-example: List OperationsRequestObject
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L3031
    ⚠️ UniqueXmsExample Do not have duplicate name of x-ms-example, make sure every x-ms-example name unique. Duplicate x-ms-example: List OperationsRequestObject
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L3083
    ⚠️ UniqueXmsExample Do not have duplicate name of x-ms-example, make sure every x-ms-example name unique. Duplicate x-ms-example: List OperationsRequestObject
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L3135
    ⚠️ UniqueXmsExample Do not have duplicate name of x-ms-example, make sure every x-ms-example name unique. Duplicate x-ms-example: Get DefaultOperationsRequestObject
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L3245
    ⚠️ UniqueXmsExample Do not have duplicate name of x-ms-example, make sure every x-ms-example name unique. Duplicate x-ms-example: Get DefaultOperationsRequestObject
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L3300
    ⚠️ UniqueXmsExample Do not have duplicate name of x-ms-example, make sure every x-ms-example name unique. Duplicate x-ms-example: Get DefaultOperationsRequestObject
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L3355
    ⚠️ UniqueXmsExample Do not have duplicate name of x-ms-example, make sure every x-ms-example name unique. Duplicate x-ms-example: Get DefaultOperationsRequestObject
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L3410
    ⚠️ UniqueXmsExample Do not have duplicate name of x-ms-example, make sure every x-ms-example name unique. Duplicate x-ms-example: Get DefaultOperationsRequestObject
    Location: Microsoft.DataProtection/stable/2023-05-01/dataprotection.json#L3465
    ️️✔️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 Aug 3, 2023

    Swagger Generation Artifacts

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

    Breaking Changes Tracking

    azure-sdk-for-go - sdk/resourcemanager/dataprotection/armdataprotection - Approved - 3.0.0
    +	Type of `BaseResourceProperties.ObjectType` has been changed from `*string` to `*ResourcePropertiesObjectType`

    azure-sdk-for-js - @azure/arm-dataprotection - Approved - 2.0.0
    -	Class DataProtectionClient has a new signature
    +	Type of parameter objectType of interface BaseResourceProperties is changed from "BaseResourceProperties" to "DefaultResourceProperties"
    +	Type of parameter resourceProperties of interface Datasource is changed from BaseResourceProperties to BaseResourcePropertiesUnion
    +	Type of parameter resourceProperties of interface DatasourceSet is changed from BaseResourceProperties to BaseResourcePropertiesUnion
    ️️✔️ azure-sdk-for-net-track2 succeeded [Detail] [Expand]
    ️⚠️ azure-sdk-for-python-track2 warning [Detail]
    • ⚠️Warning [Logs]Release - Generate from c4224d4. 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] notice
      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 npm@9.8.1` to update!
      cmderr	[automation_generate.sh] npm notice
    • ️✔️track2_azure-mgmt-dataprotection [View full logs]  [Release SDK Changes]
      info	[Changelog] ### Features Added
      info	[Changelog]
      info	[Changelog]   - Added model DefaultResourceProperties
      info	[Changelog]   - Added model ResourcePropertiesObjectType
    ️⚠️ azure-sdk-for-java warning [Detail]
    • ⚠️Warning [Logs]Release - Generate from c4224d4. 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
      command	./eng/mgmt/automation/generate.py ../azure-sdk-for-java_tmp/generateInput.json ../azure-sdk-for-java_tmp/generateOutput.json
    • ️✔️azure-resourcemanager-dataprotection [View full logs]  [Release SDK Changes]
    ️️✔️ azure-sdk-for-go succeeded [Detail] [Expand]
    • ️✔️Succeeded [Logs]Release - Generate from c4224d4. 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/dataprotection/armdataprotection [View full logs]  [Release SDK Changes] Breaking Change Detected
      info	[Changelog] ### Breaking Changes
      info	[Changelog]
      info	[Changelog] - Type of `BaseResourceProperties.ObjectType` has been changed from `*string` to `*ResourcePropertiesObjectType`
      info	[Changelog]
      info	[Changelog] ### Features Added
      info	[Changelog]
      info	[Changelog] - New enum type `ResourcePropertiesObjectType` with values `ResourcePropertiesObjectTypeDefaultResourceProperties`
      info	[Changelog] - New function `*DefaultResourceProperties.GetBaseResourceProperties() *BaseResourceProperties`
      info	[Changelog] - New struct `DefaultResourceProperties`
      info	[Changelog]
      info	[Changelog] Total 1 breaking change(s), 5 additive change(s).
    ️️✔️ azure-sdk-for-js succeeded [Detail] [Expand]
    • ️✔️Succeeded [Logs]Release - Generate from c4224d4. 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
    • ️✔️@azure/arm-dataprotection [View full logs]  [Release SDK Changes] Breaking Change Detected
      info	[Changelog] **Features**
      info	[Changelog]
      info	[Changelog]   - Added Interface DefaultResourceProperties
      info	[Changelog]   - Added Type Alias BaseResourcePropertiesUnion
      info	[Changelog]   - Added Type Alias ResourcePropertiesObjectType
      info	[Changelog]   - Added Enum KnownResourcePropertiesObjectType
      info	[Changelog]
      info	[Changelog] **Breaking Changes**
      info	[Changelog]
      info	[Changelog]   - Type of parameter objectType of interface BaseResourceProperties is changed from "BaseResourceProperties" to "DefaultResourceProperties"
      info	[Changelog]   - Type of parameter resourceProperties of interface Datasource is changed from BaseResourceProperties to BaseResourcePropertiesUnion
      info	[Changelog]   - Type of parameter resourceProperties of interface DatasourceSet is changed from BaseResourceProperties to BaseResourcePropertiesUnion
    ️❌ azure-powershell failed [Detail]
    • Pipeline Framework Failed [Logs]Release - Generate from c4224d4. 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.dataprotection.DefaultTag [View full logs
      error	Fatal error: SSL error: syscall failure: Broken pipe
      error	The following packages are still pending:
      error		Az.dataprotection.DefaultTag
    Posted by Swagger Pipeline | How to fix these errors?

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Aug 3, 2023

    Generated ApiView

    Language Package Name ApiView Link
    Go sdk/resourcemanager/dataprotection/armdataprotection https://apiview.dev/Assemblies/Review/46a18f89972c4840a19d84e8022cc348
    .Net Azure.ResourceManager.DataProtectionBackup There is no API change compared with the previous version
    Java azure-resourcemanager-dataprotection https://apiview.dev/Assemblies/Review/fce38ad4b98a44abb1fa170c63343e3f
    JavaScript @azure/arm-dataprotection https://apiview.dev/Assemblies/Review/8d41a0cd4cea4f52be5d61cca8f08904

    @AzureRestAPISpecReview AzureRestAPISpecReview added ARMChangesRequested <valid label in PR review process>add this label when require changes after ARM review ARMReview BreakingChangeReviewRequired <valid label in PR review process>add this label when breaking change review is required ReadyForApiTest <valid label in PR review process>add this label when swagger and service APIs are ready for test resource-manager labels Aug 3, 2023
    @openapi-workflow-bot
    Copy link

    Please address or respond to feedback from the ARM API reviewer.
    When you are ready to continue the ARM API review, please remove the ARMChangesRequested label.
    This will notify the reviewer to have another look.
    If the feedback provided needs further discussion, please use this Teams channel to post your questions - aka.ms/azsdk/support/specreview-channel.
    Please include [ARM Query] in the title of your question to indicate that it is ARM-related.

    @openapi-workflow-bot
    Copy link

    Hi @chandrasekarendran! The automation detected breaking changes in this pull request. As a result, it added the BreakingChangeReviewRequired label.

    You cannot proceed with merging this PR until you complete one of the following action items:

    ACTION ITEM ALTERNATIVE A: Fix the breaking change.
    Please consult the documentation provided in the relevant validation failures.

    ACTION ITEM ALTERNATIVE B: Request approval.
    Alternatively, if you cannot fix the breaking changes, then you can request an approval for them. Please follow the breaking changes process.
    This case applies even if:

    • The tool fails while it shouldn't, e.g. due to runtime exception, or incorrect detection of breaking changes.
    • You believe there is no need for you to request breaking change approval, for any reason. Such claims must be reviewed, and the process is the same.

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Aug 18, 2023

    Next Steps to Merge

    ⚠️ This is an experimental comment. It may not always be up-to-date. ⚠️

    ✔️ All automated merging requirements have been met! Refer to step 4 in the PR workflow diagram (even if your PR is for data plane, not ARM).

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Aug 21, 2023

    Automatic PR validation restarted. This comment will be populated with next steps to merge this PR once validation is completed. Please wait ⌛.

    @mikekistler mikekistler added the Approved-BreakingChange DO NOT USE! OBSOLETE label. See https://github.com/Azure/azure-sdk-tools/issues/6374 label Aug 21, 2023
    @chandrasekarendran chandrasekarendran changed the title Removing discriminator as derived classes for BaseResourceProperties … Fixing BaseResourceProperties having discriminator but no derived object Aug 21, 2023
    @chandrasekarendran chandrasekarendran removed the ARMChangesRequested <valid label in PR review process>add this label when require changes after ARM review label Aug 21, 2023
    @openapi-workflow-bot openapi-workflow-bot bot added the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Aug 21, 2023
    @ms-henglu ms-henglu added the ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review label Aug 22, 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 Aug 22, 2023
    @kazrael2119
    Copy link
    Contributor

    this js breaking is caused by this pr

    @Alancere Alancere added the Approved-SdkBreakingChange-Go Approve the breaking change tracking for azure-sdk-for-go label Aug 23, 2023
    @chandrasekarendran
    Copy link
    Contributor Author

    /pr RequestMerge

    @ms-henglu
    Copy link
    Member

    /azp run

    @openapi-pipeline-app
    Copy link

    Automatic PR validation started. This comment will be populated with next steps to merge this PR once validation is completed. Please wait ⌛.

    @azure-pipelines
    Copy link

    Azure Pipelines successfully started running 2 pipeline(s).

    @ms-henglu ms-henglu merged commit c4224d4 into Azure:main Aug 23, 2023
    29 of 30 checks passed
    @openapi-pipeline-app
    Copy link

    Swagger pipeline restarted successfully, please wait for status update in this comment.

    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-SdkBreakingChange-Go Approve the breaking change tracking for azure-sdk-for-go Approved-SdkBreakingChange-JavaScript 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 CI-BreakingChange-Go CI-BreakingChange-JavaScript ReadyForApiTest <valid label in PR review process>add this label when swagger and service APIs are ready for test resource-manager
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    8 participants