Skip to content

Commit

Permalink
-q|--queue: Initial untested support for checking a list of PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardkaindl committed Oct 14, 2024
1 parent 18c1a25 commit 3a676be
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions build_pr_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,7 @@ def parse_args() -> argparse.Namespace:
argparser.add_argument(
"-d", "--download", action="store_true", help="Download and checksum check only"
)
argparser.add_argument("-q", "--queue", type=str, help="Work on a queue file of PRs to check.")
argparser.add_argument(
"-u", "--uninstall", action="store_true", help="Uninstall the installed packages."
)
Expand All @@ -850,6 +851,9 @@ def main(args) -> int:
if args.bootstrap:
return bootstrap_spack()

if args.queue:
return check_queue_file(args)

exitcode = checkout_pr_by_search_query(args)
if exitcode != Success:
return exitcode
Expand All @@ -865,6 +869,18 @@ def main(args) -> int:
return check_and_build(args)


def check_queue_file(args) -> int:
"""Check the queue file of PRs to check."""
with open(args.queue, "r", encoding="utf-8") as queue:
for line in queue:
print("\nChecking PR:", line)
args.checkout = line
exitcode = main(args)
if exitcode != 0:
return exitcode
return Success


def check_and_build(args):
"""Check the PR changes and build the packages."""
# Get the specs to check.
Expand Down

0 comments on commit 3a676be

Please sign in to comment.