Bug 1249528 - releaserunner should handle RC channels r=Callek
authorRail Aliiev <rail@mozilla.com>
Mon, 21 Mar 2016 17:05:40 -0400
changeset 6694 2b4707b2f293891072589f5c2d54f239d05eba94
parent 6693 a5246c464c99af47cfe29922b31c7f1409c8a7ab
child 6695 2f410a8e744d3353193ff02e091592701cab87de
child 6696 aeded999e2856c228f09d85eb81de422ded1bc01
push id42
push userbmo:rail@mozilla.com
push dateMon, 21 Mar 2016 23:28:26 +0000
reviewersCallek
bugs1249528
Bug 1249528 - releaserunner should handle RC channels r=Callek
buildfarm/release/release-runner.py
scripts/release/updates/chunked-verify.sh
--- a/buildfarm/release/release-runner.py
+++ b/buildfarm/release/release-runner.py
@@ -79,16 +79,30 @@ def bump_version(version):
     v[-1] = str(int(v[-1]) + 1)
     return split_by.join(v)
 
 
 def matches(name, patterns):
     return any([re.search(p, name) for p in patterns])
 
 
+def update_channels(version, mappings):
+    """Return a list of update channels for a version using version mapping
+
+    >>> update_channels("40.0", [(r"^\d+\.0$", ["beta", "release"]), (r"^\d+\.\d+\.\d+$", ["release"])])
+    ["beta", "release"]
+    >>> update_channels("40.0.1", [(r"^\d+\.0$", ["beta", "release"]), (r"^\d+\.\d+\.\d+$", ["release"])])
+    ["release"]
+    """
+    for pattern, channels in mappings:
+        if re.match(pattern, version):
+            return channels
+    raise RuntimeError("Cannot find update channels for %s" % version)
+
+
 class ReleaseRunner(object):
     def __init__(self, api_root=None, username=None, password=None,
                  timeout=60):
         self.new_releases = []
         self.releases_api = Releases((username, password), api_root=api_root,
                                      timeout=timeout)
         self.release_api = Release((username, password), api_root=api_root,
                                    timeout=timeout)
@@ -502,17 +516,17 @@ def main(options):
                 "funsize_balrog_api_root": branchConfig["funsize_balrog_api_root"],
                 "balrog_username": balrog_username,
                 "balrog_password": balrog_password,
                 "beetmover_aws_access_key_id": beetmover_aws_access_key_id,
                 "beetmover_aws_secret_access_key": beetmover_aws_secret_access_key,
                 # TODO: stagin specific, make them configurable
                 "signing_class": "release-signing",
                 "bouncer_enabled": branchConfig["bouncer_enabled"],
-                "release_channels": branchConfig["release_channels"],
+                "release_channels": update_channels(release["version"], branchConfig["release_channel_mappings"]),
                 "signing_pvt_key": signing_pvt_key,
                 "build_tools_repo_path": branchConfig['build_tools_repo_path'],
                 "push_to_candidates_enabled": branchConfig['push_to_candidates_enabled'],
                 "postrelease_version_bump_enabled": branchConfig['postrelease_version_bump_enabled'],
                 "push_to_releases_enabled": True,
                 "push_to_releases_automatic": branchConfig['push_to_releases_automatic'],
                 "beetmover_candidates_bucket": branchConfig["beetmover_buckets"][release["product"]],
             }
--- a/scripts/release/updates/chunked-verify.sh
+++ b/scripts/release/updates/chunked-verify.sh
@@ -23,16 +23,22 @@ channel=$5
 if [ -n "$PROPERTIES_FILE" -a -f "$PROPERTIES_FILE" ]; then
     # Buildbot only
     if $JSONTOOL -k properties.NO_BBCONFIG $PROPERTIES_FILE; then
        NO_BBCONFIG=$($JSONTOOL -k properties.NO_BBCONFIG $PROPERTIES_FILE);
     fi
     if $JSONTOOL -k properties.VERIFY_CONFIG $PROPERTIES_FILE; then
        VERIFY_CONFIG=$($JSONTOOL -k properties.VERIFY_CONFIG $PROPERTIES_FILE);
     fi
+    if $JSONTOOL -k properties.TOTAL_CHUNKS $PROPERTIES_FILE; then
+       chunks=$($JSONTOOL -k properties.TOTAL_CHUNKS $PROPERTIES_FILE);
+    fi
+    if $JSONTOOL -k properties.THIS_CHUNK $PROPERTIES_FILE; then
+       thisChunk=$($JSONTOOL -k properties.THIS_CHUNK $PROPERTIES_FILE);
+    fi
     if [ -z "$NO_BBCONFIG" -a -z "$BUILDBOT_CONFIGS" ]; then
         export BUILDBOT_CONFIGS="https://hg.mozilla.org/build/buildbot-configs"
     fi
     # Get the assumed slavebuilddir, and read in from buildbot if this is not
     # Release promotion
     SLAVEBUILDDIR=$(basename $(cd "$SCRIPTS_DIR/.."; pwd))
     if [ -z "$NO_BBCONFIG" ]; then
         RELEASE_CONFIG=$($JSONTOOL -k properties.release_config $PROPERTIES_FILE)