Skip to content

Commit

Permalink
Merge pull request #262 from trz42/improve_display_of_build_targets
Browse files Browse the repository at this point in the history
Improve display of build targets
  • Loading branch information
Neves-P authored Mar 14, 2024
2 parents 3c060b5 + 31e793a commit 2d15e77
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions eessi_bot_event_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}'")

Expand Down

0 comments on commit 2d15e77

Please sign in to comment.