Skip to content

Commit 2d15e77

Browse files
authored
Merge pull request #262 from trz42/improve_display_of_build_targets
Improve display of build targets
2 parents 3c060b5 + 31e793a commit 2d15e77

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

eessi_bot_event_handler.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -336,15 +336,19 @@ def handle_pull_request_opened_event(self, event_info, pr):
336336
arch_map = get_architecture_targets(self.cfg)
337337
repo_cfg = get_repo_cfg(self.cfg)
338338

339-
comment = f"Instance `{app_name}` is configured to build:"
340-
341-
for arch in arch_map.keys():
342-
# check if repo_target_map contains an entry for {arch}
343-
if arch not in repo_cfg[REPO_TARGET_MAP]:
344-
self.log(f"skipping arch {arch} because repo target map does not define repositories to build for")
345-
continue
346-
for repo_id in repo_cfg[REPO_TARGET_MAP][arch]:
347-
comment += f"\n- arch `{'/'.join(arch.split('/')[1:])}` for repo `{repo_id}`"
339+
comment = f"Instance `{app_name}` is configured to build for:"
340+
architectures = ['/'.join(arch.split('/')[1:]) for arch in arch_map.keys()]
341+
comment += "\n- architectures: "
342+
if len(architectures) > 0:
343+
comment += f"{', '.join([f'`{arch}`' for arch in architectures])}"
344+
else:
345+
comment += "none"
346+
repositories = list(set([repo_id for repo_ids in repo_cfg[REPO_TARGET_MAP].values() for repo_id in repo_ids]))
347+
comment += "\n- repositories: "
348+
if len(repositories) > 0:
349+
comment += f"{', '.join([f'`{repo_id}`' for repo_id in repositories])}"
350+
else:
351+
comment += "none"
348352

349353
self.log(f"PR opened: comment '{comment}'")
350354

0 commit comments

Comments
 (0)