Skip to content

Add issue and PR comment notifications #6

Description

@Kingvic300

Summary

issue_comment.created is not handled. Comments on issues and PRs — often where real blockers or questions surface — currently produce no Telegram notification.

Background

The webhook subscription list in the README (setup step 5) only mentions Issues, Pull requests, Workflow runs, and Deployment statuses. src/github/webhooks.ts has no issue_comment handler at all. A question or "blocked on X" comment left on a PR is invisible until someone happens to check GitHub.

Proposed Solution

Add a webhooks.on("issue_comment.created", ...) handler. Use payload.issue.pull_request presence to distinguish "comment on a PR" from "comment on an issue" and label the notification accordingly, reusing the existing link/icon helpers in formatters.ts.

Technical Scope

  • src/github/webhooks.ts — new handler
  • src/github/formatters.ts — new formatCommentEvent
  • README.md — add "Issue comments" to the webhook subscription list
  • Tests: formatter unit test for both issue-comment and PR-comment cases

Acceptance Criteria

  • New comments on issues produce a notification distinct from comments on PRs
  • Comment body is truncated/escaped safely (reuse escapeHtml) before posting
  • Unit tests added
  • README updated
  • CI passes
  • Code follows project conventions

Edge Cases

  • Very long comment bodies — must be truncated to a reasonable preview length before posting to Telegram
  • Comments containing HTML-significant characters must be escaped (reuse src/utils/html.ts)
  • Bot-authored comments (e.g. from other automation) — consider whether to filter these out to avoid notification loops

Risks

  • Highest noise-per-event of any handler in this backlog on an active repo — should ship alongside or after issue Add issue and PR comment notifications #6 (label-based filtering) to avoid flooding the channel
  • No structural risk to existing handlers

Deliverables

  • Feature implementation
  • Unit tests
  • README update

Labels

enhancement, backend

Priority

Medium — real value, but noise risk means it should land with filtering in place.


Estimated Completion: 96 hours

Telegram: https://t.me/txioCommunity


Activity

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

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26Third CampaignCampaign: Third Campaign

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions