Skip to content

Commit c749007

Browse files
authored
jenkins: don't post PR comment on errors when triggering Lite-CI (#241)
As the bot is does not have permission to trigger Jenkins Lite-CI builds for some reason at the moment, and there's feedback about these error comments not being useful to collaborators anyways, those comments are muted for now. Ideally github-bot maintainers should get notified about these errors, as they're obviously not meant to be raised at all. But using node core collaborators as proxy, manually telling bot maintainers about errors surely isn't idealy either. Refs #238 Refs #235 (comment)
1 parent 298e989 commit c749007

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

scripts/trigger-jenkins-build.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,13 @@ function triggerBuildIfValid (options) {
8383
}
8484

8585
triggerBuild(options, function onBuildTriggered (err, result) {
86-
let body = ''
87-
8886
if (err) {
89-
logger.error(err, 'Error while triggering Jenkins build')
90-
body = 'Sadly, an error occurred when I tried to trigger a build. :('
91-
} else {
92-
const jobUrl = `https://ci.nodejs.org/job/${result.jobName}/${result.jobId}`
93-
logger.info({ jobUrl }, 'Jenkins build started')
94-
body = `Lite-CI: ${jobUrl}`
87+
return logger.error(err, 'Error while triggering Jenkins build')
9588
}
9689

97-
createPrComment(options, body)
90+
const jobUrl = `https://ci.nodejs.org/job/${result.jobName}/${result.jobId}`
91+
logger.info({ jobUrl }, 'Jenkins build started')
92+
createPrComment(options, `Lite-CI: ${jobUrl}`)
9893
})
9994
})
10095
}

0 commit comments

Comments
 (0)