mirror of https://gerrit.osmocom.org/osmo-ci
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
This commit is contained in:
parent
348751bc05
commit
5354547dff
|
@ -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():
|
||||
|
|
Loading…
Reference in New Issue