Skip to content

Commit 279e08f

Browse files
casparvlbedroge
andauthored
Apply suggestions from code review
Co-authored-by: Bob Dröge <[email protected]>
1 parent 6017433 commit 279e08f

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

eessi_bot_event_handler.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -418,15 +418,15 @@ def handle_pull_request_opened_event(self, event_info, pr, req_chatlevel=ChatLev
418418
comment = f"Instance `{app_name}` is configured to build on:"
419419
for node in node_map:
420420
comment += f"\n- Node type `{node}`:"
421-
current_partition = node_map[node]
422-
if "os" in current_partition:
423-
comment += f"\n - OS: `{current_partition['os']}`"
424-
if "cpu_subdir" in current_partition:
425-
comment += f"\n - CPU architecture: `{current_partition['cpu_subdir']}`"
426-
if "repo_targets" in current_partition:
427-
comment += f"\n - Repositories: `{current_partition['repo_targets']}`"
428-
if "accel" in current_partition:
429-
comment += f"\n - Accelerators: `{current_partition['accel']}`"
421+
current_node_type = node_map[node]
422+
if "os" in current_node_type:
423+
comment += f"\n - OS: `{current_node_type['os']}`"
424+
if "cpu_subdir" in current_node_type:
425+
comment += f"\n - CPU architecture: `{current_node_type['cpu_subdir']}`"
426+
if "repo_targets" in current_node_type:
427+
comment += f"\n - Repositories: `{current_node_type['repo_targets']}`"
428+
if "accel" in current_node_type:
429+
comment += f"\n - Accelerators: `{current_node_type['accel']}`"
430430
comment += "\n"
431431

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

tests/test_tools_filter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def test_matching_context(complex_filter):
246246
assert expected == actual
247247

248248

249-
def test_non_match_archictecture_context(complex_filter):
249+
def test_non_match_architecture_context(complex_filter):
250250
context = {"architecture": "x86_64/amd/zen4", "repository": "EESSI", "instance": "mybot", "job": 1234}
251251
expected = False
252252
actual = complex_filter.check_filters(context)

tools/commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def __init__(self, cmd_str):
115115

116116
# If no 'on:' is found in the argument list, everything that follows the 'for:' argument
117117
# (until the next space) is considered the argument list for the action filters
118-
# Essentially, this represents a native build, i.e. the hardware we build on should be the
118+
# Essentially, this represents a native build, i.e. the hardware we build for should be the
119119
# hardware we build on
120120
if not on_found:
121121
for arg in cmd_as_list[1:]:

0 commit comments

Comments
 (0)