Bug 1252333 - temporary tweak release runner to handle betas only in the context of promotion. r=rail FIREFOX_38_7_0esr_BUILD1 FIREFOX_38_7_0esr_RELEASE
authorMihai Tabara <mtabara@mozilla.com>
Wed, 02 Mar 2016 13:53:37 -0800
changeset 6543 9a9fa4e89121ce05fa217d02aa8755f45d1cc49f
parent 6542 61fc3eaaf7c679911621c67fc3840c71cdc66723
child 6544 632e41b50bf441e30d0c7a010eaee13a48e76442
push id4885
push usermtabara@mozilla.com
push dateWed, 02 Mar 2016 21:54:02 +0000
reviewersrail
bugs1252333
Bug 1252333 - temporary tweak release runner to handle betas only in the context of promotion. r=rail
buildfarm/release/release-runner.py
--- a/buildfarm/release/release-runner.py
+++ b/buildfarm/release/release-runner.py
@@ -1,15 +1,16 @@
 #!/usr/bin/env python
 
 import site
 import time
 import logging
 import sys
 import os
+import re
 import subprocess
 import hashlib
 import functools
 import shutil
 import tempfile
 import requests
 from os import path
 from optparse import OptionParser
@@ -26,16 +27,18 @@ from taskcluster import Scheduler, Index
 from taskcluster.utils import slugId
 from util.hg import mercurial
 from util.retry import retry
 from util.file import load_config, get_config
 
 log = logging.getLogger(__name__)
 
 
+# both CHECKSUMS and ALL_FILES have been defined to improve the release sanity
+# en-US binaries timing by whitelisting artifacts of interest - bug 1251761
 CHECKSUMS = set([
     '.checksums',
     '.checksums.asc',
 ])
 
 
 ALL_FILES = set([
     '.checksums',
@@ -43,16 +46,24 @@ ALL_FILES = set([
     '.complete.mar',
     '.exe',
     '.dmg',
     'i686.tar.bz2',
     'x86_64.tar.bz2',
 ])
 
 
+# temporary regex to filter out anything but firefox beta releases within
+# release promotion. Once migration from buildbot to promotion is completed
+# for all types of releases, we will backout this filtering  - bug 1252333
+RELEASE_PATTERNS = [
+    r"Firefox-\d+\.0b\d+-build\d+"
+]
+
+
 class SanityException(Exception):
     pass
 
 
 # FIXME: the following function should be removed and we should use
 # next_version provided by ship-it
 def bump_version(version):
     """Bump last digit"""
@@ -64,33 +75,45 @@ def bump_version(version):
     v = version.split(split_by)
     if len(v) < digit_index + 1:
         # 45.0 is 45.0.0 actually
         v.append("0")
     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])
+
+
 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)
         self.release_l10n_api = ReleaseL10n((username, password),
                                             api_root=api_root, timeout=timeout)
 
     def get_release_requests(self):
         new_releases = self.releases_api.getReleases()
         if new_releases['releases']:
-            self.new_releases = [self.release_api.getRelease(name) for name in
-                                 new_releases['releases']]
-            return True
+            new_releases = [self.release_api.getRelease(name) for name in
+                            new_releases['releases']]
+            our_releases = [r for r in new_releases if
+                            matches(r['name'], RELEASE_PATTERNS)]
+            if our_releases:
+                self.new_releases = our_releases
+                log.info("Releases to handle are %s", our_releases)
+                return True
+            else:
+                log.info("No releases to handle in %s", new_releases)
+                return False
         else:
             log.info("No new releases: %s" % new_releases)
             return False
 
     def get_release_l10n(self, release):
         return self.release_l10n_api.getL10n(release)
 
     def update_status(self, release, status):