Test disabled projects in a separated pipeline (#426)
This pipeline tell us if disabled projects are fixed before we adding
them back to the downstream pipeline.
Change-Id: Icd2de803d62321b04d6454f9fd27713830af6302
diff --git a/buildkite/bazelci.py b/buildkite/bazelci.py
index be71545..2e0c9f3 100644
--- a/buildkite/bazelci.py
+++ b/buildkite/bazelci.py
@@ -1310,7 +1310,7 @@
}
}
-def print_bazel_downstream_pipeline(configs, http_config, file_config, test_incompatible_flags):
+def print_bazel_downstream_pipeline(configs, http_config, file_config, test_incompatible_flags, test_disabled_projects):
if not configs:
raise BuildkiteException("Bazel downstream pipeline configuration is empty.")
@@ -1338,7 +1338,9 @@
for project, config in DOWNSTREAM_PROJECTS.items():
disabled_reason = config.get("disabled_reason", None)
- if not disabled_reason:
+ # If test_disabled_projects is true, we add configs for disabled projects.
+ # If test_disabled_projects is false, we add configs for not disbaled projects.
+ if (test_disabled_projects and disabled_reason) or (not test_disabled_projects and not disabled_reason):
pipeline_steps.append(
upload_project_pipeline_step(project_name=project,
git_repository=config["git_repository"],
@@ -1523,6 +1525,7 @@
bazel_downstream_pipeline.add_argument("--http_config", type=str)
bazel_downstream_pipeline.add_argument("--git_repository", type=str)
bazel_downstream_pipeline.add_argument("--test_incompatible_flags", type=bool, nargs="?", const=True)
+ bazel_downstream_pipeline.add_argument("--test_disabled_projects", type=bool, nargs="?", const=True)
project_pipeline = subparsers.add_parser("project_pipeline")
project_pipeline.add_argument("--project_name", type=str)
@@ -1565,7 +1568,8 @@
print_bazel_downstream_pipeline(configs=configs.get("platforms", None),
http_config=args.http_config,
file_config=args.file_config,
- test_incompatible_flags=args.test_incompatible_flags)
+ test_incompatible_flags=args.test_incompatible_flags,
+ test_disabled_projects=args.test_disabled_projects)
elif args.subparsers_name == "project_pipeline":
configs = fetch_configs(args.http_config, args.file_config)
print_project_pipeline(platform_configs=configs.get("platforms", None),