diff --git a/app_dart/lib/src/service/firestore/unified_check_run.dart b/app_dart/lib/src/service/firestore/unified_check_run.dart index 53e982358..4ad56cc8d 100644 --- a/app_dart/lib/src/service/firestore/unified_check_run.dart +++ b/app_dart/lib/src/service/firestore/unified_check_run.dart @@ -583,6 +583,7 @@ final class UnifiedCheckRun { // completed. } else if (state.status == TaskStatus.inProgress) { presubmitJob.startTime = state.startTime!; + presubmitJob.buildNumber = state.buildNumber; // If the job is not completed, update the status. if (!status.isComplete) { status = state.status; diff --git a/app_dart/test/service/firestore/unified_check_run_test.dart b/app_dart/test/service/firestore/unified_check_run_test.dart index fcf4aae18..d47b48436 100644 --- a/app_dart/test/service/firestore/unified_check_run_test.dart +++ b/app_dart/test/service/firestore/unified_check_run_test.dart @@ -290,6 +290,36 @@ void main() { expect(result.result, PresubmitGuardConclusionResult.missing); }); + test('updates check status and build number on inProgress', () async { + final state = const PresubmitJobState( + jobName: 'linux', + status: TaskStatus.inProgress, + attemptNumber: 1, + startTime: 2000, + buildNumber: 456, + ); + + final result = await UnifiedCheckRun.markConclusion( + firestoreService: firestoreService, + guardId: guardId, + state: state, + ); + + expect(result.result, PresubmitGuardConclusionResult.ok); + + final checkDoc = await PresubmitJob.fromFirestore( + firestoreService, + PresubmitJobId( + slug: slug, + checkRunId: 123, + jobName: 'linux', + attemptNumber: 1, + ), + ); + expect(checkDoc.status, TaskStatus.inProgress); + expect(checkDoc.startTime, 2000); + expect(checkDoc.buildNumber, 456); + }); }); group('reInitializeFailedChecks', () { late PresubmitGuardId fusionGuardId;