Skip to content

Commit ecdfcf7

Browse files
authored
Count failed jobs of the shown tag only on the service line (#23)
1 parent 1324b01 commit ecdfcf7

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

‎README.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,10 @@ the language, and so do warnings and errors from `collect`; texts from GitLab an
119119
Jira's own error details, stay as written.
120120

121121
**Services** lists every service with a production deployment or with rows, and every service that failed to collect,
122-
as one line: what production runs, the picked tag, how many merge requests or commits and Jira tasks it ships, failed jobs
123-
with the ones allowed to fail counted apart, a mark when the range was cut at `RELEASE_SCOPE_MAX_COMMITS`, and how
124-
many rows have no tag yet.
122+
as one line: what production runs, the picked tag, how many merge requests or commits and Jira tasks it ships, the
123+
failed jobs of the picked tag, or of the newest tag before a pick, with the ones allowed to fail counted apart, a mark
124+
when the range was cut at `RELEASE_SCOPE_MAX_COMMITS`, and how many rows have no tag yet. The failed jobs are those of
125+
the tag's pipeline and of the main pipeline of its commit; failures in other rows show only when the line is opened.
125126
Opening a line shows the service's environments, warnings, a link to create the next tag on the head when rows have no
126127
tag yet, merge requests that are not merged yet, and its rows with
127128
tags and their pipelines, merge requests or commits, Jira keys with their status, environments, and failed jobs; rows

‎release_scope/_static/index.html‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -723,14 +723,18 @@ <h3 x-text="t('releasePost')"></h3>
723723
return pipeline ? ICONS[pipeline.status] || pipeline.status : "⚠️";
724724
},
725725
failureCounts(service) {
726-
const pipelines = service.rows.flatMap((row) => [row.main_pipeline, ...row.tags.map((tag) => tag.pipeline)]);
726+
const candidate = this.pickOf(service) || service.candidates[0];
727+
if (!candidate) return "";
728+
const row = service.rows.find((item) => item.tags.some((tag) => tag.name === candidate.tag.name));
729+
const pipelines = [row && row.main_pipeline, candidate.tag.pipeline];
727730
const jobs = pipelines.filter(Boolean).flatMap((pipeline) => pipeline.failed_jobs);
728731
const allowed = jobs.filter((job) => job.allow_failure).length;
729732
const blocking = jobs.length - allowed;
730-
return [
733+
const counts = [
731734
blocking ? this.t("failedCount", { count: blocking }) : "",
732735
allowed ? this.t("allowedCount", { count: allowed }) : "",
733736
].filter(Boolean).join(" · ");
737+
return counts && !this.pickOf(service) ? `${candidate.tag.name}: ${counts}` : counts;
734738
},
735739
failedJobs(row) {
736740
const lines = [];

0 commit comments

Comments
 (0)