From 1fd0eb1205286a77fb94d4ea1c2bd501b6308887 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 8 Jan 2025 00:48:00 +1100 Subject: [PATCH] [8.16] ci(ftr): notify owners in the slack message when failures (#205260) (#205715) # Backport This will backport the following commits from `main` to `8.16`: - [ci(ftr): notify owners in the slack message when failures (#205260)](https://github.com/elastic/kibana/pull/205260) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Victor Martinez --- .buildkite/pipelines/on_merge_unsupported_ftrs.yml | 4 ++++ .buildkite/scripts/lifecycle/post_command.sh | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/.buildkite/pipelines/on_merge_unsupported_ftrs.yml b/.buildkite/pipelines/on_merge_unsupported_ftrs.yml index c7ac27e032bd8..6e28eb10356d3 100644 --- a/.buildkite/pipelines/on_merge_unsupported_ftrs.yml +++ b/.buildkite/pipelines/on_merge_unsupported_ftrs.yml @@ -37,6 +37,8 @@ steps: machineType: n2-standard-4 preemptible: true depends_on: build + env: + PING_SLACK_TEAM: "@obs-ux-infra_services-team" timeout_in_minutes: 120 retry: automatic: @@ -54,6 +56,8 @@ steps: machineType: n2-standard-4 preemptible: true depends_on: build + env: + PING_SLACK_TEAM: "@obs-ux-infra_services-team" timeout_in_minutes: 120 retry: automatic: diff --git a/.buildkite/scripts/lifecycle/post_command.sh b/.buildkite/scripts/lifecycle/post_command.sh index f90a4b451be1f..4d8217a4a284a 100755 --- a/.buildkite/scripts/lifecycle/post_command.sh +++ b/.buildkite/scripts/lifecycle/post_command.sh @@ -52,4 +52,12 @@ if [[ "$IS_TEST_EXECUTION_STEP" == "true" ]]; then buildkite-agent artifact upload 'target/test_failures/**/*' ts-node .buildkite/scripts/lifecycle/annotate_test_failures.ts fi + fi + +if [[ $BUILDKITE_COMMAND_EXIT_STATUS -ne 0 ]]; then + # If the slack team environment variable is set, ping the team in slack + if [ -n "${PING_SLACK_TEAM:-}" ]; then + buildkite-agent meta-data set 'slack:ping_team:body' "${PING_SLACK_TEAM}, can you please take a look at the test failures?" + fi +fi \ No newline at end of file