Skip to content

Commit 4ecbdb9

Browse files
authored
fix pending (#637)
1 parent 44144da commit 4ecbdb9

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

app_dart/lib/src/request_handlers/check_for_waiting_pull_requests.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,18 +241,19 @@ bool _checkStatuses(
241241
bool allSuccess = true;
242242
for (Map<String, dynamic> status in statuses) {
243243
final String name = status['context'];
244-
if (status['state'] == 'FAILURE') {
244+
if (status['state'] != 'SUCCESS') {
245245
allSuccess = false;
246-
if (!notInAuthorsControl.contains(name)) {
246+
if (status['state'] == 'FAILURE' && !notInAuthorsControl.contains(name)) {
247247
failures.add(name);
248248
}
249249
}
250250
}
251251
for (Map<String, dynamic> check in checks) {
252252
final String name = check['app']['name'];
253-
if (check['conclusion'] == 'FAILURE') {
253+
if (check['conclusion'] != 'SUCCESS') {
254254
allSuccess = false;
255-
if (!notInAuthorsControl.contains(name)) {
255+
if (check['conclusion'] == 'FAILURE' &&
256+
!notInAuthorsControl.contains(name)) {
256257
failures.add(name);
257258
}
258259
}

app_dart/test/request_handlers/check_for_waiting_pull_requests_test.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,20 @@ void main() {
149149
);
150150
});
151151

152+
test('Does not merge PR with in progress tests', () async {
153+
flutterRepoPRs.add(PullRequestHelper(
154+
lastCommitStatuses: const <StatusHelper>[
155+
StatusHelper('Linux Host', 'PENDING')
156+
],
157+
));
158+
159+
await tester.get(handler);
160+
161+
_verifyQueries();
162+
163+
githubGraphQLClient.verifyMutations(<MutationOptions>[]);
164+
});
165+
152166
test('Does not merge unapproved PR from a hacker', () async {
153167
config.rollerAccountsValue = <String>{'engine-roller', 'skia-roller'};
154168
flutterRepoPRs.add(PullRequestHelper(

0 commit comments

Comments
 (0)