Skip to content
Merged
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
11 changes: 5 additions & 6 deletions src/models/prItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,14 @@ function areRequiredChecksPassing(rawNode) {
}

const { rollup, checkSuites, contexts, required } = getCheckData(rawNode);
if (!rollup || rollup.state === 'SUCCESS') {
if (!rollup && checkSuites.length > 0) {
return false;
}
// GitHub reports CLEAN when nothing blocks the merge. Check suites from apps that
// never report a result (e.g. Codecov) can stay QUEUED forever without a rollup.
if (rawNode.mergeStateStatus === 'CLEAN' || rawNode.mergeStateStatus === 'HAS_HOOKS') {
return true;
}

if (rawNode.mergeStateStatus === 'CLEAN' || rawNode.mergeStateStatus === 'HAS_HOOKS') {
return true;
if (!rollup || rollup.state === 'SUCCESS') {
return rollup !== null || checkSuites.length === 0;
}

// Every required check must have reported and passed
Expand Down
19 changes: 19 additions & 0 deletions tests/testClassifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,25 @@ function withChecks({ rollupState, contexts, required = null, mergeStateStatus,
assertEqual(pr.reasons, ['Approved'], 'Reason is Approved');
}

// 4l. Null rollup with check suites that never report, but GitHub says CLEAN
{
const pr = new PRItem(makePR({
reviewDecision: 'APPROVED',
statusCheckRollup: null,
mergeStateStatus: 'CLEAN',
commits: {
nodes: [{
commit: {
checkSuites: {
nodes: [checkSuite(null, 'QUEUED'), checkSuite(null, 'QUEUED')],
},
},
}],
},
}), viewerLogin);
assertEqual(pr.category, CATEGORIES.READY_TO_MERGE, 'CLEAN PR with stale queued check suites is READY_TO_MERGE');
}

// 5. Action Required: Merge Conflicts
{
const pr = new PRItem(makePR({ mergeable: 'CONFLICTING' }), viewerLogin);
Expand Down
Loading