diff --git a/eessi_bot_event_handler.py b/eessi_bot_event_handler.py index 74d4d6a1..49f10238 100644 --- a/eessi_bot_event_handler.py +++ b/eessi_bot_event_handler.py @@ -336,15 +336,19 @@ def handle_pull_request_opened_event(self, event_info, pr): arch_map = get_architecture_targets(self.cfg) repo_cfg = get_repo_cfg(self.cfg) - comment = f"Instance `{app_name}` is configured to build:" - - for arch in arch_map.keys(): - # check if repo_target_map contains an entry for {arch} - if arch not in repo_cfg[REPO_TARGET_MAP]: - self.log(f"skipping arch {arch} because repo target map does not define repositories to build for") - continue - for repo_id in repo_cfg[REPO_TARGET_MAP][arch]: - comment += f"\n- arch `{'/'.join(arch.split('/')[1:])}` for repo `{repo_id}`" + comment = f"Instance `{app_name}` is configured to build for:" + architectures = ['/'.join(arch.split('/')[1:]) for arch in arch_map.keys()] + comment += "\n- architectures: " + if len(architectures) > 0: + comment += f"{', '.join([f'`{arch}`' for arch in architectures])}" + else: + comment += "none" + repositories = list(set([repo_id for repo_ids in repo_cfg[REPO_TARGET_MAP].values() for repo_id in repo_ids])) + comment += "\n- repositories: " + if len(repositories) > 0: + comment += f"{', '.join([f'`{repo_id}`' for repo_id in repositories])}" + else: + comment += "none" self.log(f"PR opened: comment '{comment}'")