blob: e2ad4bf905553a850f8f704a58949599102c71b3 [file] [log] [blame]
#!/usr/bin/env lucicfg
# Copyright 2019 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.
"""
Configurations for the recipes repository.
This is mainly for bundling the recipes at https://flutter.googlesource.com/recipes/
into a CIPD bundle.
The documentation about recipe bundle:
https://chrome-internal.googlesource.com/infra/infra_internal/+/main/doc/recipe_bundler.md
"""
load("//lib/accounts.star", "accounts")
load("//lib/builder_groups.star", "builder_groups")
load("//lib/common.star", "common")
load("//lib/repos.star", "repos")
def _setup():
console_name = "recipes"
luci.console_view(name = console_name, repo = repos.FLUTTER_RECIPES, refs = ["refs/heads/main"])
executable = luci.recipe(
name = "recipes",
cipd_package = "flutter/recipe_bundles/flutter.googlesource.com/recipes",
cipd_version = "refs/heads/main",
use_bbagent = True,
)
tricium_executable = luci.recipe(
name = "tricium/tricium",
cipd_package = "flutter/recipe_bundles/flutter.googlesource.com/recipes",
cipd_version = "refs/heads/main",
use_bbagent = True,
)
# Presubmit builders
# Builder configuration to validate recipe changes in presubmit.
common.builder(
name = "recipes-unittest-only",
builder_group = builder_groups.recipes_try,
# This builder is very quick to run, so we run it on every CQ attempt to
# minimize the chances of expectation file conflicts between CLs that land
# around the same time.
cq_disable_reuse = True,
executable = executable,
execution_timeout = 10 * time.minute,
location_regexp_exclude = [
common.LOCATION_REGEXP_MARKDOWN,
common.LOCATION_REGEXP_OWNERS,
],
dimensions = {
"device_type": "none",
"os": "Linux",
},
properties = {
"remote": repos.FLUTTER_RECIPES,
"unittest_only": True,
},
service_account = accounts.FLUTTER_TRY,
experiments = {"luci.recipes.use_python3": 100},
)
# Builder configuration to run led tasks of all affected recipes.
common.builder(
name = "recipes-with-led",
builder_group = builder_groups.recipes_try,
executable = executable,
execution_timeout = 180 * time.minute,
properties = {
"remote": repos.FLUTTER_RECIPES,
"unittest_only": False,
},
dimensions = {
"device_type": "none",
"os": "Linux",
},
service_account = accounts.FLUTTER_TRY,
experiments = {"luci.recipes.use_python3": 100},
)
common.builder(
name = "tricium",
builder_group = builder_groups.recipes_try,
# This builder is very quick to run, so we run it on every CQ attempt to
# minimize the chances of expectation file conflicts between CLs that land
# around the same time.
cq_disable_reuse = True,
dimensions = {
"device_type": "none",
"os": "Linux",
},
executable = tricium_executable,
execution_timeout = 10 * time.minute,
properties = {
"analyses": ["Yapf"],
"cipd_packages": [{"name": "infra/tools/yapf", "subdir": "", "version": "latest"}],
},
service_account = accounts.FLUTTER_TRY,
experiments = {"luci.recipes.use_python3": 100},
)
# Postsubmit builders.
# Autoroller builder. This is used to roll flutter recipes dependencies.
common.builder(
name = "recipe-deps-roller",
builder_group = builder_groups.recipes_prod,
dimensions = {
"device_type": "none",
"os": "Linux",
},
executable = luci.recipe(
name = "recipe_autoroller",
cipd_package =
"infra/recipe_bundles/chromium.googlesource.com/infra/infra",
cipd_version = "git_revision:df3cd01d053358098bb9b10eaa453549b4ce2381",
use_bbagent = True,
),
execution_timeout = 60 * time.minute,
properties = {
"db_gcs_bucket": "flutter-recipe-roller-db",
"projects": {
"flutter": "https://flutter.googlesource.com/recipes",
}.items(),
},
schedule = "0 2,13 * * *",
console_category = console_name,
console_short_name = "aroll",
experiments = {"luci.recipes.use_python3": 100},
)
# Recipes builder. This is used to create a bundle of the cipd package.
common.builder(
name = "recipes-bundler",
builder_group = builder_groups.recipes_prod,
dimensions = {
"device_type": "none",
"os": "Linux",
},
executable = luci.recipe(
name = "recipe_bundler",
cipd_package =
"infra/recipe_bundles/chromium.googlesource.com/infra/infra",
cipd_version = "git_revision:e818083ec70da67f7e735c9150cdbfa3d078b1ac",
use_bbagent = True,
),
execution_timeout = 20 * time.minute,
properties = {
"package_name_prefix": "flutter/recipe_bundles",
"package_name_internal_prefix": "flutter_internal/recipe_bundles",
"recipe_bundler_vers": "git_revision:e818083ec70da67f7e735c9150cdbfa3d078b1ac",
"repo_specs": [
"flutter.googlesource.com/recipes=FETCH_HEAD,refs/heads/main,refs/heads/master,refs/heads/flutter-*",
],
}.items(),
console_category = console_name,
console_short_name = "bdlr",
experiments = {"luci.recipes.use_python3": 100},
)
recipes_config = struct(setup = _setup)