Tong Wu | c447ebc | 2020-05-18 11:16:58 -0700 | [diff] [blame] | 1 | #!/usr/bin/env lucicfg |
| 2 | # Copyright 2019 The Flutter Authors. All rights reserved. |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| 5 | """ |
| 6 | Configurations for the recipes repository. |
| 7 | |
| 8 | This is mainly for bundling the recipes at https://flutter.googlesource.com/recipes/ |
| 9 | into a CIPD bundle. |
| 10 | |
| 11 | The documentation about recipe bundle: |
Godofredo Contreras | a145d3c | 2021-09-21 23:30:34 +0000 | [diff] [blame] | 12 | https://chrome-internal.googlesource.com/infra/infra_internal/+/main/doc/recipe_bundler.md |
Tong Wu | c447ebc | 2020-05-18 11:16:58 -0700 | [diff] [blame] | 13 | """ |
| 14 | |
| 15 | load("//lib/accounts.star", "accounts") |
| 16 | load("//lib/builder_groups.star", "builder_groups") |
| 17 | load("//lib/common.star", "common") |
| 18 | load("//lib/repos.star", "repos") |
| 19 | |
Yusuf Mohsinally | 5c8b087 | 2022-05-25 19:49:31 +0000 | [diff] [blame] | 20 | LINUX_OS = "Ubuntu" |
| 21 | |
Tong Wu | c447ebc | 2020-05-18 11:16:58 -0700 | [diff] [blame] | 22 | def _setup(): |
godofredoc | 6dd4b98 | 2020-07-01 11:02:09 -0700 | [diff] [blame] | 23 | console_name = "recipes" |
Keyong Han | d62546b | 2021-09-22 17:00:26 +0000 | [diff] [blame] | 24 | luci.console_view(name = console_name, repo = repos.FLUTTER_RECIPES, refs = ["refs/heads/main"]) |
Tong Wu | c447ebc | 2020-05-18 11:16:58 -0700 | [diff] [blame] | 25 | |
| 26 | executable = luci.recipe( |
godofredoc | 6dd4b98 | 2020-07-01 11:02:09 -0700 | [diff] [blame] | 27 | name = "recipes", |
| 28 | cipd_package = "flutter/recipe_bundles/flutter.googlesource.com/recipes", |
Godofredo Contreras | a145d3c | 2021-09-21 23:30:34 +0000 | [diff] [blame] | 29 | cipd_version = "refs/heads/main", |
godofredoc | 6dd4b98 | 2020-07-01 11:02:09 -0700 | [diff] [blame] | 30 | use_bbagent = True, |
Tong Wu | c447ebc | 2020-05-18 11:16:58 -0700 | [diff] [blame] | 31 | ) |
godofredoc | 5623674 | 2020-08-17 11:02:30 -0700 | [diff] [blame] | 32 | tricium_executable = luci.recipe( |
godofredoc | e826d85 | 2020-08-17 12:03:59 -0700 | [diff] [blame] | 33 | name = "tricium/tricium", |
godofredoc | 5623674 | 2020-08-17 11:02:30 -0700 | [diff] [blame] | 34 | cipd_package = "flutter/recipe_bundles/flutter.googlesource.com/recipes", |
Godofredo Contreras | a145d3c | 2021-09-21 23:30:34 +0000 | [diff] [blame] | 35 | cipd_version = "refs/heads/main", |
godofredoc | 5623674 | 2020-08-17 11:02:30 -0700 | [diff] [blame] | 36 | use_bbagent = True, |
| 37 | ) |
| 38 | |
| 39 | # Presubmit builders |
Tong Wu | c447ebc | 2020-05-18 11:16:58 -0700 | [diff] [blame] | 40 | |
| 41 | # Builder configuration to validate recipe changes in presubmit. |
| 42 | common.builder( |
godofredoc | 6dd4b98 | 2020-07-01 11:02:09 -0700 | [diff] [blame] | 43 | name = "recipes-unittest-only", |
| 44 | builder_group = builder_groups.recipes_try, |
Tong Wu | c447ebc | 2020-05-18 11:16:58 -0700 | [diff] [blame] | 45 | # This builder is very quick to run, so we run it on every CQ attempt to |
| 46 | # minimize the chances of expectation file conflicts between CLs that land |
| 47 | # around the same time. |
godofredoc | 6dd4b98 | 2020-07-01 11:02:09 -0700 | [diff] [blame] | 48 | cq_disable_reuse = True, |
| 49 | executable = executable, |
| 50 | execution_timeout = 10 * time.minute, |
| 51 | location_regexp_exclude = [ |
| 52 | common.LOCATION_REGEXP_MARKDOWN, |
| 53 | common.LOCATION_REGEXP_OWNERS, |
Tong Wu | c447ebc | 2020-05-18 11:16:58 -0700 | [diff] [blame] | 54 | ], |
Casey Hillers | 0ae8b00 | 2021-11-15 17:20:01 +0000 | [diff] [blame] | 55 | dimensions = { |
| 56 | "device_type": "none", |
Yusuf Mohsinally | 5c8b087 | 2022-05-25 19:49:31 +0000 | [diff] [blame] | 57 | "os": LINUX_OS, |
Casey Hillers | 0ae8b00 | 2021-11-15 17:20:01 +0000 | [diff] [blame] | 58 | }, |
godofredoc | 6dd4b98 | 2020-07-01 11:02:09 -0700 | [diff] [blame] | 59 | properties = { |
Tong Wu | c447ebc | 2020-05-18 11:16:58 -0700 | [diff] [blame] | 60 | "remote": repos.FLUTTER_RECIPES, |
| 61 | "unittest_only": True, |
| 62 | }, |
godofredoc | 6dd4b98 | 2020-07-01 11:02:09 -0700 | [diff] [blame] | 63 | service_account = accounts.FLUTTER_TRY, |
Godofredo Contreras | 378620d | 2022-08-18 23:29:25 +0000 | [diff] [blame] | 64 | experiments = {"luci.recipes.use_python3": 100}, |
Tong Wu | c447ebc | 2020-05-18 11:16:58 -0700 | [diff] [blame] | 65 | ) |
| 66 | |
godofredoc | b7cf161 | 2020-06-09 10:20:41 -0700 | [diff] [blame] | 67 | # Builder configuration to run led tasks of all affected recipes. |
| 68 | common.builder( |
godofredoc | 6dd4b98 | 2020-07-01 11:02:09 -0700 | [diff] [blame] | 69 | name = "recipes-with-led", |
| 70 | builder_group = builder_groups.recipes_try, |
| 71 | executable = executable, |
| 72 | execution_timeout = 180 * time.minute, |
| 73 | properties = { |
godofredoc | b7cf161 | 2020-06-09 10:20:41 -0700 | [diff] [blame] | 74 | "remote": repos.FLUTTER_RECIPES, |
| 75 | "unittest_only": False, |
| 76 | }, |
Casey Hillers | 0ae8b00 | 2021-11-15 17:20:01 +0000 | [diff] [blame] | 77 | dimensions = { |
| 78 | "device_type": "none", |
Yusuf Mohsinally | 5c8b087 | 2022-05-25 19:49:31 +0000 | [diff] [blame] | 79 | "os": LINUX_OS, |
Casey Hillers | 0ae8b00 | 2021-11-15 17:20:01 +0000 | [diff] [blame] | 80 | }, |
godofredoc | 6dd4b98 | 2020-07-01 11:02:09 -0700 | [diff] [blame] | 81 | service_account = accounts.FLUTTER_TRY, |
Godofredo Contreras | 378620d | 2022-08-18 23:29:25 +0000 | [diff] [blame] | 82 | experiments = {"luci.recipes.use_python3": 100}, |
godofredoc | b7cf161 | 2020-06-09 10:20:41 -0700 | [diff] [blame] | 83 | ) |
| 84 | |
godofredoc | 5623674 | 2020-08-17 11:02:30 -0700 | [diff] [blame] | 85 | common.builder( |
| 86 | name = "tricium", |
| 87 | builder_group = builder_groups.recipes_try, |
| 88 | # This builder is very quick to run, so we run it on every CQ attempt to |
| 89 | # minimize the chances of expectation file conflicts between CLs that land |
| 90 | # around the same time. |
| 91 | cq_disable_reuse = True, |
Casey Hillers | 0ae8b00 | 2021-11-15 17:20:01 +0000 | [diff] [blame] | 92 | dimensions = { |
| 93 | "device_type": "none", |
Yusuf Mohsinally | 5c8b087 | 2022-05-25 19:49:31 +0000 | [diff] [blame] | 94 | "os": LINUX_OS, |
Casey Hillers | 0ae8b00 | 2021-11-15 17:20:01 +0000 | [diff] [blame] | 95 | }, |
godofredoc | 5623674 | 2020-08-17 11:02:30 -0700 | [diff] [blame] | 96 | executable = tricium_executable, |
| 97 | execution_timeout = 10 * time.minute, |
godofredoc | 5623674 | 2020-08-17 11:02:30 -0700 | [diff] [blame] | 98 | properties = { |
| 99 | "analyses": ["Yapf"], |
| 100 | "cipd_packages": [{"name": "infra/tools/yapf", "subdir": "", "version": "latest"}], |
| 101 | }, |
| 102 | service_account = accounts.FLUTTER_TRY, |
Godofredo Contreras | 378620d | 2022-08-18 23:29:25 +0000 | [diff] [blame] | 103 | experiments = {"luci.recipes.use_python3": 100}, |
godofredoc | 5623674 | 2020-08-17 11:02:30 -0700 | [diff] [blame] | 104 | ) |
| 105 | |
| 106 | # Postsubmit builders. |
| 107 | |
Tong Wu | c447ebc | 2020-05-18 11:16:58 -0700 | [diff] [blame] | 108 | # Autoroller builder. This is used to roll flutter recipes dependencies. |
| 109 | common.builder( |
godofredoc | 6dd4b98 | 2020-07-01 11:02:09 -0700 | [diff] [blame] | 110 | name = "recipe-deps-roller", |
| 111 | builder_group = builder_groups.recipes_prod, |
Casey Hillers | 0ae8b00 | 2021-11-15 17:20:01 +0000 | [diff] [blame] | 112 | dimensions = { |
| 113 | "device_type": "none", |
Yusuf Mohsinally | 5c8b087 | 2022-05-25 19:49:31 +0000 | [diff] [blame] | 114 | "os": LINUX_OS, |
Casey Hillers | 0ae8b00 | 2021-11-15 17:20:01 +0000 | [diff] [blame] | 115 | }, |
godofredoc | 6dd4b98 | 2020-07-01 11:02:09 -0700 | [diff] [blame] | 116 | executable = luci.recipe( |
| 117 | name = "recipe_autoroller", |
| 118 | cipd_package = |
| 119 | "infra/recipe_bundles/chromium.googlesource.com/infra/infra", |
Casey Hillers | efdcbdb | 2021-11-29 21:08:28 +0000 | [diff] [blame] | 120 | cipd_version = "git_revision:df3cd01d053358098bb9b10eaa453549b4ce2381", |
Godofredo Contreras | e0edc0b | 2022-01-06 00:57:59 +0000 | [diff] [blame] | 121 | use_bbagent = True, |
Tong Wu | c447ebc | 2020-05-18 11:16:58 -0700 | [diff] [blame] | 122 | ), |
godofredoc | 6aeffb5 | 2021-03-12 21:19:50 -0800 | [diff] [blame] | 123 | execution_timeout = 60 * time.minute, |
godofredoc | 6dd4b98 | 2020-07-01 11:02:09 -0700 | [diff] [blame] | 124 | properties = { |
Tong Wu | c447ebc | 2020-05-18 11:16:58 -0700 | [diff] [blame] | 125 | "db_gcs_bucket": "flutter-recipe-roller-db", |
| 126 | "projects": { |
| 127 | "flutter": "https://flutter.googlesource.com/recipes", |
| 128 | }.items(), |
| 129 | }, |
godofredoc | 6dd4b98 | 2020-07-01 11:02:09 -0700 | [diff] [blame] | 130 | schedule = "0 2,13 * * *", |
| 131 | console_category = console_name, |
| 132 | console_short_name = "aroll", |
Godofredo Contreras | 378620d | 2022-08-18 23:29:25 +0000 | [diff] [blame] | 133 | experiments = {"luci.recipes.use_python3": 100}, |
Tong Wu | c447ebc | 2020-05-18 11:16:58 -0700 | [diff] [blame] | 134 | ) |
| 135 | |
| 136 | # Recipes builder. This is used to create a bundle of the cipd package. |
Casey Hillers | 777e0cb | 2022-05-20 02:47:22 +0000 | [diff] [blame] | 137 | # Defines recipe bundler scheduler to handle release branch case |
| 138 | trigger_name = "gitiles-trigger-recipe-bundler" |
| 139 | luci.gitiles_poller( |
| 140 | name = trigger_name, |
| 141 | bucket = "prod", |
| 142 | repo = repos.FLUTTER_RECIPES, |
| 143 | refs = ["refs/heads/.*"], |
| 144 | ) |
| 145 | |
Tong Wu | c447ebc | 2020-05-18 11:16:58 -0700 | [diff] [blame] | 146 | common.builder( |
godofredoc | 6dd4b98 | 2020-07-01 11:02:09 -0700 | [diff] [blame] | 147 | name = "recipes-bundler", |
| 148 | builder_group = builder_groups.recipes_prod, |
Casey Hillers | 0ae8b00 | 2021-11-15 17:20:01 +0000 | [diff] [blame] | 149 | dimensions = { |
| 150 | "device_type": "none", |
Yusuf Mohsinally | 5c8b087 | 2022-05-25 19:49:31 +0000 | [diff] [blame] | 151 | "os": LINUX_OS, |
Casey Hillers | 0ae8b00 | 2021-11-15 17:20:01 +0000 | [diff] [blame] | 152 | }, |
godofredoc | 6dd4b98 | 2020-07-01 11:02:09 -0700 | [diff] [blame] | 153 | executable = luci.recipe( |
| 154 | name = "recipe_bundler", |
| 155 | cipd_package = |
| 156 | "infra/recipe_bundles/chromium.googlesource.com/infra/infra", |
Godofredo Contreras | 58068bf | 2022-01-07 06:33:34 +0000 | [diff] [blame] | 157 | cipd_version = "git_revision:e818083ec70da67f7e735c9150cdbfa3d078b1ac", |
Godofredo Contreras | e0edc0b | 2022-01-06 00:57:59 +0000 | [diff] [blame] | 158 | use_bbagent = True, |
Tong Wu | c447ebc | 2020-05-18 11:16:58 -0700 | [diff] [blame] | 159 | ), |
godofredoc | 6dd4b98 | 2020-07-01 11:02:09 -0700 | [diff] [blame] | 160 | execution_timeout = 20 * time.minute, |
| 161 | properties = { |
| 162 | "package_name_prefix": "flutter/recipe_bundles", |
| 163 | "package_name_internal_prefix": "flutter_internal/recipe_bundles", |
Godofredo Contreras | 58068bf | 2022-01-07 06:33:34 +0000 | [diff] [blame] | 164 | "recipe_bundler_vers": "git_revision:e818083ec70da67f7e735c9150cdbfa3d078b1ac", |
Godofredo Contreras | dc8621a | 2021-12-12 23:11:41 +0000 | [diff] [blame] | 165 | "repo_specs": [ |
Casey Hillers | 8dbb128 | 2022-04-14 22:55:01 +0000 | [diff] [blame] | 166 | "flutter.googlesource.com/recipes=FETCH_HEAD,refs/heads/*", |
Godofredo Contreras | dc8621a | 2021-12-12 23:11:41 +0000 | [diff] [blame] | 167 | ], |
Tong Wu | c447ebc | 2020-05-18 11:16:58 -0700 | [diff] [blame] | 168 | }.items(), |
godofredoc | 6dd4b98 | 2020-07-01 11:02:09 -0700 | [diff] [blame] | 169 | console_category = console_name, |
| 170 | console_short_name = "bdlr", |
Godofredo Contreras | 378620d | 2022-08-18 23:29:25 +0000 | [diff] [blame] | 171 | experiments = {"luci.recipes.use_python3": 100}, |
Casey Hillers | 777e0cb | 2022-05-20 02:47:22 +0000 | [diff] [blame] | 172 | triggered_by = [trigger_name], |
Tong Wu | c447ebc | 2020-05-18 11:16:58 -0700 | [diff] [blame] | 173 | ) |
| 174 | |
godofredoc | 6dd4b98 | 2020-07-01 11:02:09 -0700 | [diff] [blame] | 175 | recipes_config = struct(setup = _setup) |