Skip to content

Commit 3cc1dca

Browse files
committed
Merge pull request #1592 from Altinity/report-merged-prs
Antalya 26.3 Add 'PRs in Release' table to report
1 parent f34b019 commit 3cc1dca

2 files changed

Lines changed: 435 additions & 78 deletions

File tree

.github/actions/create_workflow_report/ci_run_report.html.jinja

Lines changed: 136 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
:root {
1414
--altinity-background: #000D45;
1515
--altinity-accent: #189DCF;
16-
--altinity-highlight: #FFC600;
16+
--altinity-link-hover: #FFC600;
1717
--altinity-gray: #6c757d;
1818
--altinity-light-gray: #f8f9fa;
1919
--altinity-white: #ffffff;
20+
--altinity-hover: color-mix(in srgb, var(--altinity-accent) 12%, var(--altinity-white));
2021
}
2122
2223
/* Body and heading fonts */
@@ -45,7 +46,7 @@
4546
4647
/* General table styling */
4748
table {
48-
min-width: min(900px, 98vw);
49+
min-width: min(900px, 100%);
4950
margin: 1rem 0;
5051
border-collapse: collapse;
5152
background-color: var(--altinity-white);
@@ -107,7 +108,7 @@
107108
108109
/* Table body row styling */
109110
tr:hover {
110-
background-color: var(--altinity-light-gray);
111+
background-color: var(--altinity-hover);
111112
}
112113
113114
/* Table cell styling */
@@ -123,9 +124,72 @@
123124
}
124125
125126
a:hover {
126-
color: var(--altinity-highlight);
127+
color: var(--altinity-link-hover);
127128
text-decoration: underline;
128129
}
130+
131+
/* Tab navigation: wrapping strip; each button is an open-bottom tab shape */
132+
.tab {
133+
display: flex;
134+
flex-wrap: wrap;
135+
gap: 0.4rem;
136+
padding: 0.4rem;
137+
border-radius: 0.75rem;
138+
width: fit-content;
139+
max-width: 100%;
140+
margin: 1.5rem 0;
141+
background: var(--altinity-white);
142+
}
143+
144+
.tab button.tablinks {
145+
appearance: none;
146+
box-sizing: border-box;
147+
border: 1px solid var(--altinity-accent);
148+
border-bottom: 0;
149+
border-radius: 0.5rem 0.5rem 0 0;
150+
background: var(--altinity-white);
151+
padding: 0.55rem 0.95rem;
152+
font: inherit;
153+
cursor: pointer;
154+
white-space: nowrap;
155+
color: var(--altinity-background);
156+
transition: background 0.12s, color 0.12s;
157+
}
158+
159+
.tab button.tablinks:hover {
160+
background: var(--altinity-hover);
161+
}
162+
163+
.tab button.tablinks.active {
164+
background: var(--altinity-hover);
165+
box-shadow: inset 0 2px 0 var(--altinity-accent);
166+
color: var(--altinity-accent);
167+
font-weight: 600;
168+
}
169+
170+
.tabcontent {
171+
display: none;
172+
padding: 0;
173+
overflow-x: auto;
174+
animation: fadeEffect 0.3s;
175+
}
176+
177+
.tabcontent table {
178+
min-width: 0;
179+
}
180+
181+
.tabcontent > *:first-child {
182+
margin-top: 0;
183+
}
184+
185+
.tabcontent.active {
186+
display: block;
187+
}
188+
189+
@keyframes fadeEffect {
190+
from { opacity: 0; }
191+
to { opacity: 1; }
192+
}
129193
</style>
130194
<title>{{ title }}</title>
131195
<link rel="icon" type="image/svg+xml"
@@ -166,46 +230,81 @@
166230
{% if is_preview %}
167231
<p style="font-weight: bold;color: red;">This is a preview. The workflow is not yet finished.</p>
168232
{% endif %}
169-
<h2>Table of Contents</h2>
170-
<ul>
171-
{%- if pr_number != 0 %}<li><a href="#new-fails-pr">New Fails in PR</a> ({{ counts.pr_new_fails }})</li>{% endif %}
172-
<li><a href="#ci-jobs-status">CI Jobs Status</a> ({{ counts.jobs_status }})</li>
173-
<li><a href="#checks-errors">Checks Errors</a> ({{ counts.checks_errors }})</li>
174-
<li><a href="#checks-fails">Checks New Fails</a> ({{ counts.checks_new_fails }})</li>
175-
<li><a href="#regression-fails">Regression New Fails</a> ({{ counts.regression_new_fails }})</li>
176-
<li><a href="#docker-images-cves">Docker Images CVEs</a> ({{ counts.cves }})</li>
177-
<li><a href="#checks-known-fails">Checks Known Fails</a> ({{ counts.checks_known_fails }})</li>
178-
</ul>
179-
180-
{%- if pr_number != 0 -%}
181-
<h2 id="new-fails-pr">New Fails in PR</h2>
182-
<p> Compared with base sha {{ base_sha }} </p>
183-
{{ new_fails_html }}
233+
<div class="tab">
234+
{%- if pr_number == 0 %}<button class="tablinks" onclick="openTab(event, 'prs-in-release')">PRs in Release ({{ counts.prs_in_release }})</button>{% endif %}
235+
{%- if pr_number != 0 %}<button class="tablinks" onclick="openTab(event, 'new-fails-pr')">New Fails in PR ({{ counts.pr_new_fails }})</button>{% endif %}
236+
<button class="tablinks" onclick="openTab(event, 'ci-jobs-status')">CI Jobs Status ({{ counts.jobs_status }})</button>
237+
<button class="tablinks" onclick="openTab(event, 'checks-errors')">Checks Errors ({{ counts.checks_errors }})</button>
238+
<button class="tablinks" onclick="openTab(event, 'checks-fails')">Checks New Fails ({{ counts.checks_new_fails }})</button>
239+
<button class="tablinks" onclick="openTab(event, 'regression-fails')">Regression New Fails ({{ counts.regression_new_fails }})</button>
240+
<button class="tablinks" onclick="openTab(event, 'docker-images-cves')">Docker Images CVEs ({{ counts.cves }})</button>
241+
<button class="tablinks" onclick="openTab(event, 'checks-known-fails')">Checks Known Fails ({{ counts.checks_known_fails }})</button>
242+
</div>
243+
244+
{%- if pr_number == 0 %}
245+
<div id="prs-in-release" class="tabcontent">
246+
{{ prs_in_release_html }}
247+
</div>
184248
{%- endif %}
185249

