-
Notifications
You must be signed in to change notification settings - Fork 104
Revert "176989 unifiedCheckRunFlow flag removal" #5145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,10 +36,14 @@ final class UnifiedCheckRun { | |
| CheckRun? mergeQueueGuard, | ||
| @visibleForTesting DateTime Function() utcNow = DateTime.timestamp, | ||
| }) async { | ||
| if (dashboardChecks != null && pullRequest != null) { | ||
| 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}.', | ||
| ); | ||
|
Comment on lines
+39
to
47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using the null assertion operator 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}.',
); |
||
| // We store the creation time of the guard since there might be several | ||
| // guards for the same PR created and each new one created after previous | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| // Copyright 2025 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import 'package:json_annotation/json_annotation.dart'; | ||
| import 'package:meta/meta.dart'; | ||
|
|
||
| part 'unified_check_run_flow_flags.g.dart'; | ||
|
|
||
| /// Flags related to content-aware hashing. | ||
| @JsonSerializable() | ||
| @immutable | ||
| final class UnifiedCheckRunFlow { | ||
| /// Default configuration for [UnifiedCheckRunFlow] flags. | ||
| static const defaultInstance = UnifiedCheckRunFlow._( | ||
| useForAll: false, | ||
| useForUsers: [], | ||
| ); | ||
|
|
||
| /// Whether to use unified check-run flow with only one check-run created | ||
| /// for all LUCI tests or github check-run flow. | ||
| @JsonKey() | ||
| final bool useForAll; | ||
|
|
||
| /// List of users to use unified check-run flow. | ||
| @JsonKey() | ||
| final List<String> useForUsers; | ||
|
|
||
| const UnifiedCheckRunFlow._({ | ||
| required this.useForAll, // | ||
| required this.useForUsers, // | ||
| }); | ||
|
|
||
| /// Creates [UnifiedCheckRunFlow] flags from the provided fields. | ||
| /// | ||
| /// Any omitted fields default to the values in [defaultInstance]. | ||
| factory UnifiedCheckRunFlow({bool? useForAll, List<String>? useForUsers}) { | ||
| return UnifiedCheckRunFlow._( | ||
| useForAll: useForAll ?? defaultInstance.useForAll, | ||
| useForUsers: useForUsers ?? defaultInstance.useForUsers, | ||
| ); | ||
| } | ||
|
|
||
| /// Creates [UnifiedCheckRunFlow] flags from a [json] object. | ||
| /// | ||
| /// Any omitted fields default to the values in [defaultInstance]. | ||
| factory UnifiedCheckRunFlow.fromJson(Map<String, Object?>? json) { | ||
| return _$UnifiedCheckRunFlowFromJson(json ?? {}); | ||
| } | ||
|
|
||
| /// The inverse operation of [UnifiedCheckRunFlow.fromJson]. | ||
| Map<String, Object?> toJson() => _$UnifiedCheckRunFlowToJson(this); | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Defaulting the stage to
CiStage.fusionTestsfor non-fusion repositories (whereslug != Config.flutterSlug) is incorrect and can cause mismatches when querying or updating staging documents in Firestore. It should default toCiStage.genericTestsfor non-fusion repositories.