Skip to content

many: allow copr:// URLs in --(force|extra-repo)#2461

Draft
supakeen wants to merge 5 commits into
osbuild:mainfrom
supakeen:extra-copr
Draft

many: allow copr:// URLs in --(force|extra-repo)#2461
supakeen wants to merge 5 commits into
osbuild:mainfrom
supakeen:extra-copr

Conversation

@supakeen

@supakeen supakeen commented Jun 24, 2026

Copy link
Copy Markdown
Member

A long time ago we had discussed making it easier to pass certain types of repositories into image-builder. A super common use case is to want to build with a package from a COPR repository.

This PR implements just that. When --force-repo copr://@osbuild/osbuild is passed the COPR API is used to look up the corresponding chroot (based on the distro/arch combination) and a repoconfig is generated from it and used.

The implementation here is slow to the point of it being unusable when a COPR URL is passed. This is because we look up COPR things for the distro*arch combination for all distros when newRegistryImpl is called. This could be addressed a few different ways and I'd like input.

  1. Provide a cache to parseRepoURLs (I tested this; it's way faster).
  2. Move the resolving of COPR URLs later into the process (somewhere in reporegistry?) after we know the actual arch/distro we're targetting.
  3. Don't have extraRepos be a part of that step at all, in that case things are only slow if force-repos is passed.

Which one has preference? The comment that is there seems to hint at the latter but it also feels kinda funky to deal with anything else but RepoConf.

All of this boils down to us needing the reporegistry to determine what we can build.

supakeen added 5 commits June 24, 2026 12:03
Let's be consistent and rename override to force in manifestgen and all
callers of it.

Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
Allow for the appending of repositories on a reporegistry. Also offer a
useful ListArches function to get all the available arches for a
distribution.

Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
We had a comment talking about moving this to the reporegistry. I've
implemented it in a slightly different way in the previous commit but
let's make use of it.

The behavior is covered by tests already.

Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
Include the distribution and architecture in calls to `parseRepoURLs`
and pass them along. This means that `parseRepoURLs` gets called a bunch
more but that's OK they currently contain single strings.

This is necessary because in the future we want to support (for example)
COPR lookups where we'll be using the COPR API to get the correct
information to create a `RepoConfig`. For this we need access to the
additional information to find the correct repository for a given image
type.

Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
Allow passing of `copr://@owner/project` URLs to `--(force|extra)-repo`.

We look up the COPR chroot necessary through the distro/arch that we
pass along. We rename some distro names as they use different chroot
names from our internal names (`centos`) and for RHEL we go from
specific-to-RHEL to EPEL.

Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant