Skip to content

Store buildNumber in presubmitJob on inProgress event#5008

Open
ievdokdm wants to merge 1 commit intomainfrom
176973-buildnum
Open

Store buildNumber in presubmitJob on inProgress event#5008
ievdokdm wants to merge 1 commit intomainfrom
176973-buildnum

Conversation

@ievdokdm
Copy link
Copy Markdown
Contributor

Store buildNumber in presubmitJob on inProgress event

Fix: flutter/flutter#184371

@ievdokdm ievdokdm added autosubmit Merge PR when tree becomes green via auto submit App. CICD Run CI/CD labels Mar 30, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🤖 Hi @ievdokdm, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

## 📋 Review Summary

This pull request correctly adds the storage of the buildNumber in the presubmitJob record during the inProgress state. This ensures that the build number is available for monitoring or debugging purposes as soon as the build starts.

🔍 General Feedback

  • The change is surgical and consistent with the existing logic for handling job completion.
  • I've suggested adding a unit test to verify this behavior and prevent regressions in the future.
  • The use of state.buildNumber is safe because the PresubmitJob.buildNumber setter correctly handles nullable integers.

// completed.
} else if (state.status == TaskStatus.inProgress) {
presubmitJob.startTime = state.startTime!;
presubmitJob.buildNumber = state.buildNumber;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 It would be beneficial to add a unit test to verify that the buildNumber is correctly updated when the task status is inProgress. This ensures that any future changes to this logic don't accidentally drop the build number at this stage.

For example, you could add a test case in app_dart/test/service/firestore/unified_check_run_test.dart:

      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);
      });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App. CICD Run CI/CD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

store build number for job on inProgress event

2 participants