blob: fdee745ddd6c2897e1a27477752cfe114f61b704 [file] [log] [blame]
Tong Wuc447ebc2020-05-18 11:16:58 -07001#!/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"""
6Configurations for the recipes repository.
7
8This is mainly for bundling the recipes at https://flutter.googlesource.com/recipes/
9into a CIPD bundle.
10
11The documentation about recipe bundle:
Godofredo Contrerasa145d3c2021-09-21 23:30:34 +000012https://chrome-internal.googlesource.com/infra/infra_internal/+/main/doc/recipe_bundler.md
Tong Wuc447ebc2020-05-18 11:16:58 -070013"""
14
15load("//lib/accounts.star", "accounts")
16load("//lib/builder_groups.star", "builder_groups")
17load("//lib/common.star", "common")
18load("//lib/repos.star", "repos")
19
Yusuf Mohsinally5c8b0872022-05-25 19:49:31 +000020LINUX_OS = "Ubuntu"
21
Tong Wuc447ebc2020-05-18 11:16:58 -070022def _setup():
godofredoc6dd4b982020-07-01 11:02:09 -070023 console_name = "recipes"
Keyong Hand62546b2021-09-22 17:00:26 +000024 luci.console_view(name = console_name, repo = repos.FLUTTER_RECIPES, refs = ["refs/heads/main"])
Tong Wuc447ebc2020-05-18 11:16:58 -070025
26 executable = luci.recipe(
godofredoc6dd4b982020-07-01 11:02:09 -070027 name = "recipes",
28 cipd_package = "flutter/recipe_bundles/flutter.googlesource.com/recipes",
Godofredo Contrerasa145d3c2021-09-21 23:30:34 +000029 cipd_version = "refs/heads/main",
godofredoc6dd4b982020-07-01 11:02:09 -070030 use_bbagent = True,
Tong Wuc447ebc2020-05-18 11:16:58 -070031 )
godofredoc56236742020-08-17 11:02:30 -070032 tricium_executable = luci.recipe(
godofredoce826d852020-08-17 12:03:59 -070033 name = "tricium/tricium",
godofredoc56236742020-08-17 11:02:30 -070034 cipd_package = "flutter/recipe_bundles/flutter.googlesource.com/recipes",
Godofredo Contrerasa145d3c2021-09-21 23:30:34 +000035 cipd_version = "refs/heads/main",
godofredoc56236742020-08-17 11:02:30 -070036 use_bbagent = True,
37 )
38
39 # Presubmit builders
Tong Wuc447ebc2020-05-18 11:16:58 -070040
41 # Builder configuration to validate recipe changes in presubmit.
42 common.builder(
godofredoc6dd4b982020-07-01 11:02:09 -070043 name = "recipes-unittest-only",
44 builder_group = builder_groups.recipes_try,
Tong Wuc447ebc2020-05-18 11:16:58 -070045 # 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.
godofredoc6dd4b982020-07-01 11:02:09 -070048 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 Wuc447ebc2020-05-18 11:16:58 -070054 ],
Casey Hillers0ae8b002021-11-15 17:20:01 +000055 dimensions = {
56 "device_type": "none",
Yusuf Mohsinally5c8b0872022-05-25 19:49:31 +000057 "os": LINUX_OS,
Casey Hillers0ae8b002021-11-15 17:20:01 +000058 },
godofredoc6dd4b982020-07-01 11:02:09 -070059 properties = {
Tong Wuc447ebc2020-05-18 11:16:58 -070060 "remote": repos.FLUTTER_RECIPES,
61 "unittest_only": True,
62 },
godofredoc6dd4b982020-07-01 11:02:09 -070063 service_account = accounts.FLUTTER_TRY,
Godofredo Contreras378620d2022-08-18 23:29:25 +000064 experiments = {"luci.recipes.use_python3": 100},
Tong Wuc447ebc2020-05-18 11:16:58 -070065 )
66
godofredocb7cf1612020-06-09 10:20:41 -070067 # Builder configuration to run led tasks of all affected recipes.
68 common.builder(
godofredoc6dd4b982020-07-01 11:02:09 -070069 name = "recipes-with-led",
70 builder_group = builder_groups.recipes_try,
71 executable = executable,
72 execution_timeout = 180 * time.minute,
73 properties = {
godofredocb7cf1612020-06-09 10:20:41 -070074 "remote": repos.FLUTTER_RECIPES,
75 "unittest_only": False,
76 },
Casey Hillers0ae8b002021-11-15 17:20:01 +000077 dimensions = {
78 "device_type": "none",
Yusuf Mohsinally5c8b0872022-05-25 19:49:31 +000079 "os": LINUX_OS,
Casey Hillers0ae8b002021-11-15 17:20:01 +000080 },
godofredoc6dd4b982020-07-01 11:02:09 -070081 service_account = accounts.FLUTTER_TRY,
Godofredo Contreras378620d2022-08-18 23:29:25 +000082 experiments = {"luci.recipes.use_python3": 100},
godofredocb7cf1612020-06-09 10:20:41 -070083 )
84
godofredoc56236742020-08-17 11:02:30 -070085 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 Hillers0ae8b002021-11-15 17:20:01 +000092 dimensions = {
93 "device_type": "none",
Yusuf Mohsinally5c8b0872022-05-25 19:49:31 +000094 "os": LINUX_OS,
Casey Hillers0ae8b002021-11-15 17:20:01 +000095 },
godofredoc56236742020-08-17 11:02:30 -070096 executable = tricium_executable,
97 execution_timeout = 10 * time.minute,
godofredoc56236742020-08-17 11:02:30 -070098 properties = {
99 "analyses": ["Yapf"],
100 "cipd_packages": [{"name": "infra/tools/yapf", "subdir": "", "version": "latest"}],
101 },
102 service_account = accounts.FLUTTER_TRY,
Godofredo Contreras378620d2022-08-18 23:29:25 +0000103 experiments = {"luci.recipes.use_python3": 100},
godofredoc56236742020-08-17 11:02:30 -0700104 )
105
106 # Postsubmit builders.
107
Tong Wuc447ebc2020-05-18 11:16:58 -0700108 # Autoroller builder. This is used to roll flutter recipes dependencies.
109 common.builder(
godofredoc6dd4b982020-07-01 11:02:09 -0700110 name = "recipe-deps-roller",
111 builder_group = builder_groups.recipes_prod,
Casey Hillers0ae8b002021-11-15 17:20:01 +0000112 dimensions = {
113 "device_type": "none",
Yusuf Mohsinally5c8b0872022-05-25 19:49:31 +0000114 "os": LINUX_OS,
Casey Hillers0ae8b002021-11-15 17:20:01 +0000115 },
godofredoc6dd4b982020-07-01 11:02:09 -0700116 executable = luci.recipe(
117 name = "recipe_autoroller",
118 cipd_package =
119 "infra/recipe_bundles/chromium.googlesource.com/infra/infra",
Casey Hillersefdcbdb2021-11-29 21:08:28 +0000120 cipd_version = "git_revision:df3cd01d053358098bb9b10eaa453549b4ce2381",
Godofredo Contrerase0edc0b2022-01-06 00:57:59 +0000121 use_bbagent = True,
Tong Wuc447ebc2020-05-18 11:16:58 -0700122 ),
godofredoc6aeffb52021-03-12 21:19:50 -0800123 execution_timeout = 60 * time.minute,
godofredoc6dd4b982020-07-01 11:02:09 -0700124 properties = {
Tong Wuc447ebc2020-05-18 11:16:58 -0700125 "db_gcs_bucket": "flutter-recipe-roller-db",
126 "projects": {
127 "flutter": "https://flutter.googlesource.com/recipes",
128 }.items(),
129 },
godofredoc6dd4b982020-07-01 11:02:09 -0700130 schedule = "0 2,13 * * *",
131 console_category = console_name,
132 console_short_name = "aroll",
Godofredo Contreras378620d2022-08-18 23:29:25 +0000133 experiments = {"luci.recipes.use_python3": 100},
Tong Wuc447ebc2020-05-18 11:16:58 -0700134 )
135
136 # Recipes builder. This is used to create a bundle of the cipd package.
Casey Hillers777e0cb2022-05-20 02:47:22 +0000137 # 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 Wuc447ebc2020-05-18 11:16:58 -0700146 common.builder(
godofredoc6dd4b982020-07-01 11:02:09 -0700147 name = "recipes-bundler",
148 builder_group = builder_groups.recipes_prod,
Casey Hillers0ae8b002021-11-15 17:20:01 +0000149 dimensions = {
150 "device_type": "none",
Yusuf Mohsinally5c8b0872022-05-25 19:49:31 +0000151 "os": LINUX_OS,
Casey Hillers0ae8b002021-11-15 17:20:01 +0000152 },
godofredoc6dd4b982020-07-01 11:02:09 -0700153 executable = luci.recipe(
154 name = "recipe_bundler",
155 cipd_package =
156 "infra/recipe_bundles/chromium.googlesource.com/infra/infra",
Godofredo Contreras58068bf2022-01-07 06:33:34 +0000157 cipd_version = "git_revision:e818083ec70da67f7e735c9150cdbfa3d078b1ac",
Godofredo Contrerase0edc0b2022-01-06 00:57:59 +0000158 use_bbagent = True,
Tong Wuc447ebc2020-05-18 11:16:58 -0700159 ),
godofredoc6dd4b982020-07-01 11:02:09 -0700160 execution_timeout = 20 * time.minute,
161 properties = {
162 "package_name_prefix": "flutter/recipe_bundles",
163 "package_name_internal_prefix": "flutter_internal/recipe_bundles",
Godofredo Contreras58068bf2022-01-07 06:33:34 +0000164 "recipe_bundler_vers": "git_revision:e818083ec70da67f7e735c9150cdbfa3d078b1ac",
Godofredo Contrerasdc8621a2021-12-12 23:11:41 +0000165 "repo_specs": [
Casey Hillers8dbb1282022-04-14 22:55:01 +0000166 "flutter.googlesource.com/recipes=FETCH_HEAD,refs/heads/*",
Godofredo Contrerasdc8621a2021-12-12 23:11:41 +0000167 ],
Tong Wuc447ebc2020-05-18 11:16:58 -0700168 }.items(),
godofredoc6dd4b982020-07-01 11:02:09 -0700169 console_category = console_name,
170 console_short_name = "bdlr",
Godofredo Contreras378620d2022-08-18 23:29:25 +0000171 experiments = {"luci.recipes.use_python3": 100},
Casey Hillers777e0cb2022-05-20 02:47:22 +0000172 triggered_by = [trigger_name],
Tong Wuc447ebc2020-05-18 11:16:58 -0700173 )
174
godofredoc6dd4b982020-07-01 11:02:09 -0700175recipes_config = struct(setup = _setup)