Skip to content

Commit 46e36c0

Browse files
committed
chore: add config option to disable latest PURL retrieval, and disable in maven sbom integration test
Signed-off-by: Ben Selwyn-Smith <benselwynsmith@googlemail.com>
1 parent 67d11d7 commit 46e36c0

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/macaron/config/defaults.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ redirect_urls =
6060
gitbox.apache.org
6161
git-wip-us.apache.org
6262
find_source_should_clone = False
63+
try_latest_purl = True
6364

6465
[repofinder.java]
6566
# The list of maven-like repositories to attempt to retrieve artifact POMs from.

src/macaron/repo_finder/repo_finder.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ def find_repo(purl: PackageURL, check_latest_version: bool = True) -> tuple[str,
103103
logger.debug("Analyzing %s with Repo Finder: %s", purl, type(repo_finder))
104104
found_repo, outcome = repo_finder.find_repo(purl)
105105

106+
if check_latest_version and not defaults.getboolean("repofinder", "try_latest_purl"):
107+
check_latest_version = False
108+
106109
if found_repo or not check_latest_version:
107110
return found_repo, outcome
108111

tests/integration/cases/apache_maven_sbom/test.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2024 - 2024, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2024 - 2025, Oracle and/or its affiliates. All rights reserved.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/.
33

44
description: |
@@ -12,6 +12,7 @@ steps:
1212
- name: Run macaron analyze
1313
kind: analyze
1414
options:
15+
ini: config.ini
1516
command_args:
1617
- -purl
1718
- pkg:maven/org.apache.maven/maven@4.0.0-alpha-1-SNAPSHOT?type=pom

0 commit comments

Comments
 (0)