From 8517373b055377dde5257ea8692c9ff5404ddd00 Mon Sep 17 00:00:00 2001 From: Casey Hillers Date: Fri, 1 Dec 2023 13:56:04 -0800 Subject: [PATCH] [scheduler] Add recipe property to support releases (#3305) Fixes https://github.com/flutter/flutter/issues/139313 --- app_dart/lib/src/model/ci_yaml/target.dart | 4 +++- app_dart/test/model/ci_yaml/target_test.dart | 2 ++ app_dart/test/service/luci_build_service_test.dart | 4 ++++ app_dart/test/src/utilities/entity_generators.dart | 2 ++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app_dart/lib/src/model/ci_yaml/target.dart b/app_dart/lib/src/model/ci_yaml/target.dart index 4fa65e13a..f66375f39 100644 --- a/app_dart/lib/src/model/ci_yaml/target.dart +++ b/app_dart/lib/src/model/ci_yaml/target.dart @@ -153,7 +153,9 @@ class Target { } Map _getTargetProperties() { - final Map properties = {}; + final Map properties = { + 'recipe': value.recipe, + }; for (String key in value.properties.keys) { properties[key] = _parseProperty(key, value.properties[key]!); } diff --git a/app_dart/test/model/ci_yaml/target_test.dart b/app_dart/test/model/ci_yaml/target_test.dart index d06d57d0e..12c6293b4 100644 --- a/app_dart/test/model/ci_yaml/target_test.dart +++ b/app_dart/test/model/ci_yaml/target_test.dart @@ -19,6 +19,7 @@ void main() { expect(target.getProperties(), { 'bringup': false, 'dependencies': [], + 'recipe': 'devicelab/devicelab', }); }); @@ -91,6 +92,7 @@ void main() { 'runtime_versions': ['ios-13-0', 'ios-15-0'], 'sdk_version': '14e222b', }, + 'recipe': 'devicelab/devicelab', }); }); diff --git a/app_dart/test/service/luci_build_service_test.dart b/app_dart/test/service/luci_build_service_test.dart index 79e2d9674..975858b0a 100644 --- a/app_dart/test/service/luci_build_service_test.dart +++ b/app_dart/test/service/luci_build_service_test.dart @@ -333,6 +333,7 @@ void main() { 'git_url': 'https://github.com/flutter/flutter', 'git_ref': 'refs/pull/123/head', 'exe_cipd_version': 'refs/heads/main', + 'recipe': 'devicelab/devicelab', }); expect(dimensions.length, 1); expect(dimensions[0].key, 'os'); @@ -391,6 +392,7 @@ void main() { 'git_url': 'https://github.com/flutter/flutter', 'git_ref': 'refs/pull/123/head', 'exe_cipd_version': 'refs/heads/main', + 'recipe': 'devicelab/devicelab', LuciBuildService.propertiesGithubBuildLabelName: [ '${LuciBuildService.githubBuildLabelPrefix}hello', '${LuciBuildService.githubBuildLabelPrefix}world', @@ -439,6 +441,7 @@ void main() { generateTarget( 1, properties: { + 'recipe': 'devicelab/devicelab', 'os': 'debian-10.12', }, slug: Config.packagesSlug, @@ -479,6 +482,7 @@ void main() { 'git_branch': 'master', 'exe_cipd_version': 'refs/heads/master', 'os': 'debian-10.12', + 'recipe': 'devicelab/devicelab', }); expect(scheduleBuild.exe, { 'cipdVersion': 'refs/heads/master', diff --git a/app_dart/test/src/utilities/entity_generators.dart b/app_dart/test/src/utilities/entity_generators.dart index a3ac9d972..1758b63b8 100644 --- a/app_dart/test/src/utilities/entity_generators.dart +++ b/app_dart/test/src/utilities/entity_generators.dart @@ -107,6 +107,7 @@ Target generateTarget( bool? bringup, github.RepositorySlug? slug, pb.SchedulerSystem? schedulerSystem, + String recipe = 'devicelab/devicelab', }) { final pb.SchedulerConfig config = schedulerConfig ?? exampleConfig.config; if (platformProperties != null && platformDimensions != null) { @@ -129,6 +130,7 @@ Target generateTarget( runIf: runIf ?? [], runIfNot: runIfNot ?? [], bringup: bringup ?? false, + recipe: recipe, scheduler: schedulerSystem ?? pb.SchedulerSystem.cocoon, ), );