diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d07fc90..edb765b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,2 +1 @@ -Added TrivySummary version and link into the PDF output file footer - +Improved the appearance of comparing two Trivy scans of the same exact artefact \ No newline at end of file diff --git a/src/main/java/com/fujitsu/edgewareroad/trivyutils/dto/history/TrivyTwoScanComparison.java b/src/main/java/com/fujitsu/edgewareroad/trivyutils/dto/history/TrivyTwoScanComparison.java index 1c4ab63..3ff79ff 100644 --- a/src/main/java/com/fujitsu/edgewareroad/trivyutils/dto/history/TrivyTwoScanComparison.java +++ b/src/main/java/com/fujitsu/edgewareroad/trivyutils/dto/history/TrivyTwoScanComparison.java @@ -34,7 +34,16 @@ public TrivyTwoScanComparison( if (artefactNames.size() >= 2) { DateFormat format = DateFormat.getDateInstance(DateFormat.MEDIUM); - title = String.format("Artefacts %s - %s of type %s, between %s and %s", artefactNames.get(0), artefactNames.get(1), artefactType, format.format(fromScanDate), format.format(toScanDate)); + if (artefactNames.get(0).equals(artefactNames.get(1))) + { + // We're comparing the same artefact on different dates + title = String.format("Comparing scans of %s (%s to %s) of type %s", artefactNames.get(0), format.format(fromScanDate), format.format(toScanDate), artefactType); + } + else + { + // We're comparing scans of different artefacts (expected to be different versions of the same logical component) + title = String.format("Comparing %s (scan %s) with %s (scan %s) of type %s", artefactNames.get(0), format.format(fromScanDate), artefactNames.get(1), format.format(toScanDate), artefactType); + } } else { diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index ae2e297..8e78a82 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,4 +1,4 @@ -trivysummary.version=1.1.2 +trivysummary.version=1.1.3 logging.level.root=ERROR diff --git a/src/main/resources/templates/compareTrivyScans.html b/src/main/resources/templates/compareTrivyScans.html index ecd40bf..ca42a40 100644 --- a/src/main/resources/templates/compareTrivyScans.html +++ b/src/main/resources/templates/compareTrivyScans.html @@ -16,7 +16,8 @@

Title

Report date is ...

Today is ...

-

Artefacts scanned are to of type

+

Artefact scanned is of type

+

Artefacts scanned are to of type

WARNING: Artefact names do not indicate these are scans of the same component - comparison may not be valid