def determine_testing_configuration(self): """ This method builds a testing matrix either based on an update verification configuration file under the tools repo (release/updates/*.cfg) OR it skips it when we use --installer-url --installer-path Each release info line of the update verification files look similar to the following. NOTE: This shows each pair of information as a new line but in reality there is one white space separting them. We only show the values we care for. release="38.0" platform="Linux_x86_64-gcc3" build_id="20150429135941" locales="ach af ... zh-TW" channel="beta-localtest" from="/firefox/releases/38.0b9/linux-x86_64/%locale%/firefox-38.0b9.tar.bz2" ftp_server_from="http://stage.mozilla.org/pub/mozilla.org" We will store this information in self.releases as a list of releases. NOTE: We will talk of full and quick releases. Full release info normally contains a subset of all locales (except for the most recent releases). A quick release has all locales, however, it misses the fields 'from' and 'ftp_server_from'. Both pairs of information complement each other but differ in such manner. """ if self.installer_url or self.installer_path: return dirs = self.query_abs_dirs() assert os.path.exists(dirs["tools_dir"]), "Without the tools/ checkout we can't use releng's config parser." # Import the config parser sys.path.insert(1, os.path.join(dirs["tools_dir"], "lib", "python")) from release.updates.verify import UpdateVerifyConfig uvc = UpdateVerifyConfig() uvc.read(self.updates_config_file) self.channel = uvc.channel # Filter out any releases that are less than Gecko 38 uvc.releases = [r for r in uvc.releases if int(r["release"].split(".")[0]) >= 38] temp_releases = [] for rel_info in uvc.releases: # This is the full release info if "from" in rel_info and rel_info["from"] is not None: # Let's find the associated quick release which contains the remaining locales # for all releases except for the most recent release which contain all locales quick_release = uvc.getRelease(build_id=rel_info["build_id"], from_path=None) if quick_release != {}: rel_info["locales"] = sorted(rel_info["locales"] + quick_release["locales"]) temp_releases.append(rel_info) uvc.releases = temp_releases chunked_config = uvc.getChunk(chunks=int(self.config["total_chunks"]), thisChunk=int(self.config["this_chunk"])) self.releases = chunked_config.releases
def read_release_update_config(self): ''' Builds a testing matrix based on an update verification configuration file under the tools repository (release/updates/*.cfg). Each release info line of the update verification files look similar to the following. NOTE: This shows each pair of information as a new line but in reality there is one white space separting them. We only show the values we care for. release="38.0" platform="Linux_x86_64-gcc3" build_id="20150429135941" locales="ach af ... zh-TW" channel="beta-localtest" from="/firefox/releases/38.0b9/linux-x86_64/%locale%/firefox-38.0b9.tar.bz2" ftp_server_from="http://stage.mozilla.org/pub/mozilla.org" We will store this information in self.releases as a list of releases. NOTE: We will talk of full and quick releases. Full release info normally contains a subset of all locales (except for the most recent releases). A quick release has all locales, however, it misses the fields 'from' and 'ftp_server_from'. Both pairs of information complement each other but differ in such manner. ''' dirs = self.query_abs_dirs() assert os.path.exists(dirs['abs_tools_dir']), \ 'Without the tools/ checkout we can\'t use releng\'s config parser.' if self.config.get('release_update_config'): # The config file is part of the tools repository. Make sure that if specified # we force a revision of that repository to be set. if self.tools_tag is None: self.fatal('Make sure to specify the --tools-tag') self.release_update_config = self.config['release_update_config'] # Import the config parser sys.path.insert(1, os.path.join(dirs['abs_tools_dir'], 'lib', 'python')) from release.updates.verify import UpdateVerifyConfig uvc = UpdateVerifyConfig() config_file = os.path.join(dirs['abs_tools_dir'], 'release', 'updates', self.config['release_update_config']) uvc.read(config_file) if not hasattr(self, 'update_channel'): self.update_channel = uvc.channel # Filter out any releases that are less than Gecko 38 uvc.releases = [r for r in uvc.releases if int(r['release'].split('.')[0]) >= 38] temp_releases = [] for rel_info in uvc.releases: # This is the full release info if 'from' in rel_info and rel_info['from'] is not None: # Let's find the associated quick release which contains the remaining locales # for all releases except for the most recent release which contain all locales quick_release = uvc.getRelease(build_id=rel_info['build_id'], from_path=None) if quick_release != {}: rel_info['locales'] = sorted(rel_info['locales'] + quick_release['locales']) temp_releases.append(rel_info) uvc.releases = temp_releases chunked_config = uvc.getChunk( chunks=int(self.config['total_chunks']), thisChunk=int(self.config['this_chunk']) ) self.releases = chunked_config.releases
def read_release_update_config(self): ''' Builds a testing matrix based on an update verification configuration file under the tools repository (release/updates/*.cfg). Each release info line of the update verification files look similar to the following. NOTE: This shows each pair of information as a new line but in reality there is one white space separting them. We only show the values we care for. release="38.0" platform="Linux_x86_64-gcc3" build_id="20150429135941" locales="ach af ... zh-TW" channel="beta-localtest" from="/firefox/releases/38.0b9/linux-x86_64/%locale%/firefox-38.0b9.tar.bz2" ftp_server_from="http://archive.mozilla.org/pub" We will store this information in self.releases as a list of releases. NOTE: We will talk of full and quick releases. Full release info normally contains a subset of all locales (except for the most recent releases). A quick release has all locales, however, it misses the fields 'from' and 'ftp_server_from'. Both pairs of information complement each other but differ in such manner. ''' dirs = self.query_abs_dirs() assert os.path.exists(dirs['abs_tools_dir']), \ 'Without the tools/ checkout we can\'t use releng\'s config parser.' if self.config.get('release_update_config'): # The config file is part of the tools repository. Make sure that if specified # we force a revision of that repository to be set. if self.tools_tag is None: self.fatal('Make sure to specify the --tools-tag') self.release_update_config = self.config['release_update_config'] # Import the config parser sys.path.insert(1, os.path.join(dirs['abs_tools_dir'], 'lib', 'python')) from release.updates.verify import UpdateVerifyConfig uvc = UpdateVerifyConfig() config_file = os.path.join(dirs['abs_tools_dir'], 'release', 'updates', self.config['release_update_config']) uvc.read(config_file) if not hasattr(self, 'update_channel'): self.update_channel = uvc.channel # Filter out any releases that are less than Gecko 38 uvc.releases = [ r for r in uvc.releases if int(r['release'].split('.')[0]) >= 38 ] temp_releases = [] for rel_info in uvc.releases: # This is the full release info if 'from' in rel_info and rel_info['from'] is not None: # Let's find the associated quick release which contains the remaining locales # for all releases except for the most recent release which contain all locales quick_release = uvc.getRelease(build_id=rel_info['build_id'], from_path=None) if quick_release != {}: rel_info['locales'] = sorted(rel_info['locales'] + quick_release['locales']) temp_releases.append(rel_info) uvc.releases = temp_releases chunked_config = uvc.getChunk(chunks=int(self.config['total_chunks']), thisChunk=int(self.config['this_chunk'])) self.releases = chunked_config.releases
def determine_testing_configuration(self): ''' This method builds a testing matrix either based on an update verification configuration file under the tools repo (release/updates/*.cfg) OR it skips it when we use --installer-url --installer-path Each release info line of the update verification files look similar to the following. NOTE: This shows each pair of information as a new line but in reality there is one white space separting them. We only show the values we care for. release="38.0" platform="Linux_x86_64-gcc3" build_id="20150429135941" locales="ach af ... zh-TW" channel="beta-localtest" from="/firefox/releases/38.0b9/linux-x86_64/%locale%/firefox-38.0b9.tar.bz2" ftp_server_from="http://stage.mozilla.org/pub/mozilla.org" We will store this information in self.releases as a list of releases. NOTE: We will talk of full and quick releases. Full release info normally contains a subset of all locales (except for the most recent releases). A quick release has all locales, however, it misses the fields 'from' and 'ftp_server_from'. Both pairs of information complement each other but differ in such manner. ''' if self.installer_url or self.installer_path: return dirs = self.query_abs_dirs() assert os.path.exists(dirs['abs_tools_dir']), \ "Without the tools/ checkout we can't use releng's config parser." # Import the config parser sys.path.insert(1, os.path.join(dirs['abs_tools_dir'], 'lib', 'python')) from release.updates.verify import UpdateVerifyConfig uvc = UpdateVerifyConfig() uvc.read(self.updates_config_file) self.channel = uvc.channel # Filter out any releases that are less than Gecko 38 uvc.releases = [r for r in uvc.releases \ if int(r["release"].split('.')[0]) >= 38] temp_releases = [] for rel_info in uvc.releases: # This is the full release info if 'from' in rel_info and rel_info['from'] is not None: # Let's find the associated quick release which contains the remaining locales # for all releases except for the most recent release which contain all locales quick_release = uvc.getRelease(build_id=rel_info['build_id'], from_path=None) if quick_release != {}: rel_info['locales'] = sorted(rel_info['locales'] + quick_release['locales']) temp_releases.append(rel_info) uvc.releases = temp_releases chunked_config = uvc.getChunk(chunks=int(self.config['total_chunks']), thisChunk=int(self.config['this_chunk'])) self.releases = chunked_config.releases