Skip to content

2913 - Truncates Teams messages and notifies - #246

Open
steves-mobilise wants to merge 1 commit into
masterfrom
2913-truncate-teams-message
Open

2913 - Truncates Teams messages and notifies#246
steves-mobilise wants to merge 1 commit into
masterfrom
2913-truncate-teams-message

Conversation

@steves-mobilise

Copy link
Copy Markdown
Collaborator

Context

For several Power Automate Flows there's a selection of failed runs due to size of messages being sent (they are sending the whole of the linting output).

The central action should handle this gracefully by truncating and warning about truncation.

Example of a workflow that failed when sending large messages: linting workflow

Changes proposed in this pull request

New Truncate oversized message step added to send-to-teams-channel action. This checks the message size is below 81920 bytes (80kb), which is less than the 100kb limit Microsoft impose upon Teams messages, with headroom for formatting etc. causing size increases.

If the message is <= this limit it is sent through in its entirety. However, if it exceeds this limit it is truncated and a warning is added to the Teams message which contains a link to the workflow run for further information.

Guidance to review

  • A testing branch has been set up that sets the limit to 1000 bytes so it can be easier hit.
  • A workflow has been created in that branch (code here) that sends a plain text list of X's that exceed this 1000 byte limit.
  • Simply pull that branch, add an X to the string and push it back - it will trigger the workflow on push.
  • Then check the Webhook test channel in Teams to see the truncated message with warning.

I have ran a successful test here. You will see the new functionality in action within the Truncate oversized message step.

Trello Card

Trello card

Checklist

  • I have performed a self-review of my code, including formatting and typos
  • I have cleaned the commit history
  • I have added the Devops label
  • I have attached the pull request to the trello card

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants