Bug 1337861 - [Fennec-Relpro] Enforce the presence of $MOZ_BUILD_DATE r=jlund a=release FIREFOX_54_0b3_BUILD1 FIREFOX_54_0b3_RELEASE
authorJohan Lorenzo <jlorenzo@mozilla.com>
Thu, 23 Feb 2017 19:23:19 +0100
changeset 396071 0b1c079a2a4b826b217ec7d3c7446ef942e4fc0e
parent 396070 1475c20357cf9d509a7cc7ef80fad4deeaac3ba6
child 396072 fdf45ba25f3d116ae3a80f6c33068ebd1ccca202
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlund, release
bugs1337861
milestone54.0
Bug 1337861 - [Fennec-Relpro] Enforce the presence of $MOZ_BUILD_DATE r=jlund a=release MozReview-Commit-ID: DzEeeYQjwLW
testing/mozharness/mozharness/mozilla/building/buildbase.py
--- a/testing/mozharness/mozharness/mozilla/building/buildbase.py
+++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py
@@ -789,26 +789,37 @@ or run without that action (ie: --no-{ac
 
     def query_buildid(self):
         c = self.config
         if self.buildid:
             return self.buildid
 
         buildid = None
         if c.get("is_automation"):
-            if self.buildbot_config['properties'].get('buildid'):
-                self.info("Determining buildid from buildbot properties")
-                buildid = self.buildbot_config['properties']['buildid'].encode(
-                    'ascii', 'replace'
-                )
+            if self.buildbot_config.get('properties'):
+                # We're on buildbot
+                if self.buildbot_config.get('properties').get('buildid'):
+                    # Try may not provide a buildid. This means, it's gonna be generated
+                    # below.
+                    self.info("Determining buildid from buildbot properties")
+                    buildid = self.buildbot_config['properties']['buildid'].encode(
+                        'ascii', 'replace'
+                    )
             else:
-                # for taskcluster, there are no buildbot properties, and we pass
+                # We're on taskcluster.
+                # In this case, there are no buildbot properties, and we must pass
                 # MOZ_BUILD_DATE into mozharness as an environment variable, only
                 # to have it pass the same value out with the same name.
-                buildid = os.environ.get('MOZ_BUILD_DATE')
+                try:
+                    buildid = os.environ['MOZ_BUILD_DATE']
+                except KeyError:
+                    self.fatal(
+                        "MOZ_BUILD_DATE must be provided as an environment var on Taskcluster"
+                    )
+
 
         if not buildid:
             self.info("Creating buildid through current time")
             buildid = generate_build_ID()
 
         if c.get('is_automation'):
             self.set_buildbot_property('buildid',
                                        buildid,