Skip to content

Commit

Permalink
fix: landing when no Jenkins CI has been run for PR (#451)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alicia Lopez committed Jun 30, 2020
1 parent a66f5aa commit df6d9d3
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/ci/ci_result_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit df6d9d3

Please sign in to comment.