From fa7ecc8fbdf0afb54fad0c3acec58c3f646758b2 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Tue, 7 Dec 2021 13:51:00 +0100 Subject: [PATCH] maven: Pass the base URL of the Maven instance to the loader I would like to use it as the metadata authority URI in the loader, instead of '{p_url.scheme}://{p_url.netloc}/', which I do not think is accurate, as it is possible to have multiple Maven instances at the same netloc. --- swh/lister/maven/lister.py | 1 + swh/lister/maven/tests/test_lister.py | 1 + 2 files changed, 2 insertions(+) diff --git a/swh/lister/maven/lister.py b/swh/lister/maven/lister.py index 01f6060..81d9e97 100644 --- a/swh/lister/maven/lister.py +++ b/swh/lister/maven/lister.py @@ -302,6 +302,7 @@ class MavenLister(Lister[MavenListerState, RepoPage]): "gid": page["gid"], "aid": page["aid"], "version": page["version"], + "base_url": self.BASE_URL, } ] }, diff --git a/swh/lister/maven/tests/test_lister.py b/swh/lister/maven/tests/test_lister.py index 36a214d..7ed5cdb 100644 --- a/swh/lister/maven/tests/test_lister.py +++ b/swh/lister/maven/tests/test_lister.py @@ -122,6 +122,7 @@ def test_maven_full_listing( assert src.get("gid") == artifact["gid"] assert src.get("aid") == artifact["aid"] assert src.get("version") == artifact["version"] + assert MVN_URL == artifact["base_url"] break else: raise AssertionError