Skip to content

Commit

Permalink
frontend: support build-time dependencies from other storages
Browse files Browse the repository at this point in the history
Fix fedora-copr#3446

When a Copr defines a build-time dependency on `copr://foo/bar` and the
`foo/bar` project uses Pulp storage, the repository baseurl is now generated
correctly.
  • Loading branch information
FrostyX committed Oct 8, 2024
1 parent 3a843bc commit 50ac21e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions frontend/coprs_frontend/coprs/repos.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
from urllib.parse import urlparse, parse_qs, urlunparse, urlencode
import flask
from coprs import app
from coprs.logic.coprs_logic import CoprsLogic
from coprs.exceptions import ObjectNotFound


def generate_repo_url(mock_chroot, url, arch=None):
Expand Down Expand Up @@ -71,10 +73,14 @@ def pre_process_repo_url(chroot, repo_url):
if parsed_url.scheme == "copr":
user = parsed_url.netloc
prj = parsed_url.path.split("/")[1]
repo_url = "/".join([
flask.current_app.config["BACKEND_BASE_URL"],
"results", user, prj, chroot
]) + "/"
try:
copr = CoprsLogic.get_by_ownername_coprname(user, prj)
repo_url = "{0}/{1}/".format(copr.repo_url, chroot)
except ObjectNotFound:
repo_url = "/".join([
flask.current_app.config["BACKEND_BASE_URL"],
"results", user, prj, chroot
]) + "/"

elif "priority" in query:
query.pop("priority")
Expand Down

0 comments on commit 50ac21e

Please sign in to comment.