Truncate long field values in messages going to Discord.

Review Request #13871 — Created May 20, 2024 and submitted — Latest diff uploaded

Information

rbintegrations
release-4.x

Reviewers

Discord's Slack-compatible WebHook endpoint has a limitation that Slack
does not. If a field value is over 1024 characters, Discord will refuse
to post the message, responding with a very unhelpful error payload.

Through some trial and error, it appears that they limit the length of
any field value to 1024 characters.

BaseChatIntegration will now pass any field value text through
format_field_text(), which is normally a no-op. In the case of
Discord, the text is truncated and ellipsized if over 1024 bytes.

This should fix posting updates with long descriptions.

Unit tests passed.

Ran some simulations with known failing review requests, and
successfully posted them to Discord.

Commits

Files