From f637969f46e620e497c015b30125584530d9e918 Mon Sep 17 00:00:00 2001 From: Kate Lovett Date: Thu, 30 Apr 2026 11:35:34 -0500 Subject: [PATCH 1/4] Consider neutral checks completed --- .../push_gold_status_to_github.dart | 10 +++- .../push_gold_status_to_github_test.dart | 60 ++++++++++++++++++- 2 files changed, 66 insertions(+), 4 deletions(-) diff --git a/app_dart/lib/src/request_handlers/push_gold_status_to_github.dart b/app_dart/lib/src/request_handlers/push_gold_status_to_github.dart index 9a12349b5..b5cbfb987 100644 --- a/app_dart/lib/src/request_handlers/push_gold_status_to_github.dart +++ b/app_dart/lib/src/request_handlers/push_gold_status_to_github.dart @@ -136,7 +136,6 @@ final class PushGoldStatusToGithub extends ApiRequestHandler { checkRuns = checkRuns ?? >[]; log.debug('This PR has ${checkRuns.length} checks.'); for (var checkRun in checkRuns) { - log.debug('Check run: $checkRun'); final name = checkRun['name'].toLowerCase() as String; if (slug == Config.flutterSlug) { if (const [ @@ -160,8 +159,13 @@ final class PushGoldStatusToGithub extends ApiRequestHandler { runsGoldenFileTests = true; } } - if (checkRun['conclusion'] == null || - checkRun['conclusion'].toUpperCase() != 'SUCCESS') { + if (checkRun['status']?.toUpperCase() != 'COMPLETED' || + checkRun['conclusion'] == null || + ![ + 'SUCCESS', + 'NEUTRAL', + ].contains(checkRun['conclusion'].toUpperCase())) { + log.debug('Incomplete check run: $checkRun'); incompleteChecks.add(name); } } diff --git a/app_dart/test/request_handlers/push_gold_status_to_github_test.dart b/app_dart/test/request_handlers/push_gold_status_to_github_test.dart index 097fc6407..9af33c416 100644 --- a/app_dart/test/request_handlers/push_gold_status_to_github_test.dart +++ b/app_dart/test/request_handlers/push_gold_status_to_github_test.dart @@ -361,6 +361,64 @@ void main() { ); }); + test( + 'same commit, neutral checks complete, last status complete', + () async { + // Same commit + final pr = newPullRequest(123, 'abc', 'master'); + prsFromGitHub = [pr]; + + firestore.putDocument( + newGithubGoldStatus( + slug, + pr, + GithubGoldStatus.statusCompleted, + 'abc', + config.flutterGoldSuccessValue!, + ), + ); + + // Neutral checks complete + checkRuns = [ + { + 'name': 'framework', + 'status': 'completed', + 'conclusion': 'neutral', + }, + { + 'name': 'web engine', + 'status': 'completed', + 'conclusion': 'neutral', + }, + ]; + + final body = await tester.get(handler); + expect(body, same(Response.emptyOk)); + expect( + firestore, + existsInStorage(fs.GithubGoldStatus.metadata, [ + isGithubGoldStatus.hasUpdates(0), + ]), + ); + expect(log, hasNoWarningsOrHigher); + + // Should not apply labels or make comments + verifyNever( + issuesService.addLabelsToIssue(slug, pr.number!, [ + kGoldenFileLabel, + ]), + ); + + verifyNever( + issuesService.createComment( + slug, + pr.number!, + argThat(contains(config.flutterGoldCommentID(pr))), + ), + ); + }, + ); + test( 'same commit, checks complete, last status & gold status is running/awaiting triage, should not comment', () async { @@ -1160,7 +1218,7 @@ void main() { checkRuns = [ { 'name': 'framework', - 'completed': 'in_progress', + 'status': 'completed', 'conclusion': 'success', }, ]; From 150f63d518e5605f4d1b4496ac35cda84aa2271b Mon Sep 17 00:00:00 2001 From: Kate Lovett Date: Thu, 30 Apr 2026 13:21:37 -0500 Subject: [PATCH 2/4] Update app_dart/lib/src/request_handlers/push_gold_status_to_github.dart Co-authored-by: John "codefu" McDole --- .../request_handlers/push_gold_status_to_github.dart | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app_dart/lib/src/request_handlers/push_gold_status_to_github.dart b/app_dart/lib/src/request_handlers/push_gold_status_to_github.dart index b5cbfb987..a9bfa66dc 100644 --- a/app_dart/lib/src/request_handlers/push_gold_status_to_github.dart +++ b/app_dart/lib/src/request_handlers/push_gold_status_to_github.dart @@ -159,12 +159,10 @@ final class PushGoldStatusToGithub extends ApiRequestHandler { runsGoldenFileTests = true; } } - if (checkRun['status']?.toUpperCase() != 'COMPLETED' || - checkRun['conclusion'] == null || - ![ - 'SUCCESS', - 'NEUTRAL', - ].contains(checkRun['conclusion'].toUpperCase())) { + const successfulConclusion = {'SUCCESS', 'NEUTRAL'}; + + if (checkRun['status']?.toUpperCase() != 'completed' || + !successfulConclusion.contains(checkRun['conclusion']?.toUpperCase())) { log.debug('Incomplete check run: $checkRun'); incompleteChecks.add(name); } From 2d08fe2470d2c495095bad8474f6277b2d4cb2af Mon Sep 17 00:00:00 2001 From: John McDole Date: Thu, 30 Apr 2026 13:52:25 -0700 Subject: [PATCH 3/4] format --- .../lib/src/request_handlers/push_gold_status_to_github.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app_dart/lib/src/request_handlers/push_gold_status_to_github.dart b/app_dart/lib/src/request_handlers/push_gold_status_to_github.dart index a9bfa66dc..606d383f3 100644 --- a/app_dart/lib/src/request_handlers/push_gold_status_to_github.dart +++ b/app_dart/lib/src/request_handlers/push_gold_status_to_github.dart @@ -162,7 +162,9 @@ final class PushGoldStatusToGithub extends ApiRequestHandler { const successfulConclusion = {'SUCCESS', 'NEUTRAL'}; if (checkRun['status']?.toUpperCase() != 'completed' || - !successfulConclusion.contains(checkRun['conclusion']?.toUpperCase())) { + !successfulConclusion.contains( + checkRun['conclusion']?.toUpperCase(), + )) { log.debug('Incomplete check run: $checkRun'); incompleteChecks.add(name); } From 29a9967acb68b585e3025f64e3d96f340b6add14 Mon Sep 17 00:00:00 2001 From: Kate Lovett Date: Thu, 30 Apr 2026 16:06:03 -0500 Subject: [PATCH 4/4] Fix case comparison for check run status --- .../lib/src/request_handlers/push_gold_status_to_github.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app_dart/lib/src/request_handlers/push_gold_status_to_github.dart b/app_dart/lib/src/request_handlers/push_gold_status_to_github.dart index 606d383f3..44eac3e1b 100644 --- a/app_dart/lib/src/request_handlers/push_gold_status_to_github.dart +++ b/app_dart/lib/src/request_handlers/push_gold_status_to_github.dart @@ -161,7 +161,7 @@ final class PushGoldStatusToGithub extends ApiRequestHandler { } const successfulConclusion = {'SUCCESS', 'NEUTRAL'}; - if (checkRun['status']?.toUpperCase() != 'completed' || + if (checkRun['status']?.toUpperCase() != 'COMPLETED' || !successfulConclusion.contains( checkRun['conclusion']?.toUpperCase(), )) {