Skip to content

Commit b1eff37

Browse files
authored
[ci] Migrate branch consistency and protection checks to Buildkite (#101646) (#101735)
(cherry picked from commit dee880a)
1 parent 0df72a3 commit b1eff37

File tree

7 files changed

+47
-12
lines changed

7 files changed

+47
-12
lines changed

.buildkite/pipelines/intake.template.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@ steps:
1414
agents:
1515
provider: gcp
1616
image: family/elasticsearch-ubuntu-2004
17-
machineType: custom-32-98304
17+
machineType: n1-standard-32
1818
buildDirectory: /dev/shm/bk
1919
- label: part2
2020
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true -Dorg.elasticsearch.build.cache.push=true -Dignore.tests.seed -Dscan.capture-task-input-files checkPart2
2121
timeout_in_minutes: 300
2222
agents:
2323
provider: gcp
2424
image: family/elasticsearch-ubuntu-2004
25-
machineType: custom-32-98304
25+
machineType: n1-standard-32
2626
buildDirectory: /dev/shm/bk
2727
- label: part3
2828
command: .ci/scripts/run-gradle.sh -Dbwc.checkout.align=true -Dorg.elasticsearch.build.cache.push=true -Dignore.tests.seed -Dscan.capture-task-input-files checkPart3
2929
timeout_in_minutes: 300
3030
agents:
3131
provider: gcp
3232
image: family/elasticsearch-ubuntu-2004
33-
machineType: custom-32-98304
33+
machineType: n1-standard-32
3434
buildDirectory: /dev/shm/bk
3535
- group: bwc-snapshots
3636
steps:

.buildkite/pipelines/periodic.template.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ steps:
5454
agents:
5555
provider: gcp
5656
image: family/elasticsearch-ubuntu-2004
57-
machineType: custom-32-98304
57+
machineType: n1-standard-32
5858
buildDirectory: /dev/shm/bk
5959
env:
6060
ES_RUNTIME_JAVA: "{{matrix.ES_RUNTIME_JAVA}}"
@@ -82,7 +82,7 @@ steps:
8282
agents:
8383
provider: gcp
8484
image: family/elasticsearch-ubuntu-2004
85-
machineType: custom-32-98304
85+
machineType: n1-standard-32
8686
buildDirectory: /dev/shm/bk
8787
env:
8888
ES_RUNTIME_JAVA: "{{matrix.ES_RUNTIME_JAVA}}"
@@ -180,3 +180,13 @@ steps:
180180
image: family/elasticsearch-ubuntu-2004
181181
machineType: n2-standard-8
182182
buildDirectory: /dev/shm/bk
183+
- label: Check branch consistency
184+
command: .ci/scripts/run-gradle.sh branchConsistency
185+
timeout_in_minutes: 15
186+
agents:
187+
provider: gcp
188+
image: family/elasticsearch-ubuntu-2004
189+
machineType: n2-standard-2
190+
- label: Check branch protection rules
191+
command: .buildkite/scripts/branch-protection.sh
192+
timeout_in_minutes: 5

.buildkite/pipelines/periodic.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,3 +1231,13 @@ steps:
12311231
image: family/elasticsearch-ubuntu-2004
12321232
machineType: n2-standard-8
12331233
buildDirectory: /dev/shm/bk
1234+
- label: Check branch consistency
1235+
command: .ci/scripts/run-gradle.sh branchConsistency
1236+
timeout_in_minutes: 15
1237+
agents:
1238+
provider: gcp
1239+
image: family/elasticsearch-ubuntu-2004
1240+
machineType: n2-standard-2
1241+
- label: Check branch protection rules
1242+
command: .buildkite/scripts/branch-protection.sh
1243+
timeout_in_minutes: 5
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
STATUS=$(curl -s "https://api.github.com/repos/elastic/elasticsearch/branches/$BUILDKITE_BRANCH" | jq '.protected')
6+
echo "Branch $BUILDKITE_BRANCH protection status is: $STATUS"
7+
if [[ "$STATUS" == "false" ]]; then
8+
echo "Development branch $BUILDKITE_BRANCH is not set as protected in GitHub but should be."
9+
exit 1
10+
fi

.ci/jobs.t/elastic+elasticsearch+branch-consistency.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
- job:
33
name: elastic+elasticsearch+%BRANCH%+branch-consistency
44
display-name: "elastic / elasticsearch # %BRANCH% - branch consistency"
5-
description: Testing of the Elasticsearch %BRANCH% branch version consistency.
6-
triggers:
7-
- timed: "H 7 * * *"
5+
description: "This job has been migrated to Buildkite.\n"
6+
disabled: true
7+
triggers: []
88
builders:
99
- inject:
10-
properties-file: '.ci/java-versions.properties'
10+
properties-file: ".ci/java-versions.properties"
1111
properties-content: |
1212
JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA
1313
- shell: |

.ci/jobs.t/elastic+elasticsearch+branch-protection.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
- job:
33
name: elastic+elasticsearch+%BRANCH%+branch-protection
44
display-name: "elastic / elasticsearch # %BRANCH% - branch protection"
5-
description: Elasticsearch %BRANCH% branch protection.
5+
description: "This job has been migrated to Buildkite.\n"
6+
disabled: true
67
node: master
7-
triggers:
8-
- timed: "H 7 * * *"
8+
triggers: []
99
scm: []
1010
parameters: []
1111
builders:

.ci/scripts/run-gradle.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,10 @@ if ! uname -a | grep -q MING; then
3131
export GLIBC_VERSION=$(ldd --version | grep '^ldd' | sed 's/.* \([1-9]\.[0-9]*\).*/\1/')
3232
fi
3333

34+
# Running on 2-core machines without ramdisk can make this value be 0
35+
if [[ "$MAX_WORKERS" == "0" ]]; then
36+
MAX_WORKERS=1
37+
fi
38+
3439
set -e
3540
$GRADLEW -S --max-workers=$MAX_WORKERS $@

0 commit comments

Comments
 (0)