Skip to content

Commit 60cb462

Browse files
authored
[ci] Migrate branch consistency and protection checks to Buildkite (#101646) (#101737)
(cherry picked from commit dee880a)
1 parent 5061954 commit 60cb462

File tree

7 files changed

+46
-11
lines changed

7 files changed

+46
-11
lines changed

.buildkite/pipelines/intake.template.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ 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
- group: bwc-snapshots
2828
steps:

.buildkite/pipelines/periodic.template.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ steps:
4242
agents:
4343
provider: gcp
4444
image: family/elasticsearch-ubuntu-2004
45-
machineType: custom-32-98304
45+
machineType: n1-standard-32
4646
buildDirectory: /dev/shm/bk
4747
env:
4848
ES_RUNTIME_JAVA: "{{matrix.ES_RUNTIME_JAVA}}"
@@ -70,7 +70,7 @@ steps:
7070
agents:
7171
provider: gcp
7272
image: family/elasticsearch-ubuntu-2004
73-
machineType: custom-32-98304
73+
machineType: n1-standard-32
7474
buildDirectory: /dev/shm/bk
7575
env:
7676
ES_RUNTIME_JAVA: "{{matrix.ES_RUNTIME_JAVA}}"
@@ -159,3 +159,13 @@ steps:
159159
image: family/elasticsearch-ubuntu-2004
160160
machineType: n2-standard-8
161161
buildDirectory: /dev/shm/bk
162+
- label: Check branch consistency
163+
command: .ci/scripts/run-gradle.sh branchConsistency
164+
timeout_in_minutes: 15
165+
agents:
166+
provider: gcp
167+
image: family/elasticsearch-ubuntu-2004
168+
machineType: n2-standard-2
169+
- label: Check branch protection rules
170+
command: .buildkite/scripts/branch-protection.sh
171+
timeout_in_minutes: 5

.buildkite/pipelines/periodic.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,3 +1350,13 @@ steps:
13501350
image: family/elasticsearch-ubuntu-2004
13511351
machineType: n2-standard-8
13521352
buildDirectory: /dev/shm/bk
1353+
- label: Check branch consistency
1354+
command: .ci/scripts/run-gradle.sh branchConsistency
1355+
timeout_in_minutes: 15
1356+
agents:
1357+
provider: gcp
1358+
image: family/elasticsearch-ubuntu-2004
1359+
machineType: n2-standard-2
1360+
- label: Check branch protection rules
1361+
command: .buildkite/scripts/branch-protection.sh
1362+
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)