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

[Communication][Chat] Added new attachment type of "file" #23662

Merged
merged 14 commits into from
May 30, 2023

Conversation

jpeng-ms
Copy link
Member

@jpeng-ms jpeng-ms commented Apr 20, 2023

Data Plane API - Pull Request

  1. I have previously discussed this with @DominikMe and he told me we can overwrite the build failures. Also the APIs in 2023-07-01 have not been implemented not deployed, so adding this new enum won't affect any Contoso user.

  2. Only change introduced in this API was to expand AttachmentType to include a new enums type of file and teamsImage:

  3. example payload from chat gateway:

{
  "value": [
    {
      "id": "123456789",
      "type": "html",
      "sequenceId": "string",
      "version": "string",
      "content": {
        "message": "<p>Come one guys, lets go for lunch together.</p><img id=\"A27C7079-626F-4D23-8BEE-582F2C376B5A\">",
        "topic": "Lunch Chat thread",
        "attachments": [
          {
            "id": "A27C7079-626F-4D23-8BEE-582F2C376B5A",
            "attachmentType": "teamsInlineImage",
            "contentType": "png",
            "name": "SomeImage.png",
            "url": "https://{geoChatGW}/threads/{chatThreadId}/messages/{chatMessageId}/teamsInterop/images/{imageId}/views/original",
            "previewUrl": "https://{geoChatGW}/threads/{chatThreadId}/messages/{chatMessageId}/teamsInterop/images/{imageId}/views/small"
          },
          {
            "id": "R47C7079-626F-4D23-8BEE-582F2CSADFEF",
            "attachmentType": "file",
            "contentType": "txt",
            "name": "document.txt",
            "url": "https://example.sharepoint.com/gYVRbks8GlpVRbk-PoBs8GlpgYVRbk"
          },
          {
            "id": "A27C7079-626F-4D23-8BEE-582F2C376B5A",
            "attachmentType": "teamsImage",
            "contentType": "png",
            "name": "SomeImage.png",
            "url": "https://{geoChatGW}/threads/{chatThreadId}/messages/{chatMessageId}/teamsInterop/images/{imageId}/views/original",
            "previewUrl": "https://{geoChatGW}/threads/{chatThreadId}/messages/{chatMessageId}/teamsInterop/images/{imageId}/views/small"
          }
        ],
        ...
}

API Info: The Basics

Most of the information about your service should be captured in the issue that serves as your API Spec engagement record.

  • Link to API Spec engagement record issue:

Is this review for (select one):

  • a private preview
  • a public preview
  • GA release

Change Scope

adding a new enum type "file"

  • Design Document:
  • Previous API Spec Doc:
  • Updated paths:

❔Got questions? Need additional info?? We are here to help!

Contact us!

The Azure API Review Board is dedicated to helping you create amazing APIs. You can read about our mission and learn more about our process on our wiki.

Click here for links to tools, specs, guidelines & other good stuff

Tooling

Guidelines & Specifications

Helpful Links

@openapi-workflow-bot
Copy link

Hi, @jpeng-ms 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 Apr 20, 2023

    Swagger Validation Report

    ️❌BreakingChange: 2 Errors, 0 Warnings failed [Detail]
    compared swaggers (via Oad v0.10.4)] new version base version
    communicationserviceschat.json 2023-07-01-preview(8c1f4f4) 2023-07-01-preview(main)
    Rule Message
    1020 - AddedEnumValue The new version is adding enum value(s) 'teamsImage, file' from the old version.
    New: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L1388:9
    Old: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L1385:9
    1020 - AddedEnumValue The new version is adding enum value(s) 'teamsImage, file' from the old version.
    New: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L1361:5
    Old: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L1360:5
    ️️✔️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.0.0) new version base version
    package-chat-2023-07-01-preview package-chat-2023-07-01-preview(8c1f4f4) package-chat-2023-07-01-preview(main)

    The following errors/warnings exist before current PR submission:

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

    Rule Message
    OperationIdNounVerb Per the Noun_Verb convention for Operation Ids, the noun 'Chat' should not appear after the underscore. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L781
    OperationIdNounVerb Per the Noun_Verb convention for Operation Ids, the noun 'Chat' should not appear after the underscore. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L858
    OperationIdNounVerb Per the Noun_Verb convention for Operation Ids, the noun 'ChatThread' should not appear after the underscore. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L934
    OperationIdNounVerb Per the Noun_Verb convention for Operation Ids, the noun 'ChatThread' should not appear after the underscore. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L1006
    OperationIdNounVerb Per the Noun_Verb convention for Operation Ids, the noun 'Chat' should not appear after the underscore. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L1069
    HostParametersValidation The host parameter must be typed 'type 'string', format 'url''.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L1847
    ⚠️ PathParameterSchema Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L20
    ⚠️ DefaultResponse Operation is missing a default response.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L45
    ⚠️ ErrorResponse Error response should contain a x-ms-error-code header.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L52
    ⚠️ ErrorResponse Error response should contain a x-ms-error-code header.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L59
    ⚠️ ErrorResponse Error response should contain a x-ms-error-code header.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L66
    ⚠️ ErrorResponse Error response should contain a x-ms-error-code header.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L73
    ⚠️ PathParameterSchema Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L104
    ⚠️ DefaultResponse Operation is missing a default response.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L124
    ⚠️ SuccessResponseBody All success responses except 202 & 204 should define a response body.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L125
    ⚠️ ErrorResponse Error response should contain a x-ms-error-code header.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L128
    ⚠️ ErrorResponse Error response should contain a x-ms-error-code header.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L135
    ⚠️ ErrorResponse Error response should contain a x-ms-error-code header.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L142
    ⚠️ ErrorResponse Error response should contain a x-ms-error-code header.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L149
    ⚠️ PathParameterSchema Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L178
    ⚠️ DefaultResponse Operation is missing a default response.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L198
    ⚠️ Post201Response Using post for a create operation is discouraged.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L199
    ⚠️ ErrorResponse Error response should contain a x-ms-error-code header.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L205
    ⚠️ ErrorResponse Error response should contain a x-ms-error-code header.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L212
    ⚠️ ErrorResponse Error response should contain a x-ms-error-code header.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L219
    ⚠️ ErrorResponse Error response should contain a x-ms-error-code header.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L226
    ⚠️ PathParameterSchema Path parameter should specify a maximum length (maxLength) and characters allowed (pattern).
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L250
    ⚠️ DefaultResponse Operation is missing a default response.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L275
    ⚠️ ErrorResponse Error response should contain a x-ms-error-code header.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L282
    ⚠️ ErrorResponse Error response should contain a x-ms-error-code header.
    Location: Chat/preview/2023-07-01-preview/communicationserviceschat.json#L289
    ️️✔️Avocado succeeded [Detail] [Expand]
    Validation passes for Avocado.
    ️️✔️ApiReadinessCheck succeeded [Detail] [Expand]
    ️⚠️~[Staging] ServiceAPIReadinessTest: 0 Warnings warning [Detail]

    API Test is not triggered due to precheck failure. Check pipeline log for details.

    ️️✔️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.
    ️️✔️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).
    ️️✔️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 Apr 20, 2023

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

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Apr 20, 2023

    Generated ApiView

    Language Package Name ApiView Link
    Swagger communication-data-plane-Chat https://apiview.dev/Assemblies/Review/775e85bf2dbd42668f92a547eac064fa

    @jpeng-ms jpeng-ms marked this pull request as ready for review April 26, 2023 17:48
    @jpeng-ms jpeng-ms requested a review from a team as a code owner April 26, 2023 17:48
    @jpeng-ms jpeng-ms requested review from vicancy and scgbear and removed request for a team April 26, 2023 17:48
    @jpeng-ms jpeng-ms changed the title [Communication][Chat] Added new enum type of "TeamsFile" [Communication][Chat] Added new attachment type of "file" Apr 26, 2023
    @jpeng-ms jpeng-ms added the Communication Services Azure Communication Service label Apr 27, 2023
    @jpeng-ms
    Copy link
    Member Author

    @JeffreyRichter @DominikMe we are introducing a new enum type to "attachment" with no other changes. So I was wondering if we could review this async without a meeting? Please let me know if you need any more information about this change. Thanks!

    @JeffreyRichter JeffreyRichter added the Approved-BreakingChange DO NOT USE! OBSOLETE label. See https://github.com/Azure/azure-sdk-tools/issues/6374 label Apr 27, 2023
    @ghost
    Copy link

    ghost commented May 21, 2023

    Hi, @jpeng-ms. Your PR has no update for 14 days and it is marked as stale PR. If no further update for over 14 days, the bot will close the PR. If you want to refresh the PR, please remove no-recent-activity label.

    @jhendrixMSFT jhendrixMSFT merged commit ed5ff62 into main May 30, 2023
    @jhendrixMSFT jhendrixMSFT deleted the jpeng/file-sharing-poc branch May 30, 2023 21:38
    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 Communication Services Azure Communication Service data-plane
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    5 participants