Skip to content

ci(notifications): collapse commit bodies in Telegram messages - #1019

Merged
T3ST3ST3R0N merged 1 commit into
devfrom
ci/telegram-notify-expandable
Oct 12, 2026
Merged

T3ST3ST3R0N merged 1 commit into
devfrom
ci/telegram-notify-expandable

Conversation

@T3ST3ST3R0N

Copy link
Copy Markdown
Collaborator

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 without Co-authored-by/Signed-off-by trailers.

🔔 New Push to dev
👤 By: someone
🔗 View Commits

Commits (1):
• fix(admin): apply role disconnect policy changes to existing node users (#1008) (3b70959)
┃ * fix(admin): synchronize users when role disconnect policies change   <- collapsed, tap to expand
┃ ...

Details

  • Length: at most 10 commits are listed, then "…and N more". Their details share a length budget that keeps the message under Telegram's 4096 character limit, so no commit is cut in the middle.
  • Escaping: commit text is escaped in jq for &, < and > only. jq's @html emits &apos;, which Telegram does not accept.
  • Closed PRs now say whether they were merged.
  • Header: shows the commit count.
  • Unchanged: the read-only token, link previews (still off), and the targets parsing.

Testing

I extracted the run: script and ran it with jq 1.7.1 (the ubuntu-latest version). A stub curl returned 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:

All passed. The longest message was about 3500 characters.

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 &apos;, which Telegram does not accept. Closed
PRs now say whether they were merged, and the commit count is shown.
@coderabbitai

coderabbitai Bot commented Oct 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e30f227c-7c0d-4072-bda4-ad4d1592f23a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@T3ST3ST3R0N
T3ST3ST3R0N merged commit 3938936 into dev Oct 12, 2026
7 checks passed
@T3ST3ST3R0N
T3ST3ST3R0N deleted the ci/telegram-notify-expandable branch October 12, 2026 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant