aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2022-10-12 12:19:21 +0200
committerOliver Smith <osmith@sysmocom.de>2022-10-12 12:22:44 +0200
commit5354547dff62c4996c4cf82f0ceede5491da7069 (patch)
tree71957960dd470be2250d2d5da1b4fa471db72f13
parent348751bc05d85239dd4fdff7fb03e202968e8168 (diff)
jenkins-gerrit: tweak notify setting
Instead of notifying everybody listed as reviewers and in CC: * notify the owner if the build failed * notify nobody if the build was successful Related: OS#2385 Change-Id: I7c6c183b98624eb75d5dccd9766ee3ff5568b06e
-rwxr-xr-xscripts/jenkins-gerrit/pipeline_summary.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/jenkins-gerrit/pipeline_summary.py b/scripts/jenkins-gerrit/pipeline_summary.py
index 37d4028..b5310c6 100755
--- a/scripts/jenkins-gerrit/pipeline_summary.py
+++ b/scripts/jenkins-gerrit/pipeline_summary.py
@@ -137,7 +137,8 @@ def get_pipeline_summary(build_url):
:returns: a dict that is expected by gerrit's set-review api, e.g.
{"tag": "jenkins",
"message": "...",
- "labels": {"Code-Review": -1}} """
+ "labels": {"Code-Review": -1},
+ "notify": "OWNER"} """
summary = ""
pipeline = parse_pipeline(build_url)
@@ -164,15 +165,19 @@ def get_pipeline_summary(build_url):
if jobs["failed"]:
summary += "Build Failed\n"
vote = -1
+ notify = "OWNER"
else:
summary += "Build Successful\n"
vote = 1
+ notify = "NONE"
# Reference:
# https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#set-review
+ # https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#review-input
return {"tag": "jenkins",
"message": summary,
- "labels": {"Verified": vote}}
+ "labels": {"Verified": vote},
+ "notify": notify}
def main():