From 0b7364cc0c4ce757d67e6e85ca7aa6f6b7d64ce7 Mon Sep 17 00:00:00 2001 From: "Dmitry Grand (dmgr)" Date: Mon, 14 Sep 2026 14:41:31 -0700 Subject: [PATCH 1/4] Added `checkSuiteFlow` flag. Removed `unifiedCheckRunFlow` flag as no longer needed. --- app_dart/config.yaml | 13 ++--- app_dart/lib/src/generated_config.dart | 13 ++--- .../src/service/flags/check_suite_flow.dart | 52 ++++++++++++++++++ ...w_flags.g.dart => check_suite_flow.g.dart} | 17 +++--- .../lib/src/service/flags/dynamic_config.dart | 21 ++++---- .../src/service/flags/dynamic_config.g.dart | 8 +-- .../flags/unified_check_run_flow_flags.dart | 53 ------------------- 7 files changed, 80 insertions(+), 97 deletions(-) create mode 100644 app_dart/lib/src/service/flags/check_suite_flow.dart rename app_dart/lib/src/service/flags/{unified_check_run_flow_flags.g.dart => check_suite_flow.g.dart} (58%) delete mode 100644 app_dart/lib/src/service/flags/unified_check_run_flow_flags.dart diff --git a/app_dart/config.yaml b/app_dart/config.yaml index 275a1fff4a..8ca5b3e221 100644 --- a/app_dart/config.yaml +++ b/app_dart/config.yaml @@ -28,19 +28,12 @@ dynamicTestSuppression: true # The Gemini model to use for log analysis. geminiModel: gemini-3-flash-preview -# Whether to allow unified check run flow to specific users or to everyone. -unifiedCheckRunFlow: - useForAll: true +# Whether to allow check suite flow to specific users or to everyone. +checkSuiteFlow: + useForAll: false useForUsers: - ievdokdm - eyebrowsoffire - - andywolff - - camsim99 - - walley892 - - loic-sharma - - vashworth - - mboetger - - justinmc # Whether to process LUCI notifications of builds progress ordered within check run. orderedPresubmit: diff --git a/app_dart/lib/src/generated_config.dart b/app_dart/lib/src/generated_config.dart index 8337901621..1da4a8f838 100644 --- a/app_dart/lib/src/generated_config.dart +++ b/app_dart/lib/src/generated_config.dart @@ -32,19 +32,12 @@ dynamicTestSuppression: true # The Gemini model to use for log analysis. geminiModel: gemini-3-flash-preview -# Whether to allow unified check run flow to specific users or to everyone. -unifiedCheckRunFlow: - useForAll: true +# Whether to allow check suite flow to specific users or to everyone. +checkSuiteFlow: + useForAll: false useForUsers: - ievdokdm - eyebrowsoffire - - andywolff - - camsim99 - - walley892 - - loic-sharma - - vashworth - - mboetger - - justinmc # Whether to process LUCI notifications of builds progress ordered within check run. orderedPresubmit: diff --git a/app_dart/lib/src/service/flags/check_suite_flow.dart b/app_dart/lib/src/service/flags/check_suite_flow.dart new file mode 100644 index 0000000000..79c1542ca7 --- /dev/null +++ b/app_dart/lib/src/service/flags/check_suite_flow.dart @@ -0,0 +1,52 @@ +// Copyright 2026 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 'check_suite_flow.g.dart'; + +/// Flag that controls whether to use checks suite flow. +@JsonSerializable() +@immutable +final class CheckSuiteFlow { + /// Default configuration for [CheckSuiteFlow]. + static const defaultInstance = CheckSuiteFlow._( + useForAll: false, + useForUsers: [], + ); + + /// Whether to use checks suite flow for all users. + @JsonKey() + final bool useForAll; + + /// List of users to use checks suite flow. + @JsonKey() + final List useForUsers; + + const CheckSuiteFlow._({ + required this.useForAll, // + required this.useForUsers, // + }); + + /// Creates [CheckSuiteFlow] flags from the provided fields. + /// + /// Any omitted fields default to the values in [defaultInstance]. + factory CheckSuiteFlow({bool? useForAll, List? useForUsers}) { + return CheckSuiteFlow._( + useForAll: useForAll ?? defaultInstance.useForAll, + useForUsers: useForUsers ?? defaultInstance.useForUsers, + ); + } + + /// Creates [CheckSuiteFlow] flags from a [json] object. + /// + /// Any omitted fields default to the values in [defaultInstance]. + factory CheckSuiteFlow.fromJson(Map? json) { + return _$CheckSuiteFlowFromJson(json ?? {}); + } + + /// The inverse operation of [CheckSuiteFlow.fromJson]. + Map toJson() => _$CheckSuiteFlowToJson(this); +} diff --git a/app_dart/lib/src/service/flags/unified_check_run_flow_flags.g.dart b/app_dart/lib/src/service/flags/check_suite_flow.g.dart similarity index 58% rename from app_dart/lib/src/service/flags/unified_check_run_flow_flags.g.dart rename to app_dart/lib/src/service/flags/check_suite_flow.g.dart index 7c8879fe3e..0f5853b6d5 100644 --- a/app_dart/lib/src/service/flags/unified_check_run_flow_flags.g.dart +++ b/app_dart/lib/src/service/flags/check_suite_flow.g.dart @@ -2,23 +2,22 @@ // ignore_for_file: always_specify_types, implicit_dynamic_parameter -part of 'unified_check_run_flow_flags.dart'; +part of 'check_suite_flow.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** -UnifiedCheckRunFlow _$UnifiedCheckRunFlowFromJson(Map json) => - UnifiedCheckRunFlow( +CheckSuiteFlow _$CheckSuiteFlowFromJson(Map json) => + CheckSuiteFlow( useForAll: json['useForAll'] as bool?, useForUsers: (json['useForUsers'] as List?) ?.map((e) => e as String) .toList(), ); -Map _$UnifiedCheckRunFlowToJson( - UnifiedCheckRunFlow instance, -) => { - 'useForAll': instance.useForAll, - 'useForUsers': instance.useForUsers, -}; +Map _$CheckSuiteFlowToJson(CheckSuiteFlow instance) => + { + 'useForAll': instance.useForAll, + 'useForUsers': instance.useForUsers, + }; diff --git a/app_dart/lib/src/service/flags/dynamic_config.dart b/app_dart/lib/src/service/flags/dynamic_config.dart index 0e735074a0..9fe8dbe1c7 100644 --- a/app_dart/lib/src/service/flags/dynamic_config.dart +++ b/app_dart/lib/src/service/flags/dynamic_config.dart @@ -11,11 +11,11 @@ import 'package:meta/meta.dart'; import 'package:yaml/yaml.dart'; import '../../generated_config.dart'; +import 'check_suite_flow.dart'; import 'ci_yaml_flags.dart'; import 'content_aware_hashing_flags.dart'; import 'dynamic_config_updater.dart'; import 'ordered_presubmit_flags.dart'; -import 'unified_check_run_flow_flags.dart'; part 'dynamic_config.g.dart'; @@ -39,7 +39,7 @@ final class DynamicConfig { contentAwareHashing: ContentAwareHashing.defaultInstance, closeMqGuardAfterPresubmit: false, enableGeminiLogAnalysis: false, - unifiedCheckRunFlow: UnifiedCheckRunFlow.defaultInstance, + checkSuiteFlow: CheckSuiteFlow.defaultInstance, orderedPresubmit: OrderedPresubmit.defaultInstance, dynamicTestSuppression: false, geminiModel: 'gemini-3-flash-preview', @@ -69,9 +69,9 @@ final class DynamicConfig { @JsonKey() final bool enableGeminiLogAnalysis; - /// Flags related tp unified check-run flow configuration. + /// Flags related to checks suite flow. @JsonKey() - final UnifiedCheckRunFlow unifiedCheckRunFlow; + final CheckSuiteFlow checkSuiteFlow; /// Flags related to ordered presubmit configuration. @JsonKey() @@ -91,7 +91,7 @@ final class DynamicConfig { required this.contentAwareHashing, required this.closeMqGuardAfterPresubmit, required this.enableGeminiLogAnalysis, - required this.unifiedCheckRunFlow, + required this.checkSuiteFlow, required this.orderedPresubmit, required this.dynamicTestSuppression, required this.geminiModel, @@ -106,7 +106,7 @@ final class DynamicConfig { ContentAwareHashing? contentAwareHashing, bool? closeMqGuardAfterPresubmit, bool? enableGeminiLogAnalysis, - UnifiedCheckRunFlow? unifiedCheckRunFlow, + CheckSuiteFlow? checkSuiteFlow, OrderedPresubmit? orderedPresubmit, bool? dynamicTestSuppression, String? geminiModel, @@ -122,8 +122,7 @@ final class DynamicConfig { defaultInstance.closeMqGuardAfterPresubmit, enableGeminiLogAnalysis: enableGeminiLogAnalysis ?? defaultInstance.enableGeminiLogAnalysis, - unifiedCheckRunFlow: - unifiedCheckRunFlow ?? defaultInstance.unifiedCheckRunFlow, + checkSuiteFlow: checkSuiteFlow ?? defaultInstance.checkSuiteFlow, orderedPresubmit: orderedPresubmit ?? defaultInstance.orderedPresubmit, dynamicTestSuppression: dynamicTestSuppression ?? defaultInstance.dynamicTestSuppression, @@ -159,11 +158,11 @@ final class DynamicConfig { /// The inverse operation of [DynamicConfig.fromJson]. Map toJson() => _$DynamicConfigToJson(this); - bool isUnifiedCheckRunFlowEnabledForUser(String githubUsername) { - if (unifiedCheckRunFlow.useForAll) { + bool isCheckSuiteFlowEnabledForUser(String githubUsername) { + if (checkSuiteFlow.useForAll) { return true; } - return unifiedCheckRunFlow.useForUsers.contains(githubUsername); + return checkSuiteFlow.useForUsers.contains(githubUsername); } bool isOrderedPresubmitEnabledForUser(String githubUsername) { diff --git a/app_dart/lib/src/service/flags/dynamic_config.g.dart b/app_dart/lib/src/service/flags/dynamic_config.g.dart index d958c97c10..51078585a8 100644 --- a/app_dart/lib/src/service/flags/dynamic_config.g.dart +++ b/app_dart/lib/src/service/flags/dynamic_config.g.dart @@ -21,10 +21,10 @@ DynamicConfig _$DynamicConfigFromJson(Map json) => ), closeMqGuardAfterPresubmit: json['closeMqGuardAfterPresubmit'] as bool?, enableGeminiLogAnalysis: json['enableGeminiLogAnalysis'] as bool?, - unifiedCheckRunFlow: json['unifiedCheckRunFlow'] == null + checkSuiteFlow: json['checkSuiteFlow'] == null ? null - : UnifiedCheckRunFlow.fromJson( - json['unifiedCheckRunFlow'] as Map?, + : CheckSuiteFlow.fromJson( + json['checkSuiteFlow'] as Map?, ), orderedPresubmit: json['orderedPresubmit'] == null ? null @@ -42,7 +42,7 @@ Map _$DynamicConfigToJson(DynamicConfig instance) => 'ciYaml': instance.ciYaml.toJson(), 'closeMqGuardAfterPresubmit': instance.closeMqGuardAfterPresubmit, 'enableGeminiLogAnalysis': instance.enableGeminiLogAnalysis, - 'unifiedCheckRunFlow': instance.unifiedCheckRunFlow.toJson(), + 'checkSuiteFlow': instance.checkSuiteFlow.toJson(), 'orderedPresubmit': instance.orderedPresubmit.toJson(), 'dynamicTestSuppression': instance.dynamicTestSuppression, 'geminiModel': instance.geminiModel, diff --git a/app_dart/lib/src/service/flags/unified_check_run_flow_flags.dart b/app_dart/lib/src/service/flags/unified_check_run_flow_flags.dart deleted file mode 100644 index 85cfc47524..0000000000 --- a/app_dart/lib/src/service/flags/unified_check_run_flow_flags.dart +++ /dev/null @@ -1,53 +0,0 @@ -// 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 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? 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? json) { - return _$UnifiedCheckRunFlowFromJson(json ?? {}); - } - - /// The inverse operation of [UnifiedCheckRunFlow.fromJson]. - Map toJson() => _$UnifiedCheckRunFlowToJson(this); -} From fc0336b742f2cb6908f097e5508f932e32144114 Mon Sep 17 00:00:00 2001 From: "Dmitry Grand (dmgr)" Date: Mon, 14 Sep 2026 15:07:23 -0700 Subject: [PATCH 2/4] Update app_dart/lib/src/service/flags/check_suite_flow.dart Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- app_dart/lib/src/service/flags/check_suite_flow.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app_dart/lib/src/service/flags/check_suite_flow.dart b/app_dart/lib/src/service/flags/check_suite_flow.dart index 79c1542ca7..3e41fbbb32 100644 --- a/app_dart/lib/src/service/flags/check_suite_flow.dart +++ b/app_dart/lib/src/service/flags/check_suite_flow.dart @@ -36,7 +36,9 @@ final class CheckSuiteFlow { factory CheckSuiteFlow({bool? useForAll, List? useForUsers}) { return CheckSuiteFlow._( useForAll: useForAll ?? defaultInstance.useForAll, - useForUsers: useForUsers ?? defaultInstance.useForUsers, + useForUsers: useForUsers != null + ? List.unmodifiable(useForUsers) + : defaultInstance.useForUsers, ); } From c5a8b30d7e4e278bc0e952d35b17addcd096fb85 Mon Sep 17 00:00:00 2001 From: "Dmitry Grand (dmgr)" Date: Mon, 14 Sep 2026 15:10:41 -0700 Subject: [PATCH 3/4] case-insensitive comparison --- app_dart/lib/src/service/flags/dynamic_config.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app_dart/lib/src/service/flags/dynamic_config.dart b/app_dart/lib/src/service/flags/dynamic_config.dart index 9fe8dbe1c7..d38cfcf66d 100644 --- a/app_dart/lib/src/service/flags/dynamic_config.dart +++ b/app_dart/lib/src/service/flags/dynamic_config.dart @@ -162,7 +162,10 @@ final class DynamicConfig { if (checkSuiteFlow.useForAll) { return true; } - return checkSuiteFlow.useForUsers.contains(githubUsername); + final usernameLower = githubUsername.toLowerCase(); + return checkSuiteFlow.useForUsers.any( + (user) => user.toLowerCase() == usernameLower, + ); } bool isOrderedPresubmitEnabledForUser(String githubUsername) { From a7dea80f3be11daf293838b1ce5305b89973af18 Mon Sep 17 00:00:00 2001 From: "Dmitry Grand (dmgr)" Date: Tue, 22 Sep 2026 09:36:31 -0700 Subject: [PATCH 4/4] renamed `checkSuiteFlow` flag to `resetFailedCheckRun` --- app_dart/config.yaml | 4 +- app_dart/lib/src/generated_config.dart | 4 +- .../src/service/flags/check_suite_flow.dart | 54 ------------------- .../lib/src/service/flags/dynamic_config.dart | 19 +++---- .../src/service/flags/dynamic_config.g.dart | 8 +-- .../service/flags/reset_failed_check_run.dart | 54 +++++++++++++++++++ ...w.g.dart => reset_failed_check_run.g.dart} | 17 +++--- 7 files changed, 81 insertions(+), 79 deletions(-) delete mode 100644 app_dart/lib/src/service/flags/check_suite_flow.dart create mode 100644 app_dart/lib/src/service/flags/reset_failed_check_run.dart rename app_dart/lib/src/service/flags/{check_suite_flow.g.dart => reset_failed_check_run.g.dart} (58%) diff --git a/app_dart/config.yaml b/app_dart/config.yaml index 8ca5b3e221..12285c6b9c 100644 --- a/app_dart/config.yaml +++ b/app_dart/config.yaml @@ -28,8 +28,8 @@ dynamicTestSuppression: true # The Gemini model to use for log analysis. geminiModel: gemini-3-flash-preview -# Whether to allow check suite flow to specific users or to everyone. -checkSuiteFlow: +# Whether to allow reset failed check run back to in progress to specific users or to everyone. +resetFailedCheckRun: useForAll: false useForUsers: - ievdokdm diff --git a/app_dart/lib/src/generated_config.dart b/app_dart/lib/src/generated_config.dart index 1da4a8f838..cc1804ef6a 100644 --- a/app_dart/lib/src/generated_config.dart +++ b/app_dart/lib/src/generated_config.dart @@ -32,8 +32,8 @@ dynamicTestSuppression: true # The Gemini model to use for log analysis. geminiModel: gemini-3-flash-preview -# Whether to allow check suite flow to specific users or to everyone. -checkSuiteFlow: +# Whether to allow reset failed check run back to in progress to specific users or to everyone. +resetFailedCheckRun: useForAll: false useForUsers: - ievdokdm diff --git a/app_dart/lib/src/service/flags/check_suite_flow.dart b/app_dart/lib/src/service/flags/check_suite_flow.dart deleted file mode 100644 index 3e41fbbb32..0000000000 --- a/app_dart/lib/src/service/flags/check_suite_flow.dart +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2026 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 'check_suite_flow.g.dart'; - -/// Flag that controls whether to use checks suite flow. -@JsonSerializable() -@immutable -final class CheckSuiteFlow { - /// Default configuration for [CheckSuiteFlow]. - static const defaultInstance = CheckSuiteFlow._( - useForAll: false, - useForUsers: [], - ); - - /// Whether to use checks suite flow for all users. - @JsonKey() - final bool useForAll; - - /// List of users to use checks suite flow. - @JsonKey() - final List useForUsers; - - const CheckSuiteFlow._({ - required this.useForAll, // - required this.useForUsers, // - }); - - /// Creates [CheckSuiteFlow] flags from the provided fields. - /// - /// Any omitted fields default to the values in [defaultInstance]. - factory CheckSuiteFlow({bool? useForAll, List? useForUsers}) { - return CheckSuiteFlow._( - useForAll: useForAll ?? defaultInstance.useForAll, - useForUsers: useForUsers != null - ? List.unmodifiable(useForUsers) - : defaultInstance.useForUsers, - ); - } - - /// Creates [CheckSuiteFlow] flags from a [json] object. - /// - /// Any omitted fields default to the values in [defaultInstance]. - factory CheckSuiteFlow.fromJson(Map? json) { - return _$CheckSuiteFlowFromJson(json ?? {}); - } - - /// The inverse operation of [CheckSuiteFlow.fromJson]. - Map toJson() => _$CheckSuiteFlowToJson(this); -} diff --git a/app_dart/lib/src/service/flags/dynamic_config.dart b/app_dart/lib/src/service/flags/dynamic_config.dart index d38cfcf66d..c5a8a0a437 100644 --- a/app_dart/lib/src/service/flags/dynamic_config.dart +++ b/app_dart/lib/src/service/flags/dynamic_config.dart @@ -11,11 +11,11 @@ import 'package:meta/meta.dart'; import 'package:yaml/yaml.dart'; import '../../generated_config.dart'; -import 'check_suite_flow.dart'; import 'ci_yaml_flags.dart'; import 'content_aware_hashing_flags.dart'; import 'dynamic_config_updater.dart'; import 'ordered_presubmit_flags.dart'; +import 'reset_failed_check_run.dart'; part 'dynamic_config.g.dart'; @@ -39,7 +39,7 @@ final class DynamicConfig { contentAwareHashing: ContentAwareHashing.defaultInstance, closeMqGuardAfterPresubmit: false, enableGeminiLogAnalysis: false, - checkSuiteFlow: CheckSuiteFlow.defaultInstance, + resetFailedCheckRun: ResetFailedCheckRun.defaultInstance, orderedPresubmit: OrderedPresubmit.defaultInstance, dynamicTestSuppression: false, geminiModel: 'gemini-3-flash-preview', @@ -71,7 +71,7 @@ final class DynamicConfig { /// Flags related to checks suite flow. @JsonKey() - final CheckSuiteFlow checkSuiteFlow; + final ResetFailedCheckRun resetFailedCheckRun; /// Flags related to ordered presubmit configuration. @JsonKey() @@ -91,7 +91,7 @@ final class DynamicConfig { required this.contentAwareHashing, required this.closeMqGuardAfterPresubmit, required this.enableGeminiLogAnalysis, - required this.checkSuiteFlow, + required this.resetFailedCheckRun, required this.orderedPresubmit, required this.dynamicTestSuppression, required this.geminiModel, @@ -106,7 +106,7 @@ final class DynamicConfig { ContentAwareHashing? contentAwareHashing, bool? closeMqGuardAfterPresubmit, bool? enableGeminiLogAnalysis, - CheckSuiteFlow? checkSuiteFlow, + ResetFailedCheckRun? resetFailedCheckRun, OrderedPresubmit? orderedPresubmit, bool? dynamicTestSuppression, String? geminiModel, @@ -122,7 +122,8 @@ final class DynamicConfig { defaultInstance.closeMqGuardAfterPresubmit, enableGeminiLogAnalysis: enableGeminiLogAnalysis ?? defaultInstance.enableGeminiLogAnalysis, - checkSuiteFlow: checkSuiteFlow ?? defaultInstance.checkSuiteFlow, + resetFailedCheckRun: + resetFailedCheckRun ?? defaultInstance.resetFailedCheckRun, orderedPresubmit: orderedPresubmit ?? defaultInstance.orderedPresubmit, dynamicTestSuppression: dynamicTestSuppression ?? defaultInstance.dynamicTestSuppression, @@ -158,12 +159,12 @@ final class DynamicConfig { /// The inverse operation of [DynamicConfig.fromJson]. Map toJson() => _$DynamicConfigToJson(this); - bool isCheckSuiteFlowEnabledForUser(String githubUsername) { - if (checkSuiteFlow.useForAll) { + bool isResetFailedCheckRunEnabledForUser(String githubUsername) { + if (resetFailedCheckRun.useForAll) { return true; } final usernameLower = githubUsername.toLowerCase(); - return checkSuiteFlow.useForUsers.any( + return resetFailedCheckRun.useForUsers.any( (user) => user.toLowerCase() == usernameLower, ); } diff --git a/app_dart/lib/src/service/flags/dynamic_config.g.dart b/app_dart/lib/src/service/flags/dynamic_config.g.dart index 51078585a8..b5fdb15a67 100644 --- a/app_dart/lib/src/service/flags/dynamic_config.g.dart +++ b/app_dart/lib/src/service/flags/dynamic_config.g.dart @@ -21,10 +21,10 @@ DynamicConfig _$DynamicConfigFromJson(Map json) => ), closeMqGuardAfterPresubmit: json['closeMqGuardAfterPresubmit'] as bool?, enableGeminiLogAnalysis: json['enableGeminiLogAnalysis'] as bool?, - checkSuiteFlow: json['checkSuiteFlow'] == null + resetFailedCheckRun: json['resetFailedCheckRun'] == null ? null - : CheckSuiteFlow.fromJson( - json['checkSuiteFlow'] as Map?, + : ResetFailedCheckRun.fromJson( + json['resetFailedCheckRun'] as Map?, ), orderedPresubmit: json['orderedPresubmit'] == null ? null @@ -42,7 +42,7 @@ Map _$DynamicConfigToJson(DynamicConfig instance) => 'ciYaml': instance.ciYaml.toJson(), 'closeMqGuardAfterPresubmit': instance.closeMqGuardAfterPresubmit, 'enableGeminiLogAnalysis': instance.enableGeminiLogAnalysis, - 'checkSuiteFlow': instance.checkSuiteFlow.toJson(), + 'resetFailedCheckRun': instance.resetFailedCheckRun.toJson(), 'orderedPresubmit': instance.orderedPresubmit.toJson(), 'dynamicTestSuppression': instance.dynamicTestSuppression, 'geminiModel': instance.geminiModel, diff --git a/app_dart/lib/src/service/flags/reset_failed_check_run.dart b/app_dart/lib/src/service/flags/reset_failed_check_run.dart new file mode 100644 index 0000000000..7ca83030f4 --- /dev/null +++ b/app_dart/lib/src/service/flags/reset_failed_check_run.dart @@ -0,0 +1,54 @@ +// Copyright 2026 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 'reset_failed_check_run.g.dart'; + +/// Flag that controls whether to reset failed check run to in progress. +@JsonSerializable() +@immutable +final class ResetFailedCheckRun { + /// Default configuration for [ResetFailedCheckRun]. + static const defaultInstance = ResetFailedCheckRun._( + useForAll: false, + useForUsers: [], + ); + + /// Whether to to reset failed check run to in progress for all users. + @JsonKey() + final bool useForAll; + + /// List of users to to reset failed check run to in progress. + @JsonKey() + final List useForUsers; + + const ResetFailedCheckRun._({ + required this.useForAll, + required this.useForUsers, + }); + + /// Creates [ResetFailedCheckRun] flags from the provided fields. + /// + /// Any omitted fields default to the values in [defaultInstance]. + factory ResetFailedCheckRun({bool? useForAll, List? useForUsers}) { + return ResetFailedCheckRun._( + useForAll: useForAll ?? defaultInstance.useForAll, + useForUsers: useForUsers != null + ? List.unmodifiable(useForUsers) + : defaultInstance.useForUsers, + ); + } + + /// Creates [ResetFailedCheckRun] flags from a [json] object. + /// + /// Any omitted fields default to the values in [defaultInstance]. + factory ResetFailedCheckRun.fromJson(Map? json) { + return _$ResetFailedCheckRunFromJson(json ?? {}); + } + + /// The inverse operation of [ResetFailedCheckRun.fromJson]. + Map toJson() => _$ResetFailedCheckRunToJson(this); +} diff --git a/app_dart/lib/src/service/flags/check_suite_flow.g.dart b/app_dart/lib/src/service/flags/reset_failed_check_run.g.dart similarity index 58% rename from app_dart/lib/src/service/flags/check_suite_flow.g.dart rename to app_dart/lib/src/service/flags/reset_failed_check_run.g.dart index 0f5853b6d5..39ecc2d92d 100644 --- a/app_dart/lib/src/service/flags/check_suite_flow.g.dart +++ b/app_dart/lib/src/service/flags/reset_failed_check_run.g.dart @@ -2,22 +2,23 @@ // ignore_for_file: always_specify_types, implicit_dynamic_parameter -part of 'check_suite_flow.dart'; +part of 'reset_failed_check_run.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** -CheckSuiteFlow _$CheckSuiteFlowFromJson(Map json) => - CheckSuiteFlow( +ResetFailedCheckRun _$ResetFailedCheckRunFromJson(Map json) => + ResetFailedCheckRun( useForAll: json['useForAll'] as bool?, useForUsers: (json['useForUsers'] as List?) ?.map((e) => e as String) .toList(), ); -Map _$CheckSuiteFlowToJson(CheckSuiteFlow instance) => - { - 'useForAll': instance.useForAll, - 'useForUsers': instance.useForUsers, - }; +Map _$ResetFailedCheckRunToJson( + ResetFailedCheckRun instance, +) => { + 'useForAll': instance.useForAll, + 'useForUsers': instance.useForUsers, +};