Skip to content

Commit f325c59

Browse files
authored
Merge pull request #3979 from jfgrimm/20220317153211_new_pr_IYWSCmQABI
ensure --review-pr can find dependencies included in PR
2 parents d7409b3 + 77af56f commit f325c59

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

easybuild/framework/easyconfig/tools.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def get_paths_for(subdir=EASYCONFIGS_PKG_SUBDIR, robot_path=None):
308308
return paths
309309

310310

311-
def alt_easyconfig_paths(tmpdir, tweaked_ecs=False, from_prs=None):
311+
def alt_easyconfig_paths(tmpdir, tweaked_ecs=False, from_prs=None, review_pr=None):
312312
"""Obtain alternative paths for easyconfig files."""
313313

314314
# paths where tweaked easyconfigs will be placed, easyconfigs listed on the command line take priority and will be
@@ -321,9 +321,14 @@ def alt_easyconfig_paths(tmpdir, tweaked_ecs=False, from_prs=None):
321321

322322
# paths where files touched in PRs will be downloaded to,
323323
# which are picked up via 'pr_paths' build option in fetch_files_from_pr
324-
pr_paths = None
324+
pr_paths = []
325325
if from_prs:
326-
pr_paths = [os.path.join(tmpdir, 'files_pr%s' % pr) for pr in from_prs]
326+
pr_paths = from_prs[:]
327+
if review_pr and review_pr not in pr_paths:
328+
pr_paths.append(review_pr)
329+
330+
if pr_paths:
331+
pr_paths = [os.path.join(tmpdir, 'files_pr%s' % pr) for pr in pr_paths]
327332

328333
return tweaked_ecs_paths, pr_paths
329334

easybuild/tools/options.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1547,10 +1547,16 @@ def set_up_configuration(args=None, logfile=None, testing=False, silent=False):
15471547
except ValueError:
15481548
raise EasyBuildError("Argument to --from-pr must be a comma separated list of PR #s.")
15491549

1550+
try:
1551+
review_pr = (lambda x: int(x) if x else None)(eb_go.options.review_pr)
1552+
except ValueError:
1553+
raise EasyBuildError("Argument to --review-pr must be an integer PR #.")
1554+
15501555
# determine robot path
15511556
# --try-X, --dep-graph, --search use robot path for searching, so enable it with path of installed easyconfigs
15521557
tweaked_ecs = try_to_generate and build_specs
1553-
tweaked_ecs_paths, pr_paths = alt_easyconfig_paths(tmpdir, tweaked_ecs=tweaked_ecs, from_prs=from_prs)
1558+
tweaked_ecs_paths, pr_paths = alt_easyconfig_paths(tmpdir, tweaked_ecs=tweaked_ecs, from_prs=from_prs,
1559+
review_pr=review_pr)
15541560
auto_robot = try_to_generate or options.check_conflicts or options.dep_graph or search_query
15551561
robot_path = det_robot_path(options.robot_paths, tweaked_ecs_paths, pr_paths, auto_robot=auto_robot)
15561562
log.debug("Full robot path: %s", robot_path)

0 commit comments

Comments
 (0)