aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2019-10-07 15:40:14 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2019-10-07 15:40:14 -0400
commit81d8b239b7817914ed896d955370cdf3a6582fbc (patch)
tree77b1e2e3dbbe981c576ba664b67f40dbec43b801
parentc34647cba3f0ed6dc9be586ba2107879ad518a4c (diff)
downloadkorg-helpers-81d8b239b7817914ed896d955370cdf3a6582fbc.tar.gz
Support "cclist" as config option
This allows us to send notification cc's to the list without needing to specify the list email in the config file. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rwxr-xr-xgit-patchwork-bot.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/git-patchwork-bot.py b/git-patchwork-bot.py
index a9dc795..2eba6cc 100755
--- a/git-patchwork-bot.py
+++ b/git-patchwork-bot.py
@@ -264,7 +264,7 @@ def get_patchwork_pull_requests_by_project(rm, project, fromstate):
('state', fromstate),
('order', '-date'),
('page', page),
- ('q', '[GIT,PULL]'),
+ ('q', 'GIT,PULL'),
('per_page', REST_PER_PAGE),
]
logger.debug('Processing page %s', page)
@@ -625,6 +625,8 @@ def notify_submitters(rm, serieslist, refname, config, revs, nomail):
is_pull_request = True
submitter = sdata.get('submitter')
+ project = sdata.get('project')
+
if 'neverto' in config:
neverto = config['neverto'].split(',')
if submitter.get('email') in neverto:
@@ -721,9 +723,15 @@ def notify_submitters(rm, serieslist, refname, config, revs, nomail):
if 'alwayscc' in config:
msg['Cc'] = config['alwayscc']
- targets.append(config['alwayscc'].split(','))
+ targets += config['alwayscc'].split(',')
if 'alwaysbcc' in config:
- targets.append(config['alwaysbcc'].split(','))
+ targets += config['alwaysbcc'].split(',')
+ if 'cclist' in config and config['cclist'] == 'true':
+ targets.append(project.get('list_email'))
+ if 'Cc' in msg:
+ msg['Cc'] = '%s,%s' % (msg['Cc'], project.get('list_email'))
+ else:
+ msg['Cc'] = project.get('list_email')
if not nomail:
logger.debug('Message follows')