Apache infrastructure

Clone this repo:


  1. d9ccc6c Merge pull request #1 from chrisdutz/feature/customized-subject-lines by Daniel Gruno · 3 weeks ago main
  2. a3e1a62 feature: Changed the "catchall" to "catchall_discussion" as the variables don't match by christoferdutz · 4 weeks ago
  3. 75ff9f6 Create .asf.yaml by Daniel Gruno · 5 weeks ago
  4. a6f0a86 feature: Restored the original paths... by christoferdutz · 5 weeks ago
  5. 6f8c9eb feature: Tested the solution and fixed some issues I found. by christoferdutz · 6 weeks ago

GitHub Discussion Notifier Platform for ASF Infrastructure

This service picks up on GitHub Discussions payloads (sent via webhooks) and distributes to pubsub and (if configured) mailing lists at the ASF. It is designed as a PipService but can be run manually using pipenv or python3.

All activity is relayed through PyPubSub at pubsub.apache.org, and to the appropriate mailing lists if such have been set up via .asf.yaml.

To enable notifications for a repository, the notifications directive in .asf.yaml should be appended with a discussions target, like so:

  commits: commits@foo.apache.org
  discussions: issues@foo.apache.org

    new_discussion: "Created: Discussion {repository}: {title}"
    edit_discussion: "Edited: Discussion {repository}: {title}"
    close_discussion: "Closed: Discussion {repository}: {title}"
    close_discussion_with_comment: "Closed: Discussion with comment {repository}: {title}"
    reopen_discussion: "Reopened: Discussion {repository}: {title}"
    new_comment_discussion: "Commented: Discussion {repository}: {title}"
    edit_comment_discussion: "Edited a comment: Discussion {repository}: {title}"
    delete_comment_discussion: "Deleted a comment: Discussion {repository}: {title}"

Possible Actions

The different actions I identified and how to detect them:

  • Discussion Created:
    • Action: “created”
    • No “comment” element
  • Discussion Edited:
    • Action: “edited”
    • No “comment” element
  • Discussion Closed without comment:
    • Action: “closed”
    • No “comment” element
  • Discussion Closed with comment:
    • Action: “created”
    • Existing “comment” element
    • Discussion/State: “closed”
  • Comment Added:
    • Action: “created”
    • Existing “comment” element
    • Discussion/State: “open”
  • Comment Edited:
    • Action: “edited”
    • Existing “comment” element
    • Discussion/State: “open”
  • Comment Deleted:
    • Action: “deleted”
    • Existing “comment” element
    • Discussion/State: “open”

NOTE: Problem is, that it seems impossible to distinguish between someone adding a comment to a closed discussion and someone closing a discussion with a comment. For simplicity reasons, we'll assume that if a comment is added and the discussion state is “closed”, that this is someone closing a discussion with a comment.