Bug 1481121: Always add `-dummy` to balrog release blobs, even if a suffix is specified; r=bhearsum
authorTom Prince <mozilla@hocat.ca>
Thu, 30 Aug 2018 18:58:34 +0000
changeset 8451 8b3d4005593e
parent 8450 98d1e5b4035a
child 8452 d76acbc873de
push id6174
push usermozilla@hocat.ca
push date2018-08-30 19:01 +0000
reviewersbhearsum
bugs1481121
Bug 1481121: Always add `-dummy` to balrog release blobs, even if a suffix is specified; r=bhearsum Differential Revision: https://phabricator.services.mozilla.com/D4701
lib/python/balrog/submitter/cli.py
--- a/lib/python/balrog/submitter/cli.py
+++ b/lib/python/balrog/submitter/cli.py
@@ -35,20 +35,18 @@ class ReleaseCreatorBase(object):
     def __init__(self, api_root, auth, dummy=False, suffix="",
                  from_suffix="",
                  complete_mar_filename_pattern=None,
                  complete_mar_bouncer_product_pattern=None):
         self.api_root = api_root
         self.auth = auth
         self.suffix = suffix
         self.from_suffix = from_suffix
-        if dummy and not suffix:
-            self.suffix = "-dummy"
-        else:
-            self.suffix = suffix
+        if dummy:
+            self.suffix += "-dummy"
         self.complete_mar_filename_pattern = complete_mar_filename_pattern or '%s-%s.complete.mar'
         self.complete_mar_bouncer_product_pattern = complete_mar_bouncer_product_pattern or '%s-%s-complete'
 
     def generate_data(self, appVersion, productName, version, buildNumber,
                       updateChannels, ftpServer, bouncerServer,
                       enUSPlatforms, schemaVersion, openURL=None,
                       **updateKwargs):
         assert schemaVersion in (3, 4), 'Unhandled schema version %s' % schemaVersion
@@ -268,20 +266,18 @@ class ReleaseCreatorV9(ReleaseCreatorFil
     def __init__(self, api_root, auth, dummy=False, suffix="",
                  from_suffix="",
                  complete_mar_filename_pattern=None,
                  complete_mar_bouncer_product_pattern=None):
         self.api_root = api_root
         self.auth = auth
         self.suffix = suffix
         self.from_suffix = from_suffix
-        if dummy and not suffix:
-            self.suffix = "-dummy"
-        else:
-            self.suffix = suffix
+        if dummy:
+            self.suffix += "-dummy"
         self.complete_mar_filename_pattern = complete_mar_filename_pattern or '%s-%s.complete.mar'
         self.complete_mar_bouncer_product_pattern = complete_mar_bouncer_product_pattern or '%s-%s-complete'
 
     def generate_data(self, appVersion, productName, version, buildNumber,
                       updateChannels, ftpServer, bouncerServer,
                       enUSPlatforms, **updateKwargs):
         details_product = productName.lower()
         if details_product == "devedition":
@@ -500,20 +496,19 @@ class NightlySubmitterV4(NightlySubmitte
     def run(self, *args, **kwargs):
         return NightlySubmitterBase.run(self, *args, schemaVersion=4, **kwargs)
 
 
 class ReleaseSubmitterBase(object):
     def __init__(self, api_root, auth, dummy=False, suffix="", from_suffix=""):
         self.api_root = api_root
         self.auth = auth
-        if dummy and not suffix:
-            self.suffix = "-dummy"
-        else:
-            self.suffix = suffix
+        self.suffix = suffix
+        if dummy:
+            self.suffix += "-dummy"
         self.from_suffix = from_suffix
 
     def run(self, platform, productName, appVersion, version, build_number, locale,
             hashFunction, extVersion, buildID, schemaVersion, **updateKwargs):
         assert schemaVersion in (3, 4), 'Unhandled schema version %s' % schemaVersion
         targets = buildbot2updatePlatforms(platform)
         # Some platforms may have alias', but those are set-up elsewhere
         # for release blobs.
@@ -583,20 +578,19 @@ class ReleaseSubmitterV4(ReleaseSubmitte
     def run(self, *args, **kwargs):
         return ReleaseSubmitterBase.run(self, *args, schemaVersion=4, **kwargs)
 
 
 class ReleaseSubmitterV9(MultipleUpdatesReleaseMixin):
     def __init__(self, api_root, auth, dummy=False, suffix="", from_suffix=""):
         self.api_root = api_root
         self.auth = auth
-        if dummy and not suffix:
-            self.suffix = "-dummy"
-        else:
-            self.suffix = suffix
+        self.suffix = suffix
+        if dummy:
+            self.suffix += "-dummy"
         self.from_suffix = from_suffix
 
     def run(self, platform, productName, appVersion, version, build_number, locale,
             hashFunction, extVersion, buildID, **updateKwargs):
         targets = buildbot2updatePlatforms(platform)
         # Some platforms may have alias', but those are set-up elsewhere
         # for release blobs.
         build_target = targets[0]
@@ -621,40 +615,38 @@ class ReleaseSubmitterV9(MultipleUpdates
             buildData=json.dumps(merge_partial_updates(current_data, data)),
             schemaVersion=9)
 
 
 class ReleasePusher(object):
     def __init__(self, api_root, auth, dummy=False, suffix=""):
         self.api_root = api_root
         self.auth = auth
-        if dummy and not suffix:
-            self.suffix = "-dummy"
-        else:
-            self.suffix = suffix
+        self.suffix = suffix
+        if dummy:
+            self.suffix += "-dummy"
 
     def run(self, productName, version, build_number, rule_ids, backgroundRate=None):
         name = get_release_blob_name(productName, version, build_number,
                                      self.suffix)
         for rule_id in rule_ids:
             data = {"mapping": name}
             if backgroundRate:
                 data["backgroundRate"] = backgroundRate
             Rule(api_root=self.api_root, auth=self.auth, rule_id=rule_id
                  ).update_rule(**data)
 
 
 class ReleaseScheduler(object):
     def __init__(self, api_root, auth, dummy=False, suffix=""):
         self.api_root = api_root
         self.auth = auth
-        if dummy and not suffix:
+        self.suffix = suffix
+        if dummy:
             self.suffix = "-dummy"
-        else:
-            self.suffix = suffix
 
     def run(self, productName, version, build_number, rule_ids, when=None, backgroundRate=None):
         name = get_release_blob_name(productName, version, build_number,
                                      self.suffix)
 
         if when is not None:
             when = arrow.get(when)