Avoid using additional steps to add and remove skipped task annotation (#1596)
diff --git a/buildkite/bazelci.py b/buildkite/bazelci.py
index 4debe3e..1008e06 100755
--- a/buildkite/bazelci.py
+++ b/buildkite/bazelci.py
@@ -2488,10 +2488,11 @@
if skipped_downstream_tasks:
lines = ["\n- {}".format(s) for s in skipped_downstream_tasks]
commands = [
+ "buildkite-agent meta-data exists 'has-skipped-annotation' || buildkite-agent annotate --style=info 'The following tasks were skipped:\n' --context 'ctx-skipped_downstream_tasks'",
+ "buildkite-agent meta-data set 'has-skipped-annotation' 'true'",
"buildkite-agent annotate --style=info '{}' --append --context 'ctx-skipped_downstream_tasks'".format(
"".join(lines)
),
- "buildkite-agent meta-data set 'has-skipped-steps' 'true'",
]
pipeline_steps.append(
create_step(
@@ -3033,15 +3034,6 @@
if info_box_step is not None:
pipeline_steps.append(info_box_step)
- pipeline_steps.append(
- create_step(
- label="Print skipped tasks annotation",
- commands=[
- 'buildkite-agent annotate --style=info "The following tasks were skipped:\n" --context "ctx-skipped_downstream_tasks"'
- ],
- platform=DEFAULT_PLATFORM,
- )
- )
for project, config in DOWNSTREAM_PROJECTS.items():
disabled_reason = config.get("disabled_reason", None)
# If test_disabled_projects is true, we add configs for disabled projects.
@@ -3058,17 +3050,6 @@
)
)
- pipeline_steps.append({"wait": "~", "continue_on_failure": "true"})
- pipeline_steps.append(
- create_step(
- label="Remove skipped tasks annotation if unneeded",
- commands=[
- 'buildkite-agent meta-data exists "has-skipped-steps" || buildkite-agent annotation remove --context "ctx-skipped_downstream_tasks"'
- ],
- platform=DEFAULT_PLATFORM,
- )
- )
-
if use_bazelisk_migrate():
current_build_number = os.environ.get("BUILDKITE_BUILD_NUMBER", None)
if not current_build_number: