From 607f616252390b1ff4a267db0cf2c57c14630231 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 29 Jun 2020 20:18:20 -0700 Subject: [PATCH] fix: landing when no Jenkins CI has been run for PR --- lib/ci/ci_result_parser.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/ci/ci_result_parser.js b/lib/ci/ci_result_parser.js index b8eb34f2..cf1964ed 100644 --- a/lib/ci/ci_result_parser.js +++ b/lib/ci/ci_result_parser.js @@ -117,7 +117,7 @@ class Job { async getBuildData() { const { cli, path } = this; - cli.startSpinner(`Querying data of ${path}`); + cli.startSpinner(`Querying data for ${path}`); const data = await this.getAPIData(); cli.stopSpinner('Build data downloaded'); return data; @@ -679,6 +679,18 @@ class PRBuild extends TestBuild { const { result, subBuilds, changeSet, actions, timestamp } = data; + + // No builds found. + if (data.status === '404') { + const failure = new BuildFailure(this, 'No builds found for PR'); + this.failures = [failure]; + return { + result: data.result, + builds: { failed: [], aborted: [], pending: [], unstable: [] }, + failures: this.failures + }; + } + this.setBuildData(data); // No sub build at all