Skip to content

Commit 1520b80

Browse files
authored
fix(packaging): slack notifications and DRA branch for PRs (#19188) (#19204)
1 parent 6935d41 commit 1520b80

File tree

4 files changed

+13
-61
lines changed

4 files changed

+13
-61
lines changed

.buildkite/hooks/post-checkout

Lines changed: 0 additions & 58 deletions
This file was deleted.

.buildkite/hooks/pre-command

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010

1111
set -eo pipefail
1212

13+
# Upload should not do much with the pre-command.
14+
if [[ "$BUILDKITE_COMMAND" =~ .*"upload".* ]]; then
15+
echo "Skipped pre-command when running the Upload pipeline"
16+
exit 0
17+
fi
18+
1319
# shellcheck disable=SC1091
1420
source .buildkite/scripts/utils.sh
1521

.buildkite/package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
notify:
22
- slack: "#apm-server"
3-
if: build.state == "failed"
3+
if: build.state == "failed" && build.branch =~ /^(main|\d+\.\d+|\d+\.x)$$/
44
- slack: "#observablt-bots"
5-
if: "build.state != 'passed'"
5+
if: build.state == "failed" && build.branch =~ /^(main|\d+\.\d+|\d+\.x)$$/
66

77
env:
88
IMAGE_UBUNTU_X86_64: "family/core-ubuntu-2404"

.buildkite/scripts/utils.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ retry() {
3232

3333
#
3434
# An opinionated approach to detect if unsupported Unified Release branches
35-
# can be used, this is handy for testing feature branches in dry-run mode
35+
# can be used, this is handy for testing feature branches in dry-run mode.
36+
# In addition support for PRs is added by using the base branch of the PR.
3637
# It produces the below environment variables:
3738
# - VERSION
3839
# - DRA_COMMAND
@@ -58,6 +59,9 @@ dra_process_other_branches() {
5859
buildkite-agent annotate "It was not possible to know the original base branch for ${BUILDKITE_BRANCH}. This won't fail - this is a feature branch." --style 'info' --context 'ctx-info-feature-branch'
5960
fi
6061
fi
62+
elif [[ -n "$BUILDKITE_PULL_REQUEST_BASE_BRANCH" ]]; then
63+
DRA_BRANCH="$BUILDKITE_PULL_REQUEST_BASE_BRANCH"
64+
DRA_COMMAND=list
6165
fi
6266
export DRA_BRANCH DRA_COMMAND VERSION
6367
}

0 commit comments

Comments
 (0)