Skip to content

Commit

Permalink
fix: link to failure console for "Appeared on" in ncu-ci
Browse files Browse the repository at this point in the history
Because it's more useful than the computer URL.
  • Loading branch information
joyeecheung committed Oct 3, 2023
1 parent f71860a commit 51f5b5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/ci/failure_aggregator.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class FailureAggregator {
.sortBy((f) => parseJobFromURL(f.upstream).jobid)
.map((item) => ({ source: item.source, upstream: item.upstream }))
.value();
const machines = _.uniq(failures.map(f => f.builtOn));
const machines = _.uniq(failures.map(f => ({ hostname: f.builtOn, url: f.url })));
data.push({
reason, type: failures[0].type, failures, prs, machines
});
Expand Down Expand Up @@ -91,7 +91,7 @@ export class FailureAggregator {
output += markdownRow('Reason', `<code>${reason}</code>`);
output += markdownRow('-', ':-');
output += markdownRow('Type', type);
const source = prs.map(f => f.source);
const source = prs.map(f => `[${f.source}](${f.upstream})`);
output += markdownRow(
'Failed PR', `${source.length} (${source.join(', ')})`
);
Expand Down Expand Up @@ -137,7 +137,7 @@ export class FailureAggregator {
return parsed ? `#${parsed.prid}` : f.source;
});
cli.table('Failed PR', `${source.length} (${source.join(', ')})`);
cli.table('Appeared', machines.join(', '));
cli.table('Appeared', machines.map(m => m.hostname).join(', '));
if (prs.length > 1) {
cli.table('First CI', `${prs[0].upstream}`);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/links.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ export function getPrURL({ owner, repo, prid }) {
return `https://github.com/${owner}/${repo}/pull/${prid}`;
};

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

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

0 comments on commit 51f5b5e

Please sign in to comment.