def release_promotion_flavors(self): relpro = find_action('release-promotion', self.actions) avail_flavors = relpro['schema']['properties'][ 'release_promotion_flavor']['enum'] our_flavors = extract_our_flavors(avail_flavors, self.product, self.version, self.partial_updates) return our_flavors
def release_promotion_flavors(self): relpro = find_action("release-promotion", self.actions) avail_flavors = relpro["schema"]["properties"][ "release_promotion_flavor"]["enum"] our_flavors = extract_our_flavors(avail_flavors, self.product, self.version, self.partial_updates, self.product_key) return our_flavors
def generate_phases(self, partner_urls=None, github_token=None): phases = [] previous_graph_ids = [self.decision_task_id] next_version = bump_version(self.version.replace('esr', '')) input_common = { 'build_number': self.build_number, 'next_version': next_version, # specify version rather than relying on in-tree version, # so if a version bump happens between the build and an action task # revision, we still use the correct version. 'version': self.version, 'release_eta': self.release_eta } if not is_partner_enabled(self.product, self.version): input_common['release_enable_partners'] = False if not is_eme_free_enabled(self.product, self.version): input_common['release_enable_emefree'] = False if self.partial_updates: input_common['partial_updates'] = {} for partial_version, info in self.partial_updates.items(): input_common['partial_updates'][partial_version] = { 'buildNumber': info['buildNumber'], 'locales': info['locales'] } target_action = find_action('release-promotion', self.actions) kind = target_action['kind'] if kind != 'hook': raise ValueError(f'Unsupported kind: {kind}') for phase in self.release_promotion_flavors(): input_ = copy.deepcopy(input_common) input_['release_promotion_flavor'] = phase['name'] input_['previous_graph_ids'] = list(previous_graph_ids) hook = generate_action_hook( task_group_id=self.decision_task_id, action_name='release-promotion', actions=self.actions, parameters=self.parameters, input_=input_, ) hook_no_context = {k: v for k, v in hook.items() if k != 'context'} phase_obj = Phase( name=phase['name'], task_id='', task=json.dumps(hook_no_context), context=json.dumps(hook['context']), ) # we need to update input_['previous_graph_ids'] later, because # the task IDs cannot be set for hooks in advance if phase['in_previous_graph_ids']: previous_graph_ids.append(phase['name']) phase_obj.signoffs = self.phase_signoffs(self.branch, self.product, phase['name']) phases.append(phase_obj) self.phases = phases
def generate_phases(self, partner_urls=None, github_token=None): phases = [] previous_graph_ids = [self.decision_task_id] next_version = bump_version(self.version.replace("esr", "")) input_common = { "build_number": self.build_number, "next_version": next_version, # specify version rather than relying on in-tree version, # so if a version bump happens between the build and an action task # revision, we still use the correct version. "version": self.version, "release_eta": self.release_eta, } if not is_partner_enabled(self.product, self.version): input_common["release_enable_partners"] = False if not is_eme_free_enabled(self.product, self.version): input_common["release_enable_emefree"] = False if self.partial_updates: input_common["partial_updates"] = {} for partial_version, info in self.partial_updates.items(): input_common["partial_updates"][partial_version] = { "buildNumber": info["buildNumber"], "locales": info["locales"] } target_action = find_action("release-promotion", self.actions) kind = target_action["kind"] if kind != "hook": raise ValueError(f"Unsupported kind: {kind}") for phase in self.release_promotion_flavors(): input_ = copy.deepcopy(input_common) input_["release_promotion_flavor"] = phase["name"] input_["previous_graph_ids"] = list(previous_graph_ids) hook = generate_action_hook(task_group_id=self.decision_task_id, action_name="release-promotion", actions=self.actions, parameters=self.parameters, input_=input_) hook_no_context = {k: v for k, v in hook.items() if k != "context"} phase_obj = Phase(name=phase["name"], task_id="", task=json.dumps(hook_no_context), context=json.dumps(hook["context"])) # we need to update input_['previous_graph_ids'] later, because # the task IDs cannot be set for hooks in advance if phase["in_previous_graph_ids"]: previous_graph_ids.append(phase["name"]) phase_obj.signoffs = self.phase_signoffs(self.branch, self.product, phase["name"]) phases.append(phase_obj) self.phases = phases
def release_promotion_flavors(self): relpro = find_action("release-promotion", self.actions) # return as is, no sanity check similar to gecko-based products flavors = relpro["schema"]["properties"]["release_promotion_flavor"]["enum"] return [{"name": name, "in_previous_graph_ids": True} for name in flavors]
def release_promotion_flavors(self): relpro = find_action('release-promotion', self.actions) avail_flavors = relpro['schema']['properties']['release_promotion_flavor']['enum'] our_flavors = extract_our_flavors(avail_flavors, self.product, self.version, self.partial_updates) return our_flavors
def generate_phases(self, partner_urls=None, github_token=None): phases = [] previous_graph_ids = [self.decision_task_id] next_version = bump_version(self.version.replace('esr', '')) input_common = { 'build_number': self.build_number, 'next_version': next_version, # specify version rather than relying on in-tree version, # so if a version bump happens between the build and an action task # revision, we still use the correct version. 'version': self.version, 'release_eta': self.release_eta } if not is_partner_enabled(self.product, self.version): input_common['release_enable_partners'] = False if not is_eme_free_enabled(self.product, self.version): input_common['release_enable_emefree'] = False if self.partial_updates: input_common['partial_updates'] = {} for partial_version, info in self.partial_updates.items(): input_common['partial_updates'][partial_version] = { 'buildNumber': info['buildNumber'], 'locales': info['locales'] } target_action = find_action('release-promotion', self.actions) kind = target_action['kind'] for phase in self.release_promotion_flavors(): input_ = copy.deepcopy(input_common) input_['release_promotion_flavor'] = phase['name'] input_['previous_graph_ids'] = list(previous_graph_ids) if kind == 'task': action_task_id, action_task, context = generate_action_task( decision_task_id=self.decision_task_id, action_name='release-promotion', input_=input_, actions=self.actions, ) if phase['in_previous_graph_ids']: previous_graph_ids.append(action_task_id) phase_obj = Phase( phase['name'], action_task_id, json.dumps(action_task), json.dumps(context)) elif kind == 'hook': hook = generate_action_hook( task_group_id=self.decision_task_id, action_name='release-promotion', actions=self.actions, input_=input_, ) hook_no_context = {k: v for k, v in hook.items() if k != 'context'} phase_obj = Phase( name=phase['name'], task_id='', task=json.dumps(hook_no_context), context=json.dumps(hook['context']), ) # we need to update input_['previous_graph_ids'] later, because # the task IDs cannot be set for hooks in advance if phase['in_previous_graph_ids']: previous_graph_ids.append(phase['name']) else: raise ValueError(f'Unsupported kind: {kind}') phase_obj.signoffs = self.phase_signoffs(self.branch, self.product, phase['name']) phases.append(phase_obj) self.phases = phases