Skip to content

Commit 632779e

Browse files
committed
Even more compact format for build scan reports
1 parent d54013b commit 632779e

File tree

3 files changed

+63
-95
lines changed

3 files changed

+63
-95
lines changed

src/main/java/org/hibernate/infra/bot/develocity/DevelocityReportFormatter.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,14 @@ static URI statusUri(DevelocityCIBuildScan buildScan) {
113113
};
114114
}
115115

116-
static String emoji(DevelocityCIBuildScan.Status status) {
116+
static String circleEmoji(DevelocityCIBuildScan.Status status) {
117+
return switch ( status ) {
118+
case SUCCESS -> ":green_circle:";
119+
case FAILURE -> ":red_circle:";
120+
};
121+
}
122+
123+
static String checkEmoji(DevelocityCIBuildScan.Status status) {
117124
return switch ( status ) {
118125
case SUCCESS -> ":white_check_mark:";
119126
case FAILURE -> ":x:";

src/main/resources/templates/DevelocityReportFormatter/summary.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,19 @@ No build scan found for this CI run.
55
!}{#for tagColumn in tagColumns}{!
66
!}| {#if tagColumn.name}{tagColumn.name}{#else}{#if tagColumns.size == 1}Tags{#else}Other tags{/if}{/if} {!
77
!}{/for}{!
8-
!}| Goals | Tests |
8+
!}| Goals | Results |
99
| -- {!
1010
!}{#for tagColumn in tagColumns}| -- {/for}{!
1111
!}| -- | :-: |
1212
{#for buildScan in buildScans}
13-
|{buildScan.status.emoji}{!
14-
!} [:mag:]({buildScan.statusUri} "Build Scan"){!
15-
!} [:link:]({buildScan.jobOrWorkflowUri} "Build"){!
16-
!} [:page_with_curl:]({buildScan.logsUri} "Logs"){!
17-
!} {buildScan.jobOrWorkflow}{!
13+
|[{buildScan.jobOrWorkflow}]({buildScan.jobOrWorkflowUri} "Build"){!
1814
!}{#for tagColumn in tagColumns}{!
1915
!}|{tagColumn.content.get(buildScan).or(list:create()).backQuoted.spaceDelimited}{!
2016
!}{/for}{!
2117
!}|{buildScan.goals.spaceDelimited.backQuoted}{!
22-
!}|{buildScan.testStatus.emoji}{!
23-
!} [:mag:]({buildScan.testsUri} "Tests"){!
18+
!}|[{buildScan.status.circleEmoji}]({buildScan.statusUri} "Build Scan"){!
19+
!} [{buildScan.testStatus.checkEmoji}]({buildScan.testsUri} "Tests"){!
20+
!} [:page_with_curl:]({buildScan.logsUri} "Logs"){!
2421
!}|
2522
{/for}
2623
{/if}

src/test/java/org/hibernate/infra/bot/develocity/DevelocityReportFormatterTest.java

Lines changed: 50 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -66,67 +66,49 @@ void summary_simple() {
6666
);
6767
assertThat( formatter.summary( buildScans, new RepositoryConfig.Develocity.BuildScan() ) )
6868
.isEqualTo( """
69-
| Job/Workflow | Tags | Goals | Tests |
69+
| Job/Workflow | Tags | Goals | Results |
7070
| -- | -- | -- | :-: |
71-
|:white_check_mark:\
72-
[:mag:](https://ge.hibernate.org/s/45fv2rr67ofuy "Build Scan")\
73-
[:link:](https://ci.hibernate.org/job/hibernate-search/job/PR-4125/4/ "Build")\
74-
[:page_with_curl:](https://ge.hibernate.org/s/45fv2rr67ofuy/console-log "Logs")\
75-
GitHub Actions Build\
71+
|[GitHub Actions Build](https://ci.hibernate.org/job/hibernate-search/job/PR-4125/4/ "Build")\
7672
|`Linux` `hibernate-search` `jdk-17` `main`\
7773
|`clean install`\
78-
|:white_check_mark:\
79-
[:mag:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
80-
|
81-
|:white_check_mark:\
82-
[:mag:](https://ge.hibernate.org/s/45fv2rr67ofuy "Build Scan")\
83-
[:link:](https://ci.hibernate.org/job/hibernate-search/job/PR-4125/4/ "Build")\
74+
|[:green_circle:](https://ge.hibernate.org/s/45fv2rr67ofuy "Build Scan")\
75+
[:white_check_mark:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
8476
[:page_with_curl:](https://ge.hibernate.org/s/45fv2rr67ofuy/console-log "Logs")\
85-
GitHub Actions Build\
77+
|
78+
|[GitHub Actions Build](https://ci.hibernate.org/job/hibernate-search/job/PR-4125/4/ "Build")\
8679
|`Linux` `elasticsearch` `elasticsearch-8.13` `h2` `hibernate-search` `jdk-17` `lucene` `main`\
8780
|`clean install`\
88-
|:white_check_mark:\
89-
[:mag:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
90-
|
91-
|:white_check_mark:\
92-
[:mag:](https://ge.hibernate.org/s/45fv2rr67ofuy "Build Scan")\
93-
[:link:](https://ci.hibernate.org/job/hibernate-search/job/PR-4125/4/ "Build")\
81+
|[:green_circle:](https://ge.hibernate.org/s/45fv2rr67ofuy "Build Scan")\
82+
[:white_check_mark:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
9483
[:page_with_curl:](https://ge.hibernate.org/s/45fv2rr67ofuy/console-log "Logs")\
95-
GitHub Actions Build\
84+
|
85+
|[GitHub Actions Build](https://ci.hibernate.org/job/hibernate-search/job/PR-4125/4/ "Build")\
9686
|`Windows Server 2022` `hibernate-search` `jdk-17` `main`\
9787
|`clean install`\
98-
|:white_check_mark:\
99-
[:mag:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
100-
|
101-
|:white_check_mark:\
102-
[:mag:](https://ge.hibernate.org/s/45fv2rr67ofuy "Build Scan")\
103-
[:link:](https://ci.hibernate.org/job/hibernate-search/job/PR-4125/4/ "Build")\
88+
|[:green_circle:](https://ge.hibernate.org/s/45fv2rr67ofuy "Build Scan")\
89+
[:white_check_mark:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
10490
[:page_with_curl:](https://ge.hibernate.org/s/45fv2rr67ofuy/console-log "Logs")\
105-
GitHub Actions Build\
91+
|
92+
|[GitHub Actions Build](https://ci.hibernate.org/job/hibernate-search/job/PR-4125/4/ "Build")\
10693
|`Windows Server 2022` `h2` `hibernate-search` `jdk-17` `lucene` `main`\
10794
|`clean install`\
108-
|:white_check_mark:\
109-
[:mag:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
110-
|
111-
|:white_check_mark:\
112-
[:mag:](https://ge.hibernate.org/s/45fv2rr67ofuy "Build Scan")\
113-
[:link:](https://ci.hibernate.org/job/hibernate-search/job/PR-4125/4/ "Build")\
95+
|[:green_circle:](https://ge.hibernate.org/s/45fv2rr67ofuy "Build Scan")\
96+
[:white_check_mark:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
11497
[:page_with_curl:](https://ge.hibernate.org/s/45fv2rr67ofuy/console-log "Logs")\
115-
hibernate-search/PR-4125\
98+
|
99+
|[hibernate-search/PR-4125](https://ci.hibernate.org/job/hibernate-search/job/PR-4125/4/ "Build")\
116100
|`Linux` `hibernate-search` `jdk-17` `PR-4125`\
117101
|`clean install`\
118-
|:white_check_mark:\
119-
[:mag:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
120-
|
121-
|:x:\
122-
[:mag:](https://ge.hibernate.org/s/45fv2rr67ofuy/failures "Build Scan")\
123-
[:link:](https://ci.hibernate.org/job/hibernate-search/job/PR-4125/4/ "Build")\
102+
|[:green_circle:](https://ge.hibernate.org/s/45fv2rr67ofuy "Build Scan")\
103+
[:white_check_mark:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
124104
[:page_with_curl:](https://ge.hibernate.org/s/45fv2rr67ofuy/console-log "Logs")\
125-
hibernate-search/PR-4125\
105+
|
106+
|[hibernate-search/PR-4125](https://ci.hibernate.org/job/hibernate-search/job/PR-4125/4/ "Build")\
126107
|`Linux` `elasticsearch` `elasticsearch-8.13` `h2` `hibernate-search` `jdk-17` `lucene`\
127108
|`clean verify`\
128-
|:x:\
129-
[:mag:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
109+
|[:red_circle:](https://ge.hibernate.org/s/45fv2rr67ofuy/failures "Build Scan")\
110+
[:x:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
111+
[:page_with_curl:](https://ge.hibernate.org/s/45fv2rr67ofuy/console-log "Logs")\
130112
|
131113
""" );
132114
}
@@ -213,67 +195,49 @@ void summary_tagsConfig() {
213195
)
214196
) ) )
215197
.isEqualTo( """
216-
| Job/Workflow | OS | Java | Backend | DB | Goals | Tests |
198+
| Job/Workflow | OS | Java | Backend | DB | Goals | Results |
217199
| -- | -- | -- | -- | -- | -- | :-: |
218-
|:white_check_mark:\
219-
[:mag:](https://ge.hibernate.org/s/45fv2rr67ofuy "Build Scan")\
220-
[:link:](https://ci.hibernate.org/job/hibernate-search/job/PR-4125/4/ "Build")\
221-
[:page_with_curl:](https://ge.hibernate.org/s/45fv2rr67ofuy/console-log "Logs")\
222-
GitHub Actions Build\
200+
|[GitHub Actions Build](https://ci.hibernate.org/job/hibernate-search/job/PR-4125/4/ "Build")\
223201
|`Linux`|`17`||\
224202
|`clean install`\
225-
|:white_check_mark:\
226-
[:mag:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
227-
|
228-
|:white_check_mark:\
229-
[:mag:](https://ge.hibernate.org/s/45fv2rr67ofuy "Build Scan")\
230-
[:link:](https://ci.hibernate.org/job/hibernate-search/job/PR-4125/4/ "Build")\
203+
|[:green_circle:](https://ge.hibernate.org/s/45fv2rr67ofuy "Build Scan")\
204+
[:white_check_mark:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
231205
[:page_with_curl:](https://ge.hibernate.org/s/45fv2rr67ofuy/console-log "Logs")\
232-
GitHub Actions Build\
206+
|
207+
|[GitHub Actions Build](https://ci.hibernate.org/job/hibernate-search/job/PR-4125/4/ "Build")\
233208
|`Linux`|`17`|`es-8.13` `lucene`|`h2`\
234209
|`clean install`\
235-
|:white_check_mark:\
236-
[:mag:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
237-
|
238-
|:white_check_mark:\
239-
[:mag:](https://ge.hibernate.org/s/45fv2rr67ofuy "Build Scan")\
240-
[:link:](https://ci.hibernate.org/job/hibernate-search/job/PR-4125/4/ "Build")\
210+
|[:green_circle:](https://ge.hibernate.org/s/45fv2rr67ofuy "Build Scan")\
211+
[:white_check_mark:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
241212
[:page_with_curl:](https://ge.hibernate.org/s/45fv2rr67ofuy/console-log "Logs")\
242-
GitHub Actions Build\
213+
|
214+
|[GitHub Actions Build](https://ci.hibernate.org/job/hibernate-search/job/PR-4125/4/ "Build")\
243215
|`Windows`|`17`||\
244216
|`clean install`\
245-
|:white_check_mark:\
246-
[:mag:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
247-
|
248-
|:white_check_mark:\
249-
[:mag:](https://ge.hibernate.org/s/45fv2rr67ofuy "Build Scan")\
250-
[:link:](https://ci.hibernate.org/job/hibernate-search/job/PR-4125/4/ "Build")\
217+
|[:green_circle:](https://ge.hibernate.org/s/45fv2rr67ofuy "Build Scan")\
218+
[:white_check_mark:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
251219
[:page_with_curl:](https://ge.hibernate.org/s/45fv2rr67ofuy/console-log "Logs")\
252-
GitHub Actions Build\
220+
|
221+
|[GitHub Actions Build](https://ci.hibernate.org/job/hibernate-search/job/PR-4125/4/ "Build")\
253222
|`Windows`|`17`|`lucene`|`h2`\
254223
|`clean install`\
255-
|:white_check_mark:\
256-
[:mag:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
257-
|
258-
|:white_check_mark:\
259-
[:mag:](https://ge.hibernate.org/s/45fv2rr67ofuy "Build Scan")\
260-
[:link:](https://ci.hibernate.org/job/hibernate-search/job/PR-4125/4/ "Build")\
224+
|[:green_circle:](https://ge.hibernate.org/s/45fv2rr67ofuy "Build Scan")\
225+
[:white_check_mark:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
261226
[:page_with_curl:](https://ge.hibernate.org/s/45fv2rr67ofuy/console-log "Logs")\
262-
hibernate-search/PR-4125\
227+
|
228+
|[hibernate-search/PR-4125](https://ci.hibernate.org/job/hibernate-search/job/PR-4125/4/ "Build")\
263229
|`Linux`|`17`||\
264230
|`clean install`\
265-
|:white_check_mark:\
266-
[:mag:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
267-
|
268-
|:x:\
269-
[:mag:](https://ge.hibernate.org/s/45fv2rr67ofuy/failures "Build Scan")\
270-
[:link:](https://ci.hibernate.org/job/hibernate-search/job/PR-4125/4/ "Build")\
231+
|[:green_circle:](https://ge.hibernate.org/s/45fv2rr67ofuy "Build Scan")\
232+
[:white_check_mark:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
271233
[:page_with_curl:](https://ge.hibernate.org/s/45fv2rr67ofuy/console-log "Logs")\
272-
hibernate-search/PR-4125\
234+
|
235+
|[hibernate-search/PR-4125](https://ci.hibernate.org/job/hibernate-search/job/PR-4125/4/ "Build")\
273236
|`Linux`|`17`|`es-8.13` `lucene`|`h2`\
274237
|`clean verify`\
275-
|:x:\
276-
[:mag:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
238+
|[:red_circle:](https://ge.hibernate.org/s/45fv2rr67ofuy/failures "Build Scan")\
239+
[:x:](https://ge.hibernate.org/s/45fv2rr67ofuy/tests "Tests")\
240+
[:page_with_curl:](https://ge.hibernate.org/s/45fv2rr67ofuy/console-log "Logs")\
277241
|
278242
""" );
279243
}

0 commit comments

Comments
 (0)