186-
<h2 id="ci-jobs-status">CI Jobs Status</h2>
187-
{{ ci_jobs_status_html }}
250+
{%- if pr_number != 0 %}
251+
<div id="new-fails-pr" class="tabcontent">
252+
<p>Compared with base sha {{ base_sha }}</p>
253+
{{ new_fails_html }}
254+
</div>
255+
{%- endif %}
256+
257+
<div id="ci-jobs-status" class="tabcontent">
258+
{{ ci_jobs_status_html }}
259+
</div>
188260

189-
<h2 id="checks-errors">Checks Errors</h2>
190-
{{ checks_errors_html }}
261+
<div id="checks-errors" class="tabcontent">
262+
{{ checks_errors_html }}
263+
</div>
191264

192-
<h2 id="checks-fails">Checks New Fails</h2>
193-
{{ checks_fails_html }}
265+
<div id="checks-fails" class="tabcontent">
266+
{{ checks_fails_html }}
267+
</div>
194268

195-
<h2 id="regression-fails">Regression New Fails</h2>
196-
{{ regression_fails_html }}
269+
<div id="regression-fails" class="tabcontent">
270+
{{ regression_fails_html }}
271+
</div>
197272

198-
<h2 id="docker-images-cves">Docker Images CVEs</h2>
199-
{{ docker_images_cves_html }}
273+
<div id="docker-images-cves" class="tabcontent">
274+
{{ docker_images_cves_html }}
275+
</div>
200276

201-
<h2 id="checks-known-fails">Checks Known Fails</h2>
202-
<p>
203-
Fail reason conventions:<br/>
204-
KNOWN - Accepted fail and fix is not planned<br/>
205-
INVESTIGATE - We don't know why it fails<br/>
206-
NEEDSFIX - Investigation done and a fix is needed to make it pass<br/>
207-
</p>
208-
{{ checks_known_fails_html }}
277+
<div id="checks-known-fails" class="tabcontent">
278+
<p>
279+
Fail reason conventions:<br/>
280+
KNOWN - Accepted fail and fix is not planned<br/>
281+
INVESTIGATE - We don't know why it fails<br/>
282+
NEEDSFIX - Investigation done and a fix is needed to make it pass<br/>
283+
</p>
284+
{{ checks_known_fails_html }}
285+
</div>
286+
287+
<script>
288+
function openTab(evt, tabId) {
289+
var i, tabcontent, tablinks;
290+
tabcontent = document.getElementsByClassName('tabcontent');
291+
for (i = 0; i < tabcontent.length; i++) {
292+
tabcontent[i].classList.remove('active');
293+
}
294+
tablinks = document.getElementsByClassName('tablinks');
295+
for (i = 0; i < tablinks.length; i++) {
296+
tablinks[i].classList.remove('active');
297+
}
298+
document.getElementById(tabId).classList.add('active');
299+
evt.currentTarget.classList.add('active');
300+
if (evt.isTrusted) history.replaceState(null, '', '#' + tabId);
301+
}
302+
// Open the tab named in the URL hash, or fall back to CI Jobs Status
303+
var hash = window.location.hash.slice(1);
304+
var startTab = (hash && document.querySelector('.tab button[onclick*="' + hash + '"]'))
305+
|| document.querySelector('.tab button[onclick*="ci-jobs-status"]');
306+
if (startTab) startTab.click();
307+
</script>
209308

210309
<script>
211310
document.addEventListener('click', function (e) {

0 commit comments

Comments
 (0)