Skip to content

Revert "176989 unifiedCheckRunFlow flag removal" - #5145

Merged
jtmcdole merged 1 commit into
mainfrom
revert-5144-176989-ucr-flag-removal
Sep 8, 2026
Merged

Revert "176989 unifiedCheckRunFlow flag removal"#5145
jtmcdole merged 1 commit into
mainfrom
revert-5144-176989-ucr-flag-removal

Conversation

@ievdokdm

@ievdokdm ievdokdm commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Reverts #5144

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Sep 8, 2026
@ievdokdm
ievdokdm requested a review from jtmcdole September 8, 2026 22:56
@ievdokdm ievdokdm added the autosubmit Merge PR when tree becomes green via auto submit App. label Sep 8, 2026
@jtmcdole
jtmcdole merged commit feaf3e2 into main Sep 8, 2026
17 of 30 checks passed
@jtmcdole

jtmcdole commented Sep 8, 2026

Copy link
Copy Markdown
Member

Gota land the code before you land the flag delete :)

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a unified check run flow feature, allowing consolidated check runs for presubmit tests based on user-specific or global configuration flags. It updates the scheduler, build services, and subscription handlers to support this flow, alongside updating associated tests and fixing platform-related mock usages in the device doctor package. The code review feedback highlights a critical issue where the stage defaults incorrectly to CiStage.fusionTests instead of CiStage.genericTests for non-fusion repositories. Additionally, the reviewer recommends replacing unsafe null assertions (!) on pullRequest.user and pullRequest.user!.login with null-safe fallbacks across several files to prevent potential runtime crashes.

(slug == Config.flutterSlug
? CiStage.fusionTests
: CiStage.genericTests),
stage: stage ?? CiStage.fusionTests,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Defaulting the stage to CiStage.fusionTests for non-fusion repositories (where slug != Config.flutterSlug) is incorrect and can cause mismatches when querying or updating staging documents in Firestore. It should default to CiStage.genericTests for non-fusion repositories.

Suggested change
stage: stage ?? CiStage.fusionTests,
stage:
stage ??
(slug == Config.flutterSlug
? CiStage.fusionTests
: CiStage.genericTests),

Comment on lines +39 to 47
if (dashboardChecks != null &&
pullRequest != null &&
config.flags.isUnifiedCheckRunFlowEnabledForUser(
pullRequest.user!.login!,
)) {
// Create the presubmit_guard and associated presubmit_job documents.
log.info(
'Storing UnifiedCheckRun data for ${slug.fullName}#${pullRequest.number}.',
'Storing UnifiedCheckRun data for ${slug.fullName}#${pullRequest.number} as it enabled for user ${pullRequest.user!.login}.',
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Using the null assertion operator ! on pullRequest.user and pullRequest.user!.login can lead to runtime crashes if the user or login is null (e.g., for certain automated actions or deleted accounts). Use null-safe access with a fallback instead.

    if (dashboardChecks != null &&
        pullRequest != null &&
        config.flags.isUnifiedCheckRunFlowEnabledForUser(
          pullRequest.user?.login ?? '',
        )) {
      // Create the presubmit_guard and associated presubmit_job documents.
      log.info(
        'Storing UnifiedCheckRun data for ${slug.fullName}#${pullRequest.number} as it enabled for user ${pullRequest.user?.login}.',
      );

Comment on lines +296 to 300
final isUnifiedCheckRunFlow = _config.flags
.isUnifiedCheckRunFlowEnabledForUser(pullRequest.user!.login!);
final isOrderedPresubmit = _config.flags.isOrderedPresubmitEnabledForUser(
pullRequest.user!.login!,
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Using the null assertion operator ! on pullRequest.user and pullRequest.user!.login can lead to runtime crashes if the user or login is null. Use null-safe access with a fallback instead.

Suggested change
final isUnifiedCheckRunFlow = _config.flags
.isUnifiedCheckRunFlowEnabledForUser(pullRequest.user!.login!);
final isOrderedPresubmit = _config.flags.isOrderedPresubmitEnabledForUser(
pullRequest.user!.login!,
);
final isUnifiedCheckRunFlow = _config.flags
.isUnifiedCheckRunFlowEnabledForUser(pullRequest.user?.login ?? '');
final isOrderedPresubmit = _config.flags.isOrderedPresubmitEnabledForUser(
pullRequest.user?.login ?? '',
);

Comment on lines +352 to +354
final isUnifiedCheckRun = _config.flags.isUnifiedCheckRunFlowEnabledForUser(
pullRequest.user!.login!,
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Using the null assertion operator ! on pullRequest.user and pullRequest.user!.login can lead to runtime crashes if the user or login is null. Use null-safe access with a fallback instead.

Suggested change
final isUnifiedCheckRun = _config.flags.isUnifiedCheckRunFlowEnabledForUser(
pullRequest.user!.login!,
);
final isUnifiedCheckRun = _config.flags.isUnifiedCheckRunFlowEnabledForUser(
pullRequest.user?.login ?? '',
);

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.

2 participants