Skip to content

Commit 90674b5

Browse files
committedOct 5, 2023
fix: link to failure console for "Appeared on" in ncu-ci
Because it's more useful than the computer URL. Also use CI URL for PRs instead of the PR URLs themselves.
1 parent 77da02c commit 90674b5

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed
 

‎lib/ci/failure_aggregator.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ export class FailureAggregator {
4343
.sortBy((f) => parseJobFromURL(f.upstream).jobid)
4444
.map((item) => ({ source: item.source, upstream: item.upstream }))
4545
.value();
46-
const machines = _.uniq(failures.map(f => f.builtOn));
46+
const machines = _.uniqBy(
47+
failures.map(f => ({ hostname: f.builtOn, url: f.url })),
48+
'hostname');
4749
data.push({
4850
reason, type: failures[0].type, failures, prs, machines
4951
});
@@ -91,7 +93,7 @@ export class FailureAggregator {
9193
output += markdownRow('Reason', `<code>${reason}</code>`);
9294
output += markdownRow('-', ':-');
9395
output += markdownRow('Type', type);
94-
const source = prs.map(f => f.source);
96+
const source = prs.map(f => `[${f.source}](${f.upstream})`);
9597
output += markdownRow(
9698
'Failed PR', `${source.length} (${source.join(', ')})`
9799
);
@@ -137,7 +139,7 @@ export class FailureAggregator {
137139
return parsed ? `#${parsed.prid}` : f.source;
138140
});
139141
cli.table('Failed PR', `${source.length} (${source.join(', ')})`);
140-
cli.table('Appeared', machines.join(', '));
142+
cli.table('Appeared', machines.map(m => m.hostname).join(', '));
141143
if (prs.length > 1) {
142144
cli.table('First CI', `${prs[0].upstream}`);
143145
}

‎lib/links.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ export function getPrURL({ owner, repo, prid }) {
106106
return `https://github.com/${owner}/${repo}/pull/${prid}`;
107107
};
108108

109-
export function getMachineUrl(name) {
110-
return `[${name}](https://ci.nodejs.org/computer/${name}/)`;
109+
export function getMachineUrl(machine) {
110+
return `[${machine.hostname}](${machine.url})`;
111111
};
112112

113113
const PR_URL_RE = /PR-URL: https:\/\/github.com\/.+/;

0 commit comments

Comments
 (0)
Please sign in to comment.