#72 review_pr.py: Add --arch option to add more copr chroots
Closed a year ago by decathorpe. Opened a year ago by orion.
orion/stewardship-sig review_pr  into  master

file modified
+11 -5
@@ -82,13 +82,16 @@ 

      return ret.returncode == 0



- def copr_repo_create(copr: str):

+ def copr_repo_create(copr: str, arches: list):

      description = "Repository for test-rebuilding packages in preparation for a pull request."


+     cmd = ["copr-cli", "create", "--description", description,

+          "--unlisted-on-hp", "on", "--delete-after-days", "30"]

+     for arch in arches:

+         cmd = cmd + ["--chroot", "fedora-rawhide-%s" % arch]

+     cmd = cmd + [copr]

      ret = sp.run(

-         ["copr-cli", "create", "--description", description,

-          "--unlisted-on-hp", "on", "--delete-after-days", "30",

-          "--chroot", "fedora-rawhide-x86_64", copr],

+         cmd,



@@ -499,6 +502,8 @@ 

                          help="regexes for packages to build from git")

      parser.add_argument("--no-recursive", "-n", action="store_const", const=True, default=False,

                          help="only rebuild directly dependent packages")

+     parser.add_argument("--arch", "-a", action="append", default=[],

+                         help="Add arch to copr chroots (x86_64 by default)")


      args = vars(parser.parse_args())

@@ -512,6 +517,7 @@ 

      exclude = args["exclude"]

      from_git = args["from_git"]

      no_recursive = args["no_recursive"]

+     arch_list: List[str] = ["x86_64"] + args["arch"]


      if noblacklist:

          blacklist = []
@@ -536,7 +542,7 @@ 

          projects.append({"user": user, "package": package, "branch": branch})


      if not copr_repo_exists(copr):

-         copr_repo_create(copr)

+         copr_repo_create(copr, arch_list)

          print("Created COPR repository.")



Some packages are very susceptible to arch differences.

Looks good, with one exception: You add x86_64 unconditionally, which 1) duplicates the value if it's already specified on the CLI, and 2) makes it impossible to not build on x86_64. Could you work around that somehow?

@orion We've moved our scripts and docs to GitHub for use with GitHub Pages. I'll add a CLI switch to modify the copr chroots to the script there. Sorry for the inconvenience.

Pull-Request has been closed by decathorpe

a year ago

@orion the script in the new repo has this feature now:


The script now defaults to fedora-rawhide-x86_64 only if no chroots were specified on the command line.