Skip to content

Commit 62ce628

Browse files
authored
Open links in a new tab, show Jira status as a badge, spell out allowed failures (#15)
1 parent 3b84273 commit 62ce628

2 files changed

Lines changed: 25 additions & 14 deletions

File tree

‎README.md‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,11 @@ installed package and change only with it, so the page always matches the report
108108
`report.json` from next to itself; it needs a web server, not a `file://` URL.
109109

110110
**Services** lists every service with a production deployment, and every service that failed to collect, as one
111-
line: what production runs, the picked tag, how many merge requests or commits and Jira tasks it ships, failed jobs,
112-
and a mark when the range was cut at `RELEASE_SCOPE_MAX_COMMITS`. Opening a line shows the service's environments,
113-
warnings, merge requests that are not merged yet, and its rows with tags and their pipelines, merge requests or
114-
commits, Jira keys, environments, and failed jobs; rows out of scope are dimmed. Each tag has a **pick** button:
111+
line: what production runs, the picked tag, how many merge requests or commits and Jira tasks it ships, failed jobs
112+
with the ones allowed to fail counted apart, and a mark when the range was cut at `RELEASE_SCOPE_MAX_COMMITS`.
113+
Opening a line shows the service's environments, warnings, merge requests that are not merged yet, and its rows with
114+
tags and their pipelines, merge requests or commits, Jira keys with their status, environments, and failed jobs; rows
115+
out of scope are dimmed. Links open in a new tab. Each tag has a **pick** button:
115116
picking it highlights the rows it ships and closes the line again. A `--jira` report starts with each service's
116117
release tag picked. Services without a production deployment are left out of the page.
117118

@@ -124,8 +125,8 @@ reload starts from the release tags again.
124125
text box to copy from by hand, since browsers allow the copy button only over HTTPS:
125126

126127
- **Jira tasks**: the keys of every in-scope row from each picked tag down to production, without duplicates, with
127-
summary and status, flagging issues that are not done. Copy them one per line or as a JQL `key in (...)` clause,
128-
each in its own box.
128+
summary and a status badge: grey to do, blue in progress, green done. Copy them one per line or as a JQL
129+
`key in (...)` clause, each in its own box.
129130
- **Tag pipelines**: the pipeline of each picked tag, as a Markdown list.
130131
- **Compare**: a GitLab compare link per service from production to the picked tag, as a Markdown list.
131132
- **Release post**: one Markdown text with a line per picked tag, holding its compare link and pipeline, followed by

‎release_scope/_static/index.html‎

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
66
<title>Release scope</title>
7+
<base target="_blank">
78
<script>
89
if (!/(\/|\.html)$/.test(location.pathname)) location.replace(location.pathname + "/" + location.search + location.hash);
910
</script>
1011
<style>
1112
:root {
1213
--bg: #ffffff; --fg: #1f2328; --muted: #656d76; --border: #d0d7de; --panel: #f6f8fa;
13-
--accent: #0969da; --bad: #cf222e; --warn: #9a6700;
14+
--accent: #0969da; --bad: #cf222e; --warn: #9a6700; --good: #1a7f37;
1415
}
1516
@media (prefers-color-scheme: dark) {
1617
:root {
1718
--bg: #0d1117; --fg: #e6edf3; --muted: #8d96a0; --border: #30363d; --panel: #161b22;
18-
--accent: #4493f8; --bad: #f85149; --warn: #d29922;
19+
--accent: #4493f8; --bad: #f85149; --warn: #d29922; --good: #3fb950;
1920
}
2021
}
2122
[x-cloak] { display: none !important; }
@@ -58,6 +59,10 @@
5859
.service .body { padding: 8px 12px; }
5960
.service .body > p:first-child { margin-top: 0; }
6061
.picked-tag { font-weight: 600; }
62+
.status { display: inline-block; padding: 0 8px; border: 1px solid currentColor; border-radius: 10px; font-size: 12px;
63+
font-weight: 600; white-space: nowrap; color: var(--muted); }
64+
.status-indeterminate { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
65+
.status-done { color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
6166
button.picked { border-color: var(--accent); color: var(--accent); }
6267
</style>
6368
</head>
@@ -76,7 +81,8 @@ <h1 x-text="report.jira_scope.length ? 'Release scope: ' + report.jira_scope.joi
7681
<template x-for="key in report.jira_scope" :key="key">
7782
<li>
7883
<a :href="issue(key) && issue(key).url" x-text="key"></a>
79-
<span x-text="issue(key) ? issue(key).summary + ' · ' + issue(key).status : 'not found in Jira'"></span>
84+
<span x-show="issue(key)" :class="statusClass(issue(key))" x-text="issue(key) && issue(key).status"></span>
85+
<span x-text="issue(key) ? issue(key).summary : 'not found in Jira'"></span>
8086
</li>
8187
</template>
8288
</ul>
@@ -157,7 +163,8 @@ <h2>Services</h2>
157163
<template x-for="key in row.jira_keys" :key="key.key">
158164
<div>
159165
<a :href="key.url" x-text="key.key"></a>
160-
<span x-text="issue(key.key) ? issue(key.key).summary + ' · ' + issue(key.key).status : ''"></span>
166+
<span x-show="issue(key.key)" :class="statusClass(issue(key.key))" x-text="issue(key.key) && issue(key.key).status"></span>
167+
<span x-text="issue(key.key) ? issue(key.key).summary : ''"></span>
161168
</div>
162169
</template>
163170
</td>
@@ -167,7 +174,7 @@ <h2>Services</h2>
167174
<div>
168175
<span x-text="line.label"></span>
169176
<a :href="line.url" x-text="line.name"></a>
170-
<span x-show="line.allowed" class="muted">(allowed)</span>
177+
<span x-show="line.allowed" class="muted">(allowed to fail)</span>
171178
</div>
172179
</template>
173180
</td>
@@ -201,8 +208,8 @@ <h3 x-text="'Jira tasks (' + tasks.length + ')'"></h3>
201208
<template x-for="task in tasks" :key="task.key">
202209
<li>
203210
<a :href="task.url" x-text="task.key"></a>
204-
<span x-text="task.issue ? task.issue.summary + ' · ' + task.issue.status : ''"></span>
205-
<span x-show="task.issue && task.issue.status_category !== 'done'" class="warn">not done</span>
211+
<span x-show="task.issue" :class="statusClass(task.issue)" x-text="task.issue && task.issue.status"></span>
212+
<span x-text="task.issue ? task.issue.summary : ''"></span>
206213
<span x-show="isMissing(task.key)" class="warn">not found in Jira</span>
207214
</li>
208215
</template>
@@ -411,6 +418,9 @@ <h3>Release post</h3>
411418
issue(key) {
412419
return this.report.jira ? this.report.jira.issues[key] : undefined;
413420
},
421+
statusClass(issue) {
422+
return issue ? `status status-${issue.status_category || "new"}` : "";
423+
},
414424
isMissing(key) {
415425
return Boolean(this.report.jira && this.report.jira.missing.includes(key));
416426
},
@@ -439,7 +449,7 @@ <h3>Release post</h3>
439449
const jobs = pipelines.filter(Boolean).flatMap((pipeline) => pipeline.failed_jobs);
440450
const allowed = jobs.filter((job) => job.allow_failure).length;
441451
const blocking = jobs.length - allowed;
442-
return [blocking ? `❌ ${blocking}` : "", allowed ? `⚠️ ${allowed} allowed` : ""].filter(Boolean).join(" · ");
452+
return [blocking ? `❌ ${blocking} failed` : "", allowed ? `${allowed} failed, allowed to fail` : ""].filter(Boolean).join(" · ");
443453
},
444454
failedJobs(row) {
445455
const lines = [];

0 commit comments

Comments
 (0)