Skip to content

Commit

Permalink
chore: minor fix
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Selwyn-Smith <[email protected]>
  • Loading branch information
benmss committed Dec 4, 2024
1 parent 4f72b16 commit 92f4d51
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/macaron/repo_finder/repo_finder_java.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ def find_repo(self, purl: PackageURL) -> str:

if not version:
logger.info("Version missing for maven artifact: %s:%s", group, artifact)
purl = DepsDevRepoFinder().get_latest_version(purl)
if not purl.version:
latest_purl = DepsDevRepoFinder().get_latest_version(purl)
if not latest_purl or not latest_purl.version:
logger.debug("Could not find version for artifact: %s:%s", purl.namespace, purl.name)
return ""
group = purl.namespace or ""
artifact = purl.name
version = purl.version
group = latest_purl.namespace or ""
artifact = latest_purl.name
version = latest_purl.version

while group and artifact and version and limit > 0:
# Create the URLs for retrieving the artifact's POM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,13 @@ def test_repo_finder() -> int:
if not parsed_url or not repo_validator.resolve_redirects(parsed_url):
return os.EX_UNAVAILABLE

# Test Java package whose SCM metadata only points to the repo in the later versions than is provided here.
# Test Java package whose SCM metadata only points to the repo in later versions than is provided here.
purl = PackageURL.from_string("pkg:maven/io.vertx/[email protected]")
repo = find_repo(purl)
if repo == "https://github.com/eclipse-vertx/vertx-auth":
return os.EX_UNAVAILABLE
latest_purl = DepsDevRepoFinder().get_latest_version(purl)
assert latest_purl
repo = find_repo(latest_purl)
if repo != "https://github.com/eclipse-vertx/vertx-auth":
return os.EX_UNAVAILABLE
Expand Down

0 comments on commit 92f4d51

Please sign in to comment.