From 778735ee8e05e318f924316a87a7ecc613eebd40 Mon Sep 17 00:00:00 2001 From: Dmitry Grand Date: Mon, 27 Jul 2026 11:07:09 -0700 Subject: [PATCH 1/3] feat: update dashboard check runs to in progress during unified flow scheduling --- .../lib/src/service/luci_build_service.dart | 10 +++ .../schedule_try_builds_test.dart | 89 +++++++++++++++++++ 2 files changed, 99 insertions(+) diff --git a/app_dart/lib/src/service/luci_build_service.dart b/app_dart/lib/src/service/luci_build_service.dart index 68614a762..86b9edfcd 100644 --- a/app_dart/lib/src/service/luci_build_service.dart +++ b/app_dart/lib/src/service/luci_build_service.dart @@ -445,6 +445,16 @@ class LuciBuildService { ); } + if (isUnifiedCheckRunFlow && dashboardChecks != null) { + // For unified check run flow, update dashboard checks to in progress. + await _githubChecksUtil.updateCheckRun( + _config, + slug, + dashboardChecks, + status: CheckRunStatus.inProgress, + ); + } + return targets.keys.toList(); } diff --git a/app_dart/test/service/luci_build_service/schedule_try_builds_test.dart b/app_dart/test/service/luci_build_service/schedule_try_builds_test.dart index bafc563e4..ea459b2ee 100644 --- a/app_dart/test/service/luci_build_service/schedule_try_builds_test.dart +++ b/app_dart/test/service/luci_build_service/schedule_try_builds_test.dart @@ -448,6 +448,15 @@ void main() { // Should NOT create individual check runs verifyNever(mockGithubChecksUtil.createCheckRun(any, any, any, any)); + verify( + mockGithubChecksUtil.updateCheckRun( + any, + RepositorySlug.full('flutter/flutter'), + checkRunGuard, + status: CheckRunStatus.inProgress, + ), + ).called(1); + final bbv2.ScheduleBuildRequest scheduleBuild; { final batchRequest = bbv2.BatchRequest().createEmptyInstance(); @@ -528,6 +537,15 @@ void main() { ), ).called(1); + verifyNever( + mockGithubChecksUtil.updateCheckRun( + any, + any, + any, + status: anyNamed('status'), + ), + ); + final bbv2.ScheduleBuildRequest scheduleBuild; { final batchRequest = bbv2.BatchRequest().createEmptyInstance(); @@ -541,6 +559,77 @@ void main() { expect(userData.checkRunId, 456); expect(userData.guardCheckRunId, isNull); }); + + test( + 'does not update dashboard checks when unified flow is disabled', + () async { + final pullRequest = generatePullRequest( + id: 1, + repo: 'flutter', + headSha: 'headsha123', + ); + + final buildTarget = generateTarget( + 1, + properties: {'os': 'abc'}, + slug: RepositorySlug.full('flutter/flutter'), + name: 'Linux foo', + ); + + // Disable Unified Check Run Flow but provide a guard (unexpected but should be handled) + luci = LuciBuildService( + config: FakeConfig( + dynamicConfig: DynamicConfig( + unifiedCheckRunFlow: UnifiedCheckRunFlow(useForAll: false), + ), + ), + cache: CacheService.inMemory(), + buildBucketClient: mockBuildBucketClient, + githubChecksUtil: mockGithubChecksUtil, + pubsub: pubSub, + gerritService: gerritService, + firestore: firestore, + ); + + final checkRunGuard = generateCheckRun(1234, name: 'Guard'); + + when( + mockGithubChecksUtil.createCheckRun(any, any, any, any), + ).thenAnswer((_) async => generateCheckRun(456, name: 'Linux foo')); + + await expectLater( + luci.scheduleTryBuilds( + pullRequest: pullRequest, + targets: [buildTarget], + engineArtifacts: EngineArtifacts.builtFromSource( + commitSha: pullRequest.head!.sha!, + ), + dashboardChecks: checkRunGuard, // Pass guard even though disabled + ), + completion([isTarget.hasName('Linux foo')]), + ); + + // Should NOT update dashboard checks + verifyNever( + mockGithubChecksUtil.updateCheckRun( + any, + any, + any, + status: anyNamed('status'), + ), + ); + + // Should create individual check run because unified flow is disabled + verify( + mockGithubChecksUtil.createCheckRun( + any, + RepositorySlug.full('flutter/flutter'), + 'headsha123', + 'Linux foo', + ), + ).called(1); + }, + ); }); group('Ordered Presubmit', () { From 87a4acdf0b626bbf6e0664a2c3cba759c7b9e7ab Mon Sep 17 00:00:00 2001 From: Dmitry Grand Date: Mon, 27 Jul 2026 11:12:47 -0700 Subject: [PATCH 2/3] try --- .../lib/src/service/luci_build_service.dart | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/app_dart/lib/src/service/luci_build_service.dart b/app_dart/lib/src/service/luci_build_service.dart index 86b9edfcd..679e41a9f 100644 --- a/app_dart/lib/src/service/luci_build_service.dart +++ b/app_dart/lib/src/service/luci_build_service.dart @@ -447,12 +447,22 @@ class LuciBuildService { if (isUnifiedCheckRunFlow && dashboardChecks != null) { // For unified check run flow, update dashboard checks to in progress. - await _githubChecksUtil.updateCheckRun( - _config, - slug, - dashboardChecks, - status: CheckRunStatus.inProgress, - ); + try { + await _githubChecksUtil.updateCheckRun( + _config, + slug, + dashboardChecks, + status: CheckRunStatus.inProgress, + ); + } catch (e, s) { + // We are not going to block on this error. If we cannot find this document + // later, we'll fall back to the old github query method. + log.warn( + 'Failed to update dashboard checks for PR# ${pullRequest.number} to in progress', + e, + s, + ); + } } return targets.keys.toList(); From 153a4df63b17b5c8cffc1fcb589464cb910fda04 Mon Sep 17 00:00:00 2001 From: Dmitry Grand Date: Mon, 27 Jul 2026 11:18:11 -0700 Subject: [PATCH 3/3] comment --- app_dart/lib/src/service/luci_build_service.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app_dart/lib/src/service/luci_build_service.dart b/app_dart/lib/src/service/luci_build_service.dart index 679e41a9f..cfae590e5 100644 --- a/app_dart/lib/src/service/luci_build_service.dart +++ b/app_dart/lib/src/service/luci_build_service.dart @@ -455,8 +455,7 @@ class LuciBuildService { status: CheckRunStatus.inProgress, ); } catch (e, s) { - // We are not going to block on this error. If we cannot find this document - // later, we'll fall back to the old github query method. + // We are not going to block on this error. log.warn( 'Failed to update dashboard checks for PR# ${pullRequest.number} to in progress', e,