diff --git a/easybuild/framework/easyconfig/tools.py b/easybuild/framework/easyconfig/tools.py index be6ff5fe01..4fb3de77ac 100644 --- a/easybuild/framework/easyconfig/tools.py +++ b/easybuild/framework/easyconfig/tools.py @@ -308,7 +308,7 @@ def get_paths_for(subdir=EASYCONFIGS_PKG_SUBDIR, robot_path=None): return paths -def alt_easyconfig_paths(tmpdir, tweaked_ecs=False, from_prs=None): +def alt_easyconfig_paths(tmpdir, tweaked_ecs=False, from_prs=None, review_pr=None): """Obtain alternative paths for easyconfig files.""" # 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): # paths where files touched in PRs will be downloaded to, # which are picked up via 'pr_paths' build option in fetch_files_from_pr - pr_paths = None + pr_paths = [] if from_prs: - pr_paths = [os.path.join(tmpdir, 'files_pr%s' % pr) for pr in from_prs] + pr_paths = from_prs[:] + if review_pr and review_pr not in pr_paths: + pr_paths.append(review_pr) + + if pr_paths: + pr_paths = [os.path.join(tmpdir, 'files_pr%s' % pr) for pr in pr_paths] return tweaked_ecs_paths, pr_paths diff --git a/easybuild/tools/options.py b/easybuild/tools/options.py index 6d123508a2..126dd701cc 100644 --- a/easybuild/tools/options.py +++ b/easybuild/tools/options.py @@ -1547,10 +1547,16 @@ def set_up_configuration(args=None, logfile=None, testing=False, silent=False): except ValueError: raise EasyBuildError("Argument to --from-pr must be a comma separated list of PR #s.") + try: + review_pr = (lambda x: int(x) if x else None)(eb_go.options.review_pr) + except ValueError: + raise EasyBuildError("Argument to --review-pr must be an integer PR #.") + # determine robot path # --try-X, --dep-graph, --search use robot path for searching, so enable it with path of installed easyconfigs tweaked_ecs = try_to_generate and build_specs - tweaked_ecs_paths, pr_paths = alt_easyconfig_paths(tmpdir, tweaked_ecs=tweaked_ecs, from_prs=from_prs) + tweaked_ecs_paths, pr_paths = alt_easyconfig_paths(tmpdir, tweaked_ecs=tweaked_ecs, from_prs=from_prs, + review_pr=review_pr) auto_robot = try_to_generate or options.check_conflicts or options.dep_graph or search_query robot_path = det_robot_path(options.robot_paths, tweaked_ecs_paths, pr_paths, auto_robot=auto_robot) log.debug("Full robot path: %s", robot_path)