diff --git a/app_dart/config.yaml b/app_dart/config.yaml index 275a1fff4a..12285c6b9c 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 reset failed check run back to in progress to specific users or to everyone. +resetFailedCheckRun: + 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..cc1804ef6a 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 reset failed check run back to in progress to specific users or to everyone. +resetFailedCheckRun: + 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/dynamic_config.dart b/app_dart/lib/src/service/flags/dynamic_config.dart index 0e735074a0..c5a8a0a437 100644 --- a/app_dart/lib/src/service/flags/dynamic_config.dart +++ b/app_dart/lib/src/service/flags/dynamic_config.dart @@ -15,7 +15,7 @@ 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'; +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, - unifiedCheckRunFlow: UnifiedCheckRunFlow.defaultInstance, + resetFailedCheckRun: ResetFailedCheckRun.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 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.unifiedCheckRunFlow, + 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, - UnifiedCheckRunFlow? unifiedCheckRunFlow, + ResetFailedCheckRun? resetFailedCheckRun, OrderedPresubmit? orderedPresubmit, bool? dynamicTestSuppression, String? geminiModel, @@ -122,8 +122,8 @@ final class DynamicConfig { defaultInstance.closeMqGuardAfterPresubmit, enableGeminiLogAnalysis: enableGeminiLogAnalysis ?? defaultInstance.enableGeminiLogAnalysis, - unifiedCheckRunFlow: - unifiedCheckRunFlow ?? defaultInstance.unifiedCheckRunFlow, + resetFailedCheckRun: + resetFailedCheckRun ?? defaultInstance.resetFailedCheckRun, orderedPresubmit: orderedPresubmit ?? defaultInstance.orderedPresubmit, dynamicTestSuppression: dynamicTestSuppression ?? defaultInstance.dynamicTestSuppression, @@ -159,11 +159,14 @@ final class DynamicConfig { /// The inverse operation of [DynamicConfig.fromJson]. Map toJson() => _$DynamicConfigToJson(this); - bool isUnifiedCheckRunFlowEnabledForUser(String githubUsername) { - if (unifiedCheckRunFlow.useForAll) { + bool isResetFailedCheckRunEnabledForUser(String githubUsername) { + if (resetFailedCheckRun.useForAll) { return true; } - return unifiedCheckRunFlow.useForUsers.contains(githubUsername); + final usernameLower = githubUsername.toLowerCase(); + return resetFailedCheckRun.useForUsers.any( + (user) => user.toLowerCase() == usernameLower, + ); } 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..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?, - unifiedCheckRunFlow: json['unifiedCheckRunFlow'] == null + resetFailedCheckRun: json['resetFailedCheckRun'] == null ? null - : UnifiedCheckRunFlow.fromJson( - json['unifiedCheckRunFlow'] 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, - 'unifiedCheckRunFlow': instance.unifiedCheckRunFlow.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/unified_check_run_flow_flags.g.dart b/app_dart/lib/src/service/flags/reset_failed_check_run.g.dart similarity index 73% rename from app_dart/lib/src/service/flags/unified_check_run_flow_flags.g.dart rename to app_dart/lib/src/service/flags/reset_failed_check_run.g.dart index 7c8879fe3e..39ecc2d92d 100644 --- a/app_dart/lib/src/service/flags/unified_check_run_flow_flags.g.dart +++ b/app_dart/lib/src/service/flags/reset_failed_check_run.g.dart @@ -2,22 +2,22 @@ // ignore_for_file: always_specify_types, implicit_dynamic_parameter -part of 'unified_check_run_flow_flags.dart'; +part of 'reset_failed_check_run.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** -UnifiedCheckRunFlow _$UnifiedCheckRunFlowFromJson(Map json) => - UnifiedCheckRunFlow( +ResetFailedCheckRun _$ResetFailedCheckRunFromJson(Map json) => + ResetFailedCheckRun( useForAll: json['useForAll'] as bool?, useForUsers: (json['useForUsers'] as List?) ?.map((e) => e as String) .toList(), ); -Map _$UnifiedCheckRunFlowToJson( - UnifiedCheckRunFlow instance, +Map _$ResetFailedCheckRunToJson( + ResetFailedCheckRun instance, ) => { 'useForAll': instance.useForAll, 'useForUsers': instance.useForUsers, 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); -}