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

Add stable version of common model swagger for Azure Communication Services #12799

Merged
merged 4 commits into from
Feb 5, 2021

Conversation

DominikMe
Copy link
Member

@DominikMe DominikMe commented Feb 3, 2021

This common.json contains common model definitions for Errors and Identifiers (i.e. participants in communications) that will then be referenced by other Azure Communication Services, such as the Chat service.

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

Changelog

Please ensure to add changelog with 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 you are targeting to deploy new service/feature to public regions? Please provide date, or month to public if date is not available yet.
  3. When you expect to publish swagger? Please provide date, or month to public if date is not available yet.
  4. If it's an update to existing version, please select SDKs of specific language and CLIs that require refresh after swagger is published.
    • SDK of .NET (need service team to ensure code readiness)
    • SDK of Python
    • SDK of Java
    • SDK of Js
    • SDK of Go
    • PowerShell
    • CLI
    • Terraform
    • No, no need to refresh for updates in this PR

Contribution checklist:

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

ARM API Review Checklist

  • Ensure to check this box if one of the following scenarios meet updates in the PR, so that label “WaitForARMFeedback” will be added automatically to involve ARM API Review. Failure to comply may result in delays for manifest application. Note this does not apply to data plane APIs, all “removals” and “adding a new property” no more require ARM API review.

    • Adding new API(s)
    • Adding a new API version
    • Adding a new service
  • Please 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 there are following updates in the PR, ensure to request an approval from API Review Board as defined in the Breaking Change Policy.

  • Removing API(s) in stable version
  • Removing properties in stable version
  • Removing API version(s) in stable version
  • Updating API in stable version with Breaking Change Validation errors
  • Updating API(s) in preview over 1 year

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.

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

@openapi-workflow-bot
Copy link

