From b64ba4c9ac3b8357a2ec6270c3f85563e2c9cf9c Mon Sep 17 00:00:00 2001 From: Phillip Johnsen Date: Sat, 15 Jun 2019 11:31:25 +0200 Subject: [PATCH] jenkins: don't post PR comment on errors when triggering Lite-CI 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 https://github.com/nodejs/github-bot/issues/238 Refs https://github.com/nodejs/github-bot/issues/235#issuecomment-500659506 --- scripts/trigger-jenkins-build.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/scripts/trigger-jenkins-build.js b/scripts/trigger-jenkins-build.js index 6c25348e..3392d6fb 100644 --- a/scripts/trigger-jenkins-build.js +++ b/scripts/trigger-jenkins-build.js @@ -83,18 +83,13 @@ function triggerBuildIfValid (options) { } triggerBuild(options, function onBuildTriggered (err, result) { - let body = '' - if (err) { - logger.error(err, 'Error while triggering Jenkins build') - body = 'Sadly, an error occurred when I tried to trigger a build. :(' - } else { - const jobUrl = `https://ci.nodejs.org/job/${result.jobName}/${result.jobId}` - logger.info({ jobUrl }, 'Jenkins build started') - body = `Lite-CI: ${jobUrl}` + return logger.error(err, 'Error while triggering Jenkins build') } - createPrComment(options, body) + const jobUrl = `https://ci.nodejs.org/job/${result.jobName}/${result.jobId}` + logger.info({ jobUrl }, 'Jenkins build started') + createPrComment(options, `Lite-CI: ${jobUrl}`) }) }) }