Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions lib/pr_checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,26 @@ export default class PRChecker {
}
}

checkReviewsAndWait(now, checkComments) {
checkReviewsAndWait(now, checkComments, isReleaseProposal) {
const {
pr, cli, reviewers
} = this;
const { requestedChanges, approved } = reviewers;

const dateStr = new Date(pr.createdAt).toUTCString();
cli.info(`This PR was created on ${dateStr}`);
this.displayReviews(checkComments);

if (isReleaseProposal) {
cli.info('This PR is a release proposal');
return approved.length !== 0;
}

const labels = pr.labels.nodes.map((l) => l.name);

let isFastTracked = labels.includes('fast-track');
const isCodeAndLearn = labels.includes('code-and-learn');
const isSemverMajor = labels.includes('semver-major');

const dateStr = new Date(pr.createdAt).toUTCString();
cli.info(`This PR was created on ${dateStr}`);
this.displayReviews(checkComments);
// NOTE: a semver-major PR with fast-track should have either one of
// these labels removed because that doesn't make sense
if (isFastTracked) {
Expand Down
2 changes: 1 addition & 1 deletion lib/promote_release.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export default class ReleasePromotion extends Session {
const checker = new PRChecker(cli, data, { prid, owner, repo }, { maxCommits: 0 });
const jenkinsReady = checker.checkJenkinsCI();
const githubCIReady = checker.checkGitHubCI();
const isApproved = checker.checkReviewsAndWait(new Date(), false);
const isApproved = checker.checkReviewsAndWait(new Date(), false, true);

return {
githubCIReady,
Expand Down
Loading