Skip to content

Commit d63301e

Browse files
authored
fix: landing when no Jenkins CI has been run for PR (#451)
1 parent aac20a6 commit d63301e

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lib/ci/ci_result_parser.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class Job {
117117

118118
async getBuildData() {
119119
const { cli, path } = this;
120-
cli.startSpinner(`Querying data of ${path}`);
120+
cli.startSpinner(`Querying data for ${path}`);
121121
const data = await this.getAPIData();
122122
cli.stopSpinner('Build data downloaded');
123123
return data;
@@ -679,6 +679,18 @@ class PRBuild extends TestBuild {
679679
const {
680680
result, subBuilds, changeSet, actions, timestamp
681681
} = data;
682+
683+
// No builds found.
684+
if (data.status === '404') {
685+
const failure = new BuildFailure(this, 'No builds found for PR');
686+
this.failures = [failure];
687+
return {
688+
result: data.result,
689+
builds: { failed: [], aborted: [], pending: [], unstable: [] },
690+
failures: this.failures
691+
};
692+
}
693+
682694
this.setBuildData(data);
683695

684696
// No sub build at all

0 commit comments

Comments
 (0)