Skip to content

Commit

Permalink
fix(ncu-ci): fix missing await causing all CI requests to be reject…
Browse files Browse the repository at this point in the history
…ed (#799)
  • Loading branch information
aduh95 authored Apr 24, 2024
1 parent 78ef163 commit 7fc2f9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/ci/run_ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export class RunPRJob {
this.prData = new PRData({ prid, owner, repo }, cli, request);
this.certifySafe =
certifySafe ||
new PRChecker(cli, this.prData, request, {}).checkCommitsAfterReview();
Promise.all([this.prData.getReviews(), this.prData.getPR()]).then(() =>
new PRChecker(cli, this.prData, request, {}).checkCommitsAfterReview()
);
}

async getCrumb() {
Expand Down Expand Up @@ -68,7 +70,7 @@ export class RunPRJob {
async start() {
const { cli, certifySafe } = this;

if (!certifySafe) {
if (!(await certifySafe)) {
cli.error('Refusing to run CI on potentially unsafe PR');
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/ci_start.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ describe('Jenkins', () => {
const cli = new TestCLI();

sinon.replace(PRChecker.prototype, 'checkCommitsAfterReview',
sinon.fake.returns(certifySafe));
sinon.fake.returns(Promise.resolve(certifySafe)));

const request = {
gql: sinon.stub().returns({
Expand Down

0 comments on commit 7fc2f9d

Please sign in to comment.