Repository navigation
ci(notifications): collapse commit bodies in Telegram messages - #1019
Merged
Merged
Conversation
Each commit was printed as its whole message flattened onto one line, so squash merges with long bodies made every notification a wall of text, and the 4096 character trim then cut the list mid-commit. List each commit as its subject with a linked short SHA, and put the rest of the message in a collapsed expandable quote, unwrapped and without Co-authored-by/Signed-off-by trailers. At most 10 commits are listed, and their details share a length budget that keeps the message under Telegram's limit. Commit text is escaped in jq for & < > only, since jq's @html emits ', which Telegram does not accept. Closed PRs now say whether they were merged, and the commit count is shown.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Telegram notifications printed every commit as its whole message flattened onto one line. Squash merges with long bodies turned each notification into a wall of text, and the 4096 character trim then cut the list mid-commit.
Each commit is now one line: its subject and a linked short SHA. The rest of the message goes in a collapsed expandable quote (
<blockquote expandable>), unwrapped and withoutCo-authored-by/Signed-off-bytrailers.Details
&,<and>only. jq's@htmlemits', which Telegram does not accept.Testing
I extracted the
run:script and ran it with jq 1.7.1 (theubuntu-latestversion). A stubcurlreturned real GitHub API data and recorded the Telegram calls. A checker then validated the tags and entities and measured each message's visible length.Cases:
<script> & "quotes", and no commitsAll passed. The longest message was about 3500 characters.