Skip to content

Commit ecbbe96

Browse files
committed
feat(black-duck): Make the log output show how the origin is determined
Log the query parameter (purl or origin-id) to make obvious how the origin is of each respective package is determined. Signed-off-by: Frank Viernau <x9fviern@zeiss.com>
1 parent 9fde78b commit ecbbe96

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

plugins/advisors/black-duck/src/main/kotlin/BlackDuck.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,10 @@ class BlackDuck(
158158
}
159159

160160
if (origins.isEmpty()) {
161-
logger.info { "No origin found for package '${pkg.id.toCoordinates()}'." }
161+
logger.info { "No origin found for package '${pkg.id.toCoordinates()}', ${pkg.requestParam}." }
162162
} else {
163163
logger.info {
164-
"Found ${origins.size} origin(s) for package '${pkg.id.toCoordinates()}': " +
164+
"Found ${origins.size} origin(s) for package '${pkg.id.toCoordinates()}', ${pkg.requestParam}: " +
165165
"${origins.joinToString { it.identifier }}."
166166
}
167167
}
@@ -243,3 +243,6 @@ private fun Map<Identifier, List<OriginView>>.getSummary(): String =
243243
}
244244

245245
private val Package.blackDuckOriginId: String? get() = labels[BlackDuck.PACKAGE_LABEL_BLACK_DUCK_ORIGIN_ID]
246+
247+
private val Package.requestParam: String get() =
248+
blackDuckOriginId?.let { "origin-id: '$it'" } ?: "purl: '$purl'"

0 commit comments

Comments
 (0)