| #!/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") |
| |
| LINUX_OS = "Ubuntu" |
| |
| def _setup(): |
| luci.cq_group( |
| name = "recipes-cq", |
| watch = cq.refset( |
| repo = "https://flutter.googlesource.com/recipes", |
| refs = ["refs/heads/.+"], |
| ), |
| verifiers = [ |
| luci.cq_tryjob_verifier( |
| builder = "tricium", |
| owner_whitelist = ["project-flutter-try-schedulers"], |
| mode_allowlist = [cq.MODE_ANALYZER_RUN], |
| ), |
| ], |
| ) |
| |
| 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_filters = [ |
| common.LOCATION_FILTER_MARKDOWN, |
| common.LOCATION_FILTER_OWNERS, |
| ], |
| dimensions = { |
| "device_type": "none", |
| "os": LINUX_OS, |
| }, |
| properties = { |
| "remote": repos.FLUTTER_RECIPES, |
| "unittest_only": True, |
| }, |
| service_account = accounts.FLUTTER_TRY, |
| experiments = {"luci.recipes.use_python3": 100}, |
| cq_group = "recipes-cq", |
| ) |
| |
| # 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_OS, |
| }, |
| service_account = accounts.FLUTTER_TRY, |
| experiments = {"luci.recipes.use_python3": 100}, |
| cq_group = "recipes-cq", |
| ) |
| |
| 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_OS, |
| }, |
| executable = tricium_executable, |
| execution_timeout = 10 * time.minute, |
| properties = { |
| "analyses": ["Yapf"], |
| "luci_analyzers": ["Pylint"], |
| "cipd_packages": [{"name": "infra/tools/yapf", "subdir": "", "version": "latest"}], |
| }, |
| service_account = accounts.FLUTTER_TRY, |
| experiments = {"luci.recipes.use_python3": 100}, |
| cq_group = "recipes-cq", |
| add_cq_tryjob_verifier = False, |
| ) |
| |
| # 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_OS, |
| }, |
| executable = luci.recipe( |
| name = "recipe_autoroller", |
| cipd_package = |
| "infra/recipe_bundles/chromium.googlesource.com/infra/infra", |
| cipd_version = "git_revision:0949f163beffdf64c6abfae311ba30a0dd196d61", |
| 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. |
| # Defines recipe bundler scheduler to handle release branch case |
| trigger_name = "gitiles-trigger-recipe-bundler" |
| luci.gitiles_poller( |
| name = trigger_name, |
| bucket = "prod", |
| repo = repos.FLUTTER_RECIPES, |
| refs = ["refs/heads/.*"], |
| ) |
| |
| common.builder( |
| name = "recipes-bundler", |
| builder_group = builder_groups.recipes_prod, |
| dimensions = { |
| "device_type": "none", |
| "os": LINUX_OS, |
| }, |
| executable = luci.recipe( |
| name = "recipe_bundler", |
| cipd_package = |
| "infra/recipe_bundles/chromium.googlesource.com/infra/infra", |
| cipd_version = "git_revision:0949f163beffdf64c6abfae311ba30a0dd196d61", |
| 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:d3eacf8ff882c68ac4b5e19f26059de65d8f4301", |
| "repo_specs": [ |
| "flutter.googlesource.com/recipes=FETCH_HEAD,refs/heads/master,refs/heads/main,refs/heads/flutter-*,refs/heads/fuchsia_*", |
| ], |
| }.items(), |
| console_category = console_name, |
| console_short_name = "bdlr", |
| experiments = {"luci.recipes.use_python3": 100}, |
| triggered_by = [trigger_name], |
| ) |
| |
| recipes_config = struct(setup = _setup) |