Hi, @DominikMe 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 Feb 3, 2021

    Swagger Validation Report

    ️❌BreakingChange: 1 Errors, 0 Warnings failed [Detail]

    Rule Message
    1033 - RemovedProperty The new version is missing a property found in the old version. Was 'innerError' renamed or removed?
    New: Microsoft.CommunicationServicesCommon/stable/2021-03-07/common.json#L30:7
    Old: Microsoft.CommunicationServicesIdentity/stable/2021-03-07/CommunicationIdentity.json#L223:7
    ️️✔️LintDiff succeeded [Detail] [Expand]
    Validation passes for LintDiff.

    ️️✔️Avocado succeeded [Detail] [Expand]
    Validation passes for Avocado.
    ️️✔️ModelValidation succeeded [Detail] [Expand]
    Validation passes for ModelValidation.
    ️️✔️SemanticValidation succeeded [Detail] [Expand]
    Validation passes for SemanticValidation.
    ️⚠️[Staging] Cross Version BreakingChange (Base on preview version): 8 Warnings warning [Detail]

    Rule Message
    ⚠️ 1026 - TypeChanged The new version has a different type 'object' than the previous one 'string'.
    New: Microsoft.CommunicationServicesCommon/stable/2021-03-07/common.json#L85:9
    Old: Microsoft.CommunicationServicesCommon/preview/2020-11-19-preview1/common.json#L104:9
    ⚠️ 1033 - RemovedProperty The new version is missing a property found in the old version. Was 'kind' renamed or removed?
    New: Microsoft.CommunicationServicesCommon/stable/2021-03-07/common.json#L76:7
    Old: Microsoft.CommunicationServicesCommon/preview/2020-11-19-preview1/common.json#L95:7
    ⚠️ 1033 - RemovedProperty The new version is missing a property found in the old version. Was 'id' renamed or removed?
    New: Microsoft.CommunicationServicesCommon/stable/2021-03-07/common.json#L76:7
    Old: Microsoft.CommunicationServicesCommon/preview/2020-11-19-preview1/common.json#L95:7
    ⚠️ 1033 - RemovedProperty The new version is missing a property found in the old version. Was 'microsoftTeamsUserId' renamed or removed?
    New: Microsoft.CommunicationServicesCommon/stable/2021-03-07/common.json#L76:7
    Old: Microsoft.CommunicationServicesCommon/preview/2020-11-19-preview1/common.json#L95:7
    ⚠️ 1033 - RemovedProperty The new version is missing a property found in the old version. Was 'isAnonymous' renamed or removed?
    New: Microsoft.CommunicationServicesCommon/stable/2021-03-07/common.json#L76:7
    Old: Microsoft.CommunicationServicesCommon/preview/2020-11-19-preview1/common.json#L95:7
    ⚠️ 1033 - RemovedProperty The new version is missing a property found in the old version. Was 'cloud' renamed or removed?
    New: Microsoft.CommunicationServicesCommon/stable/2021-03-07/common.json#L76:7
    Old: Microsoft.CommunicationServicesCommon/preview/2020-11-19-preview1/common.json#L95:7
    ⚠️ 1034 - AddedRequiredProperty The new version has new required property 'value' that was not found in the old version.
    New: Microsoft.CommunicationServicesCommon/stable/2021-03-07/common.json#L114:7
    ⚠️ 1034 - AddedRequiredProperty The new version has new required property 'value' that was not found in the old version.
    New: Microsoft.CommunicationServicesCommon/stable/2021-03-07/common.json#L85:9
    Old: Microsoft.CommunicationServicesCommon/preview/2020-11-19-preview1/common.json#L104:9
    ️️✔️[Staging] Cross Version BreakingChange (Base on stable version) succeeded [Detail] [Expand]
    There are no breaking changes.
    ️️✔️CredScan succeeded [Detail] [Expand]
    There is no credential detected.
    ️🔄[Staging] SDK Track2 Validation inProgress [Detail]
    Posted by Swagger Pipeline | How to fix these errors?

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Feb 3, 2021

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

    @openapi-workflow-bot
    Copy link

    Hi @DominikMe, Your PR has some issues. Please fix the CI sequentially by following the order of Avocado, semantic validation, model validation, breaking change, lintDiff.

    TaskHow to fixPrioritySupport (Microsoft alias)
    AvocadoFix-AvocadoHighruowan
    Semantic validationFix-SemanticValidation-ErrorHighraychen, jianyxi
    Model validationFix-ModelValidation-ErrorHighraychen,jianyxi
    LintDiffFix-LintDiffhighjianyxi, ruoxuan
    If you need further help, please feedback via swagger feedback."

    @DominikMe
    Copy link
    Member Author

    @anuchandy The duplicate model collision is for the common error shape. The CommunicationIdentity.json will eventually $ref the type in common.json but currently has the type duplicated. What's the best course of action?

    cc @alexandra142

    "modelAsString": true
    }
    },
    "CommunicationIdentifierModel": {
    Copy link
    Member

    Choose a reason for hiding this comment

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

    Would CallingApplication be brought back later?

    Copy link
    Member

    Choose a reason for hiding this comment

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

    Yes, once we support it, we should add it. We removed it for now, as it does not seem to be used in any GA service and internally we have yet to finalize which format would be mapped to applications to avoid breaking changes in the SDK code. Once they are all decided, we can add it back as a non-breaking change

    "properties": {
    "rawId": {
    "type": "string",
    "description": "Raw Id of the identifier. Optional in requests, required in responses."
    Copy link
    Member

    Choose a reason for hiding this comment

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

    assuming rawId would be required in events as well?

    Copy link
    Member

    Choose a reason for hiding this comment

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

    Yes, any outbound from Communication Services would include the rawId in the body, but developers do not need to send them in their requests

    "id"
    ],
    "properties": {
    "id": {
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Will this "id" be full MRI or will it be the inside "8:acs:<stable_resource_id>_"?

    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 the full MRI

    }
    }
    },
    "CommunicationUserIdentifierModel": {
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    The problem with eliminating explicit "kind" enum and having "optional" full objects, would result customers processing the events as :

    if (eventData.CommunicationUser != null)
    {
    }
    else if (eventData.PhoneNumber != null)
    {
    }
    else if (eventData.MicrosoftTeamsUser != null)
    {
    }
    etc.

    Not a clean switch case. Also it will be difficult distinguish between an error case(all user representation objects are null) and new user object(which can be detected by default label in a switch case).

    So would it be beneficial to include "kind" along with the specific objects?

    Copy link
    Member

    Choose a reason for hiding this comment

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

    having kind helps with deserialziation, but for preparing requests, it is redundant information. Also we were thinking other violation could happen so we need to check the properties anyways. Eg, someone could set multiple properties. We can offer serialization/deserialization in our code to help the developers. Eg: Azure/azure-sdk-for-net#18389

    Copy link
    Member

    @RezaJooyandeh RezaJooyandeh Feb 3, 2021

    Choose a reason for hiding this comment

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

    (all user representation objects are null)

    👆🏻 is a valid case, all being null is equivalent to kind: "unknown".

    @openapi-workflow-bot
    Copy link

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

    @DominikMe
    Copy link
    Member Author

    The breaking change isn't breaking.
    Identity swagger used "innerError" but according to API guidelines it should have been "innererror" with "x-ms-clientname": "innerError". No customer has been using the new identity service yet, and the new service does not return any inner errors at the moment.

    @anuchandy Can you help us getting this merged?

    @anuchandy
    Copy link
    Member

    Synced with Dominik, like he mentioned the property name "innererror" is used as per the guideline ref.

    @anuchandy
    Copy link
    Member

    anuchandy commented Feb 5, 2021

     @ johanste could you provide the approval?

    Justification:

    • None of the SDK is released.
    • The breaking change is about renaming a property from "innerError" to "innererror" (the new name follows the API guideline ref).
    • The service has not yet been picked by customers, and the innerError property is not populated at the moment.

    @johanste
    Copy link
    Member

    johanste commented Feb 5, 2021

    @JeffreyRichter, per the rationale above (effectively false positive since nothing has been shipped/published yet) I've marked this as "breaking change approved". Please remove it if you disagree....

    @johanste johanste added the Approved-BreakingChange DO NOT USE! OBSOLETE label. See https://github.com/Azure/azure-sdk-tools/issues/6374 label Feb 5, 2021
    @JeffreyRichter
    Copy link
    Member

    I agree.

    Copy link
    Member

    @anuchandy anuchandy left a comment

    Choose a reason for hiding this comment

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

    Thanks Johan and Jeferry. Merging this PR.

    @anuchandy anuchandy merged commit fed2c0c into Azure:master Feb 5, 2021
    @DominikMe DominikMe deleted the communication-common-stable branch February 5, 2021 19:46
    mkarmark pushed a commit to mkarmark/azure-rest-api-specs that referenced this pull request Jul 21, 2021
    …rvices (Azure#12799)
    
    * Add stable version of common model swagger for Azure Communication Services
    
    * address comments
    
    * fix title in readme
    
    * reference common error models in identity swagger
    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
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    9 participants