@@ -106,10 +106,27 @@ private static void printMarkdown(Appendable appendable, Matrix matrix) throws I
106106 }
107107 appendable .append (lineSeparator ()).append (Stream .concat (
108108 Stream .of (padRight (label , sizes [0 ]), padRight (versionLabel , sizes [1 ])),
109- IntStream .range (0 , matrix .body [i ].length ).mapToObj (j -> padRight (emoji (matrix .body [i ][j ], important ), sizes [j + 2 ]))
109+ IntStream .range (0 , matrix .body [i ].length ).mapToObj (j -> padRight (emoji (matrix .body [i ][j ]. status , important ), sizes [j + 2 ]))
110110 ).collect (toRow ));
111111 }
112112 appendable .append (lineSeparator ()).append (lineSeparator ());
113+ for (int i = 0 ; i < bound ; i ++) {
114+ for (int j = 0 ; j < matrix .body [i ].length ; j ++) {
115+ String msg = matrix .body [i ][j ].message ;
116+ if (msg != null && !msg .isEmpty ()) {
117+ appendable .append ("<details><summary>" )
118+ .append (matrix .rows .get (i ).toProjectLabel ())
119+ .append (" @ " )
120+ .append (matrix .rows .get (i ).toVersionLabel ())
121+ .append (" -> " )
122+ .append (matrix .columns .get (j ).toVersionLabel ())
123+ .append ("</summary>" )
124+ .append (msg )
125+ .append ("</details>" )
126+ .append (lineSeparator ());
127+ }
128+ }
129+ }
113130 }
114131
115132 private static String emoji (ExitStatus exitStatus , boolean important ) {
@@ -166,6 +183,12 @@ private static Map<URI, List<ReportItem>> groupBySourceUri(Report report) {
166183 return report .getItems ().stream ().collect (Collectors .groupingBy (ReportItem ::getSourceUri ));
167184 }
168185
186+ @ lombok .Value
187+ private static class Cell {
188+ ExitStatus status ;
189+ String message ;
190+ }
191+
169192 @ lombok .Value
170193 @ lombok .Builder
171194 private static class Matrix {
@@ -177,15 +200,15 @@ private static class Matrix {
177200 List <Header > columns ;
178201
179202 @ NonNull
180- ExitStatus [][] body ;
203+ Cell [][] body ;
181204
182205 public static Matrix of (URI sourceUri , List <ReportItem > items ) {
183- Map <URI , Map <RefVersion , Map <RefVersion , ExitStatus >>> plugins = items
206+ Map <URI , Map <RefVersion , Map <RefVersion , Cell >>> plugins = items
184207 .stream ()
185208 .collect (
186209 groupingBy (ReportItem ::getTargetUri , LinkedHashMap ::new ,
187210 groupingBy (ReportItem ::getTargetVersion , LinkedHashMap ::new ,
188- toMap (ReportItem ::getSourceVersion , ReportItem :: getExitStatus )))
211+ toMap (ReportItem ::getSourceVersion , item -> new Cell ( item . getExitStatus (), item . getExitMessage ()) )))
189212 );
190213
191214 Set <RefVersion > versions = items
@@ -202,8 +225,8 @@ public static Matrix of(URI sourceUri, List<ReportItem> items) {
202225 .map (version -> new Header (sourceUri , version ))
203226 .collect (toList ()))
204227 .body (plugins .values ().stream ()
205- .flatMap (reports -> reports .values ().stream ().map (z -> versions .stream ().map (z ::get ).map (value -> value != null ? value : ExitStatus .SKIPPED ) .toArray (ExitStatus []::new )))
206- .toArray (ExitStatus [][]::new ))
228+ .flatMap (reports -> reports .values ().stream ().map (z -> versions .stream ().map (z ::get ).map (value -> value != null ? value : new Cell ( ExitStatus .SKIPPED , null )) .toArray (Cell []::new )))
229+ .toArray (Cell [][]::new ))
207230 .build ();
208231 }
209232 }
0 commit comments