From 0fd706e7f41df11fc43d47e8f62c3ecb07fdd55e Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Fri, 14 Jan 2022 16:17:37 -0500 Subject: [PATCH 1/3] Add support for allRepos tag Takes a user/github-user-name or an orgs/github-org-name value, and takes all the respositories there. --- README.md | 10 ++++++++++ index.py | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/README.md b/README.md index f576b05..9f497eb 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,16 @@ The set of mailing lists, repos / TR documents and events is configured in a JSO ] } ] + }, + "email4@example.com": { + "digest:tuesday": [ + { + "allRepos": "users/githubaccount" + } + { + "allRepos": "orgs/orgname" + } + ] } } ``` diff --git a/index.py b/index.py index 8523d62..329c1ae 100755 --- a/index.py +++ b/index.py @@ -276,6 +276,15 @@ def getRepoList(source): repos = [] if ("repos" in source): repos = source["repos"] + if ("allRepos" in source): + try: + url = "https://github.com/" + source["allRepos"] + "/repos" + repolist = requests.get(url).json() + repolist = [x.name for x in repolist] + repos = uniq(repos + repolist) + except pass: + # TODO: Bad URL, report error? + if ("repoList" in source): try: repolist = requests.get(source["repoList"]).json() From 4cf342008e537ec0958adeb1a2ab18a56b5de0ad Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Mon, 25 Aug 2025 10:34:37 -0400 Subject: [PATCH 2/3] fixup! Add support for allRepos tag --- index.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.py b/index.py index 329c1ae..fbb9fb0 100755 --- a/index.py +++ b/index.py @@ -282,8 +282,9 @@ def getRepoList(source): repolist = requests.get(url).json() repolist = [x.name for x in repolist] repos = uniq(repos + repolist) - except pass: + except: # TODO: Bad URL, report error? + pass if ("repoList" in source): try: From 8f545799987bd58ec4480e9a7769e8576665c113 Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Mon, 25 Aug 2025 10:44:21 -0400 Subject: [PATCH 3/3] Document "allRepos" --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9f497eb..b217742 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,7 @@ In other words: * an optional "topic" (which will be included in the subject of the digest) * either: * a "repos" field with an array of repository full names (e.g. `w3c/webrtc-pc`) and/or a "repoList" field with an URL pointing a JSON area of repository fullnames (which gets combined with the list in `repos` if it is fetched successfully), and optionally an "eventFilter" field (which, as above, has `label` and `notlabel` as possible filters at the moment) that applies to all the said repos + * the "allRepos" field may be used instead of "repos" or "repoList" to indicate that all the repositories in the organization should be included. * a "sources" field, which describes an array of dictionaries as described above. This allows to create a single digest that combines filtered events from some repos, and unfiltered (or with different filters) events from other repos Only events for which templates have been defined (in the `templates/generic` directory) will be notified. Each mail target can have customized templates by creating an `email@example.com` directory in `templates/mls` and having a file named after the event. Templates use Mustache-based pystache as their engines and are fed with payload data from the event. The first line of the template is used as the subject of the email.