Permalink
Browse files

Bug 775541 - support for multiple partial updates in update verify bu…

…mp script. r=bhearsum
  • Loading branch information...
1 parent 382877f commit a91ad2e26bf9ae1674a7071d1dfc3ec18d76c554 @rail rail committed Aug 21, 2012
View
8 lib/python/mozilla_buildtools/test/sample-update-verify.cfg
@@ -1,4 +1,4 @@
-release="4.0" product="Firefox" platform="Linux_x86-gcc3" build_id="888" locales="af de en-US ja zh-TW" channel="betatest" patch_types="partial complete" from="/firefox/4.0rc1.tar.bz2" aus_server="https://aus2.mozilla.org" ftp_server="stage.mozilla.org/firefox" to="/firefox/4.0rc2.tar.bz2"
-release="4.0b12" product="Firefox" platform="Linux_x86-gcc3" build_id="777" locales="af en-US" channel="betatest" patch_types="complete" from="/firefox/4.0b12.tar.bz2"
-release="4.0b12" product="Firefox" platform="Linux_x86-gcc3" build_id="777" locales="de ja zh-TW" channel="betatest" patch_types="complete"
-release="3.7a1" product="Firefox" platform="Linux_x86-gcc3" build_id="666" locales="en-US" channel="betatest" patch_types="complete"
+release="4.0" product="Firefox" platform="Linux_x86-gcc3" build_id="888" locales="af de en-US ja zh-TW" channel="betatest" patch_types="partial complete" from="/firefox/4.0rc1.tar.bz2" aus_server="https://aus2.mozilla.org" ftp_server_from="stage.mozilla.org/firefox" ftp_server_to="stage.mozilla.org/firefox" to="/firefox/4.0rc2.tar.bz2"
+release="4.0b12" product="Firefox" platform="Linux_x86-gcc3" build_id="777" locales="af en-US" channel="betatest" patch_types="complete" from="/firefox/4.0b12.tar.bz2" ftp_server_from="stage.mozilla.org/firefox" ftp_server_to="stage.mozilla.org/firefox"
+release="4.0b12" product="Firefox" platform="Linux_x86-gcc3" build_id="777" locales="de ja zh-TW" channel="betatest" patch_types="complete" ftp_server_from="stage.mozilla.org/firefox" ftp_server_to="stage.mozilla.org/firefox"
+release="3.7a1" product="Firefox" platform="Linux_x86-gcc3" build_id="666" locales="en-US" channel="betatest" patch_types="complete" ftp_server_from="stage.mozilla.org/firefox" ftp_server_to="stage.mozilla.org/firefox"
View
91 lib/python/mozilla_buildtools/test/test_release_updates_verify.py
@@ -24,14 +24,16 @@ def testEq(self):
self.uvc.channel = "betatest"
self.uvc.platform = "bar"
self.uvc.aus_server = "aus"
- self.uvc.ftp_server = "ftp"
+ self.uvc.ftp_server_from = "ftp"
+ self.uvc.ftp_server_to = "ftp"
self.uvc.to = "/firefox/4.0rc2.tar.bz2"
uvc2 = UpdateVerifyConfig()
uvc2.product = "foo"
uvc2.channel = "betatest"
uvc2.platform = "bar"
uvc2.aus_server = "aus"
- uvc2.ftp_server = "ftp"
+ uvc2.ftp_server_form = "ftp"
+ uvc2.ftp_server_to = "ftp"
uvc2.to = "/firefox/4.0rc2.tar.bz2"
self.assertEquals(self.uvc, uvc2)
@@ -48,57 +50,79 @@ def testAddRelease(self):
"build_id": 555,
"locales": ["af", "de"],
"patch_types": ["partial", "complete"],
- "from": "/pub/firefox/foo.bz2"
+ "from": "/pub/firefox/foo.bz2",
+ "ftp_server_from": "from",
+ "ftp_server_to": "to"
}
]
self.uvc.addRelease("4.0", build_id=555, locales=["af", "de"],
patch_types=["partial", "complete"],
- from_path="/pub/firefox/foo.bz2")
+ from_path="/pub/firefox/foo.bz2",
+ ftp_server_from="from", ftp_server_to="to")
self.assertEquals(self.uvc.releases, releases)
def testRead(self):
+ ftp_server_from = "stage.mozilla.org/firefox"
+ ftp_server_to = "stage.mozilla.org/firefox"
uvc2 = UpdateVerifyConfig()
uvc2.product = "Firefox"
uvc2.platform = "Linux_x86-gcc3"
uvc2.channel = "betatest"
uvc2.aus_server = "https://aus2.mozilla.org"
- uvc2.ftp_server = "stage.mozilla.org/firefox"
uvc2.to = "/firefox/4.0rc2.tar.bz2"
uvc2.addRelease("4.0", build_id="888",
locales=["af", "de", "en-US", "ja", "zh-TW"],
patch_types=["partial", "complete"],
- from_path="/firefox/4.0rc1.tar.bz2")
+ from_path="/firefox/4.0rc1.tar.bz2",
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
uvc2.addRelease("4.0b12", build_id="777",
locales=["af", "en-US"],
- from_path="/firefox/4.0b12.tar.bz2")
+ from_path="/firefox/4.0b12.tar.bz2",
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
uvc2.addRelease("4.0b12", build_id="777",
- locales=["de", "ja", "zh-TW"])
- uvc2.addRelease("3.7a1", build_id="666", locales=["en-US"])
+ locales=["de", "ja", "zh-TW"],
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
+ uvc2.addRelease("3.7a1", build_id="666", locales=["en-US"],
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
self.uvc.read(self.config)
self.assertEquals(self.uvc, uvc2)
def testWrite(self):
+ ftp_server_from = "stage.mozilla.org/firefox"
+ ftp_server_to = "stage.mozilla.org/firefox"
self.uvc.product = "Firefox"
self.uvc.platform = "Linux_x86-gcc3"
self.uvc.channel = "betatest"
self.uvc.aus_server = "https://aus2.mozilla.org"
- self.uvc.ftp_server = "stage.mozilla.org/firefox"
self.uvc.to = "/firefox/4.0rc2.tar.bz2"
self.uvc.addRelease("4.0", build_id="888",
locales=("af", "de", "en-US", "ja", "zh-TW"),
patch_types=("partial", "complete"),
- from_path="/firefox/4.0rc1.tar.bz2")
+ from_path="/firefox/4.0rc1.tar.bz2",
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
self.uvc.addRelease("4.0b12", build_id="777",
locales=["af", "en-US"],
- from_path="/firefox/4.0b12.tar.bz2")
+ from_path="/firefox/4.0b12.tar.bz2",
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
self.uvc.addRelease("4.0b12", build_id="777",
- locales=("de", "ja", "zh-TW"))
- self.uvc.addRelease("3.7a1", build_id="666", locales=("en-US",))
+ locales=("de", "ja", "zh-TW"),
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
+ self.uvc.addRelease("3.7a1", build_id="666", locales=("en-US",),
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
self.uvc.write(self.tmpfile)
self.tmpfile.close()
- self.assertEquals(md5(open(self.config).read()).hexdigest(), md5(open(self.tmpfilename).read()).hexdigest())
+ self.assertEquals(md5(open(self.config).read()).hexdigest(),
+ md5(open(self.tmpfilename).read()).hexdigest())
def testReadInvalidKey(self):
invalidLine = 'foo="bar"'
@@ -113,21 +137,26 @@ def testParseLineBad(self):
self.assertRaises(UpdateVerifyError, self.uvc._parseLine, invalidLine)
def testGetChunk(self):
+ ftp_server_from = "stage.mozilla.org/firefox"
+ ftp_server_to = "stage.mozilla.org/firefox"
self.uvc.read(self.config)
uvc2 = UpdateVerifyConfig()
uvc2.product = "Firefox"
uvc2.platform = "Linux_x86-gcc3"
uvc2.channel = "betatest"
uvc2.aus_server = "https://aus2.mozilla.org"
- uvc2.ftp_server = "stage.mozilla.org/firefox"
uvc2.to = "/firefox/4.0rc2.tar.bz2"
uvc2.addRelease("4.0", build_id="888",
locales=["af", "de", "en-US"],
patch_types=["partial", "complete"],
- from_path="/firefox/4.0rc1.tar.bz2")
+ from_path="/firefox/4.0rc1.tar.bz2",
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
uvc2.addRelease("4.0b12", build_id="777",
locales=["de", "ja"],
patch_types=["complete"],
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to,
from_path=None)
chunkedConfig = self.uvc.getChunk(chunks=3, thisChunk=1)
self.assertEquals(chunkedConfig, uvc2)
@@ -137,7 +166,8 @@ def testGetChunkWithPathWithSpaces(self):
self.uvc.platform = "Linux_x86-gcc3"
self.uvc.channel = "betatest"
self.uvc.aus_server = "https://aus2.mozilla.org"
- self.uvc.ftp_server = "stage.mozilla.org/firefox"
+ self.uvc.ftp_server_from = "stage.mozilla.org/firefox"
+ self.uvc.ftp_server_to = "stage.mozilla.org/firefox"
self.uvc.to = "/firefox/Firefox 4.0 Beta 2.exe"
self.uvc.addRelease("4.0b1", build_id="222",
locales=["en-US", "ja", "zh-TW"],
@@ -148,7 +178,8 @@ def testGetChunkWithPathWithSpaces(self):
uvc2.platform = "Linux_x86-gcc3"
uvc2.channel = "betatest"
uvc2.aus_server = "https://aus2.mozilla.org"
- uvc2.ftp_server = "stage.mozilla.org/firefox"
+ uvc2.ftp_server_from = "stage.mozilla.org/firefox"
+ uvc2.ftp_server_to = "stage.mozilla.org/firefox"
uvc2.to = "/firefox/Firefox 4.0 Beta 2.exe"
uvc2.addRelease("4.0b1", build_id="222",
locales=["en-US", "ja"],
@@ -178,39 +209,49 @@ def testGetReleaseNonexistenceRelease(self):
self.assertEquals(self.uvc.getRelease("123", None), {})
def testGetFullReleaseTests(self):
+ ftp_server_from = "stage.mozilla.org/firefox"
+ ftp_server_to = "stage.mozilla.org/firefox"
self.uvc.read(self.config)
uvc2 = UpdateVerifyConfig()
uvc2.product = "Firefox"
uvc2.platform = "Linux_x86-gcc3"
uvc2.channel = "betatest"
uvc2.aus_server = "https://aus2.mozilla.org"
- uvc2.ftp_server = "stage.mozilla.org/firefox"
uvc2.to = "/firefox/4.0rc2.tar.bz2"
uvc2.addRelease("4.0", build_id="888",
locales=["af", "de", "en-US", "ja", "zh-TW"],
patch_types=["partial", "complete"],
- from_path="/firefox/4.0rc1.tar.bz2")
+ from_path="/firefox/4.0rc1.tar.bz2",
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
uvc2.addRelease("4.0b12", build_id="777",
locales=["af", "en-US"],
patch_types=["complete"],
- from_path="/firefox/4.0b12.tar.bz2")
+ from_path="/firefox/4.0b12.tar.bz2",
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
self.assertEquals(self.uvc.getFullReleaseTests(), uvc2.releases)
def testGetQuickReleaseTests(self):
+ ftp_server_from = "stage.mozilla.org/firefox"
+ ftp_server_to = "stage.mozilla.org/firefox"
self.uvc.read(self.config)
uvc2 = UpdateVerifyConfig()
uvc2.product = "Firefox"
uvc2.platform = "Linux_x86-gcc3"
uvc2.channel = "betatest"
uvc2.aus_server = "https://aus2.mozilla.org"
- uvc2.ftp_server = "stage.mozilla.org/firefox"
uvc2.to = "/firefox/4.0rc2.tar.bz2"
uvc2.addRelease("4.0b12", build_id="777",
locales=["de", "ja", "zh-TW"],
patch_types=["complete"],
- from_path=None)
+ from_path=None,
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
uvc2.addRelease("3.7a1", build_id="666",
locales=["en-US"],
patch_types=["complete"],
- from_path=None)
+ from_path=None,
+ ftp_server_from=ftp_server_from,
+ ftp_server_to=ftp_server_to)
self.assertEquals(self.uvc.getQuickReleaseTests(), uvc2.releases)
View
12 lib/python/release/l10n.py
@@ -70,7 +70,8 @@ def getL10nRepositories(fileName, l10nRepoPath, relbranch=None):
def makeReleaseRepackUrls(productName, brandName, version, platform,
- locale='en-US', signed=False):
+ locale='en-US', signed=False,
+ exclude_secondary=False):
longVersion = version
builds = {}
platformDir = buildbot2ftp(platform)
@@ -90,10 +91,11 @@ def makeReleaseRepackUrls(productName, brandName, version, platform,
if not signed:
prefix.append('unsigned')
prefix.extend([platformDir, locale])
- builds[filename] = '/'.join(
- [p.strip('/') for p in
- prefix + ['%s-%s.zip' % (productName, version)]]
- )
+ if not exclude_secondary:
+ builds[filename] = '/'.join(
+ [p.strip('/') for p in
+ prefix + ['%s-%s.zip' % (productName, version)]]
+ )
builds[instname] = '/'.join(
[p.strip('/') for p in
prefix + ['%s Setup %s.exe' % (brandName, longVersion)]]
View
18 lib/python/release/paths.py
@@ -1,7 +1,7 @@
from urlparse import urlunsplit
def makeCandidatesDir(product, version, buildNumber, nightlyDir=None,
- protocol=None, server=None):
+ protocol=None, server=None, ftp_root='/pub/mozilla.org/'):
if protocol:
assert server is not None, "server is required with protocol"
@@ -15,22 +15,22 @@ def makeCandidatesDir(product, version, buildNumber, nightlyDir=None,
if not nightlyDir:
nightlyDir = 'nightly'
- dir = '/pub/mozilla.org/' + product + '/' + nightlyDir + '/' + \
+ directory = ftp_root + product + '/' + nightlyDir + '/' + \
str(version) + '-candidates/build' + str(buildNumber) + '/'
if protocol:
- return urlunsplit((protocol, server, dir, None, None))
+ return urlunsplit((protocol, server, directory, None, None))
else:
- return dir
+ return directory
-def makeReleasesDir(product, version, protocol=None, server=None):
- # TODO: add "devpreview" style directories
+def makeReleasesDir(product, version, protocol=None, server=None,
+ ftp_root='/pub/mozilla.org/'):
if protocol:
assert server is not None, "server is required with protocol"
- dir = '/pub/mozilla.org/%s/releases/%s/' % (product, version)
+ directory = '%s%s/releases/%s/' % (ftp_root, product, version)
if protocol:
- return urlunsplit((protocol, server, dir, None, None))
+ return urlunsplit((protocol, server, directory, None, None))
else:
- return dir
+ return directory
View
41 lib/python/release/updates/verify.py
@@ -1,28 +1,30 @@
from copy import copy
-import os, re
+import os
+import re
from util.algorithms import getChunk
+
class UpdateVerifyError(Exception):
pass
+
class UpdateVerifyConfig(object):
comment_regex = re.compile("^#")
key_write_order = ("release", "product", "platform", "build_id", "locales",
"channel", "patch_types", "from", "aus_server",
- "ftp_server", "to")
- global_keys = ("product", "platform", "channel", "aus_server", "ftp_server",
- "to")
- release_keys = ("release", "build_id", "locales", "patch_types", "from")
- first_only_keys = ("from", "aus_server", "ftp_server", "to")
+ "ftp_server_from", "ftp_server_to", "to")
+ global_keys = ("product", "platform", "channel", "aus_server", "to")
+ release_keys = ("release", "build_id", "locales", "patch_types", "from",
+ "ftp_server_from", "ftp_server_to")
+ first_only_keys = ("from", "aus_server", "to")
compare_attrs = global_keys + ("releases",)
def __init__(self, product=None, platform=None, channel=None,
- aus_server=None, ftp_server=None, to=None):
+ aus_server=None, to=None):
self.product = product
self.platform = platform
self.channel = channel
self.aus_server = aus_server
- self.ftp_server = ftp_server
self.to = to
self.releases = []
@@ -50,7 +52,7 @@ def _parseLine(self, line):
def _addEntry(self, entry, first):
releaseKeys = {}
- for k,v in entry.items():
+ for k, v in entry.items():
if k in self.global_keys:
setattr(self, k, entry[k])
elif k in self.release_keys:
@@ -64,8 +66,7 @@ def _addEntry(self, entry, first):
def read(self, config):
f = open(config)
# Only the first non-comment line of an update verify config should
- # have a "from", "ausServer", and "ftpServer". Ignore any subsequent
- # lines with them.
+ # have a "from" and"ausServer". Ignore any subsequent lines with them.
first = True
for line in f.readlines():
# Skip comment lines
@@ -87,17 +88,18 @@ def write(self, fh):
if value is not None:
fh.write(key)
fh.write("=")
- if isinstance(value, basestring):
- fh.write('"%s" ' % str(value))
- else:
+ if isinstance(value, (list, tuple)):
fh.write('"%s" ' % " ".join(value))
+ else:
+ fh.write('"%s" ' % str(value))
# Rewind one character to avoid having a trailing space
fh.seek(-1, os.SEEK_CUR)
fh.write("\n")
first = False
def addRelease(self, release=None, build_id=None, locales=[],
- patch_types=['complete'], from_path=None):
+ patch_types=['complete'], from_path=None,
+ ftp_server_from=None, ftp_server_to=None):
"""Locales and patch_types can be passed as either a string or a list.
If a string is passed, they will be converted to a list for internal
storage"""
@@ -107,13 +109,14 @@ def addRelease(self, release=None, build_id=None, locales=[],
locales = sorted(list(locales.split()))
if isinstance(patch_types, basestring):
patch_types = list(patch_types.split())
-
self.releases.append({
"release": release,
"build_id": build_id,
"locales": locales,
"patch_types": patch_types,
- "from": from_path
+ "from": from_path,
+ "ftp_server_from": ftp_server_from,
+ "ftp_server_to": ftp_server_to,
})
def addLocaleToRelease(self, build_id, locale, from_path=None):
@@ -149,14 +152,16 @@ def getChunk(self, chunks, thisChunk):
newConfig = UpdateVerifyConfig(self.product, self.platform,
self.channel, self.aus_server,
- self.ftp_server, self.to)
+ self.to)
for t in allTests:
build_id, locale, from_path = t
if from_path == "None":
from_path = None
r = self.getRelease(build_id, from_path)
try:
newConfig.addRelease(r["release"], build_id, locales=[],
+ ftp_server_from=r["ftp_server_from"],
+ ftp_server_to=r["ftp_server_to"],
patch_types=r["patch_types"], from_path=from_path)
except UpdateVerifyError:
pass
View
5 release/updates/verify.sh
@@ -6,7 +6,8 @@
. ../common/download_builds.sh
. ../common/check_updates.sh
-ftp_server="http://stage.mozilla.org/pub/mozilla.org"
+ftp_server_to="http://stage.mozilla.org/pub/mozilla.org"
+ftp_server_from="http://stage.mozilla.org/pub/mozilla.org"
aus_server="https://aus2.mozilla.org"
to=""
@@ -133,7 +134,7 @@ do
fi
from_path=`echo $from | sed "s/%locale%/${locale}/"`
to_path=`echo $to | sed "s/%locale%/${locale}/"`
- download_builds "${ftp_server}/${from_path}" "${ftp_server}/${to_path}"
+ download_builds "${ftp_server_from}/${from_path}" "${ftp_server_to}/${to_path}"
err=$?
if [ "$err" != "0" ]; then
echo "FAIL: download_builds returned non-zero exit code: $err"
View
155 scripts/updates/create-update-verify-configs.py
@@ -0,0 +1,155 @@
+#!/usr/bin/env python
+
+import site
+import sys
+import os
+from os import path
+
+site.addsitedir(path.join(path.dirname(__file__), "../../lib/python"))
+site.addsitedir(path.join(path.dirname(__file__), "../../lib/python/vendor"))
+
+from distutils.version import LooseVersion
+from release.updates.patcher import PatcherConfig
+from release.l10n import makeReleaseRepackUrls
+from release.platforms import buildbot2updatePlatforms, buildbot2ftp
+from release.paths import makeReleasesDir, makeCandidatesDir
+from release.info import readReleaseConfig
+from util.retry import retry
+from util.hg import mercurial, make_hg_url, update
+from release.updates.verify import UpdateVerifyConfig
+
+
+HG = "hg.mozilla.org"
+DEFAULT_BUILDBOT_CONFIGS_REPO = make_hg_url(HG, 'build/buildbot-configs')
+DEFAULT_MAX_PUSH_ATTEMPTS = 10
+REQUIRED_CONFIG = ('productName', 'buildNumber', 'ausServerUrl',
+ 'stagingServer')
+FTP_SERVER_TEMPLATE = 'http://%s/pub/mozilla.org'
+
+
+def validate(options):
+ err = False
+ config = {}
+
+ if not path.exists(path.join('buildbot-configs', options.release_config)):
+ print "%s does not exist!" % options.release_config
+ sys.exit(1)
+
+ config = readReleaseConfig(path.join('buildbot-configs',
+ options.release_config))
+ for key in REQUIRED_CONFIG:
+ if key not in config:
+ err = True
+ print "Required item missing in config: %s" % key
+
+ if err:
+ sys.exit(1)
+ return config
+
+
+if __name__ == "__main__":
+ from optparse import OptionParser
+ parser = OptionParser("")
+
+ parser.add_option("-c", "--config", dest="config")
+ parser.add_option("--platform", dest="platform")
+ parser.add_option("-r", "--release-config-file", dest="release_config",
+ help="The release config file to use.")
+ parser.add_option("-b", "--buildbot-configs", dest="buildbot_configs",
+ help="The place to clone buildbot-configs from",
+ default=os.environ.get('BUILDBOT_CONFIGS_REPO',
+ DEFAULT_BUILDBOT_CONFIGS_REPO))
+ parser.add_option("-t", "--release-tag", dest="release_tag",
+ help="Release tag to update buildbot-configs to")
+ parser.add_option("--channel", dest="channel", default="betatest")
+ parser.add_option("--full-check-locale", dest="full_check_locales",
+ action="append", default=['de', 'en-US', 'ru'])
+ parser.add_option("--output", dest="output")
+
+ options, args = parser.parse_args()
+
+ required_options = ['config', 'platform', 'release_config',
+ 'buildbot_configs', 'release_tag']
+ options_dict = vars(options)
+ for opt in required_options:
+ if not options_dict[opt]:
+ print >> sys.stderr, "Required option %s not present" % opt
+ sys.exit(1)
+
+ update_platform = buildbot2updatePlatforms(options.platform)[-1]
+ ftp_platform = buildbot2ftp(options.platform)
+ full_check_locales = options.full_check_locales
+
+ # Variables from release config
+ retry(mercurial, args=(options.buildbot_configs, 'buildbot-configs'))
+ update('buildbot-configs', revision=options.release_tag)
+ release_config = validate(options)
+ product_name = release_config['productName']
+ staging_server = FTP_SERVER_TEMPLATE % release_config['stagingServer']
+ aus_server_url = release_config['ausServerUrl']
+ build_number = release_config['buildNumber']
+ previous_releases_staging_server = FTP_SERVER_TEMPLATE % \
+ release_config.get('previousReleasesStagingServer',
+ release_config['stagingServer'])
+
+ # Current version data
+ pc = PatcherConfig(open(options.config).read())
+ app_name = pc['appName']
+ to_version = pc['current-update']['to']
+ to_ = makeReleaseRepackUrls(
+ product_name, app_name, to_version, options.platform,
+ locale='%locale%', signed=True, exclude_secondary=True
+ ).values()[0]
+ candidates_dir = makeCandidatesDir(
+ product_name, to_version, build_number, ftp_root='/')
+ to_path = "%s%s" % (candidates_dir, to_)
+
+ partials = pc['current-update']['partials'].keys()
+ # Exclude current version from update verify
+ completes = [c for c in pc['release'].keys() if c != to_version]
+
+ uvc = UpdateVerifyConfig(product=app_name, platform=update_platform,
+ channel=options.channel,
+ aus_server=aus_server_url, to=to_path)
+
+ for v in reversed(sorted(completes, key=LooseVersion)):
+ appVersion = pc['release'][v]['extension-version']
+ build_id = pc['release'][v]['platforms'][ftp_platform]
+ locales = pc['release'][v]['locales']
+ # remove exceptions, e.g. "ja" form mac
+ for locale, platforms in pc['release'][v]['exceptions'].iteritems():
+ if ftp_platform not in platforms:
+ locales.remove(locale)
+ # Exclude locales being full checked
+ quick_check_locales = [l for l in locales
+ if l not in full_check_locales]
+
+ from_ = makeReleaseRepackUrls(
+ product_name, app_name, v, options.platform,
+ locale='%locale%', signed=True, exclude_secondary=True
+ ).values()[0]
+ release_dir = makeReleasesDir(product_name, v, ftp_root='/')
+ from_path = "%s%s" % (release_dir, from_)
+
+ if v in partials:
+ # Full test for all locales
+ # "from" and "to" to be downloaded from the same staging
+ # server in dev environment
+ uvc.addRelease(release=appVersion, build_id=build_id,
+ locales=locales,
+ patch_types=['complete', 'partial'],
+ from_path=from_path, ftp_server_from=staging_server,
+ ftp_server_to=staging_server)
+ else:
+ # Full test for limited locales
+ # "from" and "to" to be downloaded from different staging
+ # server in dev environment
+ uvc.addRelease(release=appVersion, build_id=build_id,
+ locales=full_check_locales, from_path=from_path,
+ ftp_server_from=previous_releases_staging_server,
+ ftp_server_to=staging_server)
+ # Quick test for other locales, no download
+ uvc.addRelease(release=appVersion, build_id=build_id,
+ locales=quick_check_locales)
+ f = open(options.output, 'w')
+ uvc.write(f)

0 comments on commit a91ad2e

Please sign in to comment.