Skip to content

Commit

Permalink
[ci] Avoid unintended notifications on failing test comment (elastic#…
Browse files Browse the repository at this point in the history
…174124)

(cherry picked from commit 5951512)
  • Loading branch information
jbudz committed Jan 3, 2024
1 parent 73451ed commit 396a4b2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .buildkite/pipeline-utils/test-failures/annotate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,12 @@ export const getPrComment = (

const logsLink = artifactUrl ? ` [[logs]](${artifactUrl})` : '';

// job name could have #<number> in it, which Github will link to an issue, so we need to "escape" it with spans
return `* [[job]](${jobUrl})${logsLink} ${failure.jobName.replace(
'#',
'#<span></span>'
)} / ${failure.name}`;
// failure name could have #<number>, which Github will link to an issue or @<string>,
// which will send a notification so we need to "escape" it with spans
const failureString = `${failure.jobName} / ${failure.name}`
.replaceAll('#', '#<span></span>')
.replaceAll('@', '@<span></span>');
return `* [[job]](${jobUrl})${logsLink} ${failureString}`;
})
.join('\n')
);
Expand Down

0 comments on commit 396a4b2

Please sign in to comment.