Skip to content

feat(telegram): centralize message format in telegram-notify.yml - #33

Merged
domengabrovsek merged 1 commit into
mainfrom
feat/standardize-telegram-format
Aug 1, 2026
Merged

feat(telegram): centralize message format in telegram-notify.yml#33
domengabrovsek merged 1 commit into
mainfrom
feat/standardize-telegram-format

Conversation

@domengabrovsek

Copy link
Copy Markdown
Owner

Summary

  • Add telegram-notify.yml, the single formatter that owns all Telegram message layout: emoji, labels, field order, spacing, 300-char body truncation, and the derived Repository line
  • Callers pass structured data through typed inputs and select layout with a required event_type; there is no free-form message input, so every notification renders one format
  • Vocabulary covers both families: PR/CI events and deploy_* / terraform_* / drift
  • Migrate the 9 PR/CI handlers to call the formatter; pr-commented, pr-review-comment, pr-review, and ci-status drop their github-script jobs entirely (truncation and state-to-emoji mapping moved into the formatter)
  • Existing PR/CI messages render byte-for-byte identical (verified against the old handler output)

Why self-contained

The formatter both formats and sends. GitHub caps nested reusable workflows at 4 levels, and the chain is already consumer -> notify.yml -> handler -> telegram-notify.yml. Delegating the send to a further workflow would be a fifth level and fail to run. Rationale recorded in docs/adr/0001-central-telegram-message-formatter.md.

Docs

  • Document the formatter and the deploy/terraform events in the README
  • Drop the phantom pr-labeled entries (no such workflow exists) and align the Telegram examples to @main

Rollout

This is phase 1 of 3. send-telegram-message.yml stays in place so its 5 external callers keep working. Phases 2 (migrate those repos onto the formatter) and 3 (delete the raw sender) follow.

Verification

  • actionlint clean across all workflows (includes shellcheck on the send step)
  • Formatter logic regression-tested against the original message formats for every PR/CI event

Add a single formatter workflow that owns all Telegram message layout -
emoji, labels, field order, spacing, 300-char body truncation, and the
derived Repository line. Callers pass structured data through typed inputs
and select layout with a required event_type; they never supply a message
body. Vocabulary covers PR/CI events plus deploy/terraform/drift so the
whole estate renders one format.

Migrate the 9 PR/CI handlers to call it. pr-commented, pr-review-comment,
pr-review, and ci-status drop their github-script jobs entirely, since
truncation and state-to-emoji mapping now live in the formatter. Existing
messages render byte-for-byte identical.

Self-contained (formats and sends) because GitHub caps nested reusable
workflows at 4 levels and the chain is already
consumer -> notify -> handler -> here.

Document the formatter and deploy/terraform events in the README; drop the
phantom pr-labeled entries and align examples to @main. Record the decision
in docs/adr/0001.

send-telegram-message.yml stays for now; its external callers migrate before
it is removed.
@domengabrovsek
domengabrovsek merged commit d768a80 into main Aug 1, 2026
10 checks passed
@domengabrovsek
domengabrovsek deleted the feat/standardize-telegram-format branch August 1, 2026 12:12
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