]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Fix buildbot slack/xmpp push
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 8 Mar 2020 13:40:19 +0000 (14:40 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 8 Mar 2020 13:40:19 +0000 (14:40 +0100)
modules/private/buildbot/common/build_helpers.py

index 384b1ac34f895eed6342318f0fbc0be63af749af..ed7ada368016b085e4aa8573cfae4ed1958a3d37 100644 (file)
@@ -115,7 +115,7 @@ class SlackStatusPush(HttpStatusPushBase):
             msg = "{} environment".format(build["properties"]["environment"][0])
             if "build" in build["properties"]:
                 msg = "of archive {} in ".format(build["properties"]["build"][0]) + msg
-        elif len(build["buildset"]["sourcestamps"][0]["branch"]) > 0:
+        elif len(build["buildset"]["sourcestamps"][0]["branch"] or []) > 0:
             msg = "revision {}".format(build["buildset"]["sourcestamps"][0]["branch"])
         else:
             msg = "build"
@@ -223,7 +223,7 @@ class XMPPStatusPush(HttpStatusPushBase):
             msg = "{} environment".format(build["properties"]["environment"][0])
             if "build" in build["properties"]:
                 msg = "of archive {} in ".format(build["properties"]["build"][0]) + msg
-        elif len(build["buildset"]["sourcestamps"][0]["branch"]) > 0:
+        elif len(build["buildset"]["sourcestamps"][0]["branch"] or []) > 0:
             msg = "revision {}".format(build["buildset"]["sourcestamps"][0]["branch"])
         else:
             msg = "build"