Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ The set of mailing lists, repos / TR documents and events is configured in a JSO
]
}
]
},
"[email protected]": {
"digest:tuesday": [
{
"allRepos": "users/githubaccount"
}
{
"allRepos": "orgs/orgname"
}
]
}
}
```
Expand All @@ -58,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 protected]` 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.
Expand Down
10 changes: 10 additions & 0 deletions index.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,16 @@ 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:
# TODO: Bad URL, report error?
pass

if ("repoList" in source):
try:
repolist = requests.get(source["repoList"]).json()
Expand Down