Skip to content

Commit 9f470cd

Browse files
authored
Merge branch 'main' into nt/gracefully-terminate-bk-agents
2 parents 3f84270 + fedab68 commit 9f470cd

27 files changed

+905
-204
lines changed

.buildkite/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3'
22

33
services:
44
fixperms-tests:
5-
image: golang:1.23
5+
image: golang:1.24
66
working_dir: /code
77
environment:
88
CGO_ENABLED: 0
@@ -11,7 +11,7 @@ services:
1111
command: go test -v ./...
1212

1313
ruby:
14-
image: ruby:3.3
14+
image: ruby:3.4
1515
working_dir: /work
1616
environment:
1717
- DRY_RUN

.buildkite/pipeline.cleanamis.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,14 @@ steps:
2929
- "me-south-1"
3030
- "sa-east-1"
3131
plugins:
32-
- aws-assume-role-with-web-identity#v1.1.0:
32+
- aws-assume-role-with-web-identity#v1.4.0:
3333
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-elastic-stack-for-aws-ami-cleaner
34-
- docker-compose#v5.4.1:
34+
session-tags:
35+
- organization_slug
36+
- organization_id
37+
- pipeline_slug
38+
- branch_build
39+
- docker-compose#v5.10.0:
3540
run: ruby
3641
config: .buildkite/docker-compose.yml
3742
propagate-aws-auth-tokens: true

.buildkite/pipeline.yaml

Lines changed: 87 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ steps:
77
agents:
88
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE}"
99

10+
- id: "cfn-lint"
11+
name: ":mag: cfn-lint"
12+
command: .buildkite/steps/cfn-lint.sh
13+
agents:
14+
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE}"
15+
soft_fail:
16+
# https://github.com/aws-cloudformation/cfn-lint#exit-codes
17+
- exit_status: 4 # Warning
18+
- exit_status: 8 # Informational
19+
- exit_status: 12 # Warning and informational
20+
1021
- label: ":bash: shfmt"
1122
key: fmt
1223
command: .buildkite/steps/shfmt.sh
@@ -18,7 +29,7 @@ steps:
1829
agents:
1930
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE}"
2031
plugins:
21-
- docker-compose#v2.1.0:
32+
- docker-compose#v5.10.0:
2233
run: fixperms-tests
2334
config: .buildkite/docker-compose.yml
2435

@@ -30,10 +41,15 @@ steps:
3041
depends_on:
3142
- "fmt"
3243
- "lint"
44+
- "cfn-lint"
3345
- "fixperms-tests"
3446
plugins:
35-
- aws-assume-role-with-web-identity#v1.1.0:
47+
- aws-assume-role-with-web-identity#v1.4.0:
3648
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
49+
session-tags:
50+
- organization_slug
51+
- organization_id
52+
- pipeline_slug
3753

3854
- id: "packer-windows-amd64"
3955
name: ":packer: :windows:"
@@ -45,10 +61,15 @@ steps:
4561
depends_on:
4662
- "fmt"
4763
- "lint"
64+
- "cfn-lint"
4865
- "fixperms-tests"
4966
plugins:
50-
- aws-assume-role-with-web-identity#v1.1.0:
67+
- aws-assume-role-with-web-identity#v1.4.0:
5168
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
69+
session-tags:
70+
- organization_slug
71+
- organization_id
72+
- pipeline_slug
5273

5374
- id: "launch-windows-amd64"
5475
name: ":cloudformation: :windows: AMD64 Launch"
@@ -60,15 +81,19 @@ steps:
6081
- "packer-windows-amd64"
6182
- "deploy-service-role-stack"
6283
plugins:
63-
- aws-assume-role-with-web-identity#v1.1.0:
84+
- aws-assume-role-with-web-identity#v1.4.0:
6485
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
86+
session-tags:
87+
- organization_slug
88+
- organization_id
89+
- pipeline_slug
6590

6691
- id: "test-windows-amd64"
6792
name: ":cloudformation: :windows: AMD64 Test"
6893
command:
6994
- git --version
7095
- docker info
71-
- docker run --rm mcr.microsoft.com/windows/nanoserver:ltsc2019 cmd.exe /c echo hello
96+
- docker run --rm mcr.microsoft.com/windows/nanoserver:ltsc2022 cmd.exe /c echo hello
7297
timeout_in_minutes: 5
7398
agents:
7499
stack: "buildkite-aws-stack-test-windows-amd64-${BUILDKITE_BUILD_NUMBER}"
@@ -85,8 +110,12 @@ steps:
85110
depends_on:
86111
- "test-windows-amd64"
87112
plugins:
88-
- aws-assume-role-with-web-identity#v1.1.0:
113+
- aws-assume-role-with-web-identity#v1.4.0:
89114
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
115+
session-tags:
116+
- organization_slug
117+
- organization_id
118+
- pipeline_slug
90119

91120
- id: "packer-linux-amd64"
92121
name: ":packer: :linux: AMD64"
@@ -98,10 +127,15 @@ steps:
98127
depends_on:
99128
- "fmt"
100129
- "lint"
130+
- "cfn-lint"
101131
- "fixperms-tests"
102132
plugins:
103-
- aws-assume-role-with-web-identity#v1.1.0:
133+
- aws-assume-role-with-web-identity#v1.4.0:
104134
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
135+
session-tags:
136+
- organization_slug
137+
- organization_id
138+
- pipeline_slug
105139

106140
- id: "launch-linux-amd64"
107141
name: ":cloudformation: :linux: AMD64 Launch"
@@ -113,8 +147,12 @@ steps:
113147
- "packer-linux-amd64"
114148
- "deploy-service-role-stack"
115149
plugins:
116-
- aws-assume-role-with-web-identity#v1.1.0:
150+
- aws-assume-role-with-web-identity#v1.4.0:
117151
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
152+
session-tags:
153+
- organization_slug
154+
- organization_id
155+
- pipeline_slug
118156

119157
- id: "test-linux-amd64"
120158
name: ":cloudformation: :linux: AMD64 Test"
@@ -137,8 +175,12 @@ steps:
137175
depends_on:
138176
- "test-linux-amd64"
139177
plugins:
140-
- aws-assume-role-with-web-identity#v1.1.0:
178+
- aws-assume-role-with-web-identity#v1.4.0:
141179
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
180+
session-tags:
181+
- organization_slug
182+
- organization_id
183+
- pipeline_slug
142184

143185
- id: "packer-linux-arm64"
144186
name: ":packer: :linux: ARM64"
@@ -150,10 +192,15 @@ steps:
150192
depends_on:
151193
- "fmt"
152194
- "lint"
195+
- "cfn-lint"
153196
- "fixperms-tests"
154197
plugins:
155-
- aws-assume-role-with-web-identity#v1.1.0:
198+
- aws-assume-role-with-web-identity#v1.4.0:
156199
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
200+
session-tags:
201+
- organization_slug
202+
- organization_id
203+
- pipeline_slug
157204

158205
- id: "launch-linux-arm64"
159206
name: ":cloudformation: :linux: ARM64 Launch"
@@ -165,8 +212,12 @@ steps:
165212
- "packer-linux-arm64"
166213
- "deploy-service-role-stack"
167214
plugins:
168-
- aws-assume-role-with-web-identity#v1.1.0:
215+
- aws-assume-role-with-web-identity#v1.4.0:
169216
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
217+
session-tags:
218+
- organization_slug
219+
- organization_id
220+
- pipeline_slug
170221

171222
- id: "test-linux-arm64"
172223
name: ":cloudformation: :linux: ARM64 Test"
@@ -189,8 +240,12 @@ steps:
189240
depends_on:
190241
- "test-linux-arm64"
191242
plugins:
192-
- aws-assume-role-with-web-identity#v1.1.0:
243+
- aws-assume-role-with-web-identity#v1.4.0:
193244
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
245+
session-tags:
246+
- organization_slug
247+
- organization_id
248+
- pipeline_slug
194249

195250
- id: "delete-service-role-stack"
196251
name: ":aws-iam: :cloudformation: Delete"
@@ -202,8 +257,12 @@ steps:
202257
- "delete-linux-amd64"
203258
- "delete-linux-arm64"
204259
plugins:
205-
- aws-assume-role-with-web-identity#v1.1.0:
260+
- aws-assume-role-with-web-identity#v1.4.0:
206261
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
262+
session-tags:
263+
- organization_slug
264+
- organization_id
265+
- pipeline_slug
207266

208267
- id: "copy-ami"
209268
name: ":cloudformation: 🚚 🌎"
@@ -216,8 +275,12 @@ steps:
216275
- "test-linux-arm64"
217276
- "test-windows-amd64"
218277
plugins:
219-
- aws-assume-role-with-web-identity#v1.1.0:
278+
- aws-assume-role-with-web-identity#v1.4.0:
220279
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
280+
session-tags:
281+
- organization_slug
282+
- organization_id
283+
- pipeline_slug
221284

222285
- id: "publish"
223286
name: ":cloudformation: :rocket:"
@@ -230,8 +293,12 @@ steps:
230293
artifact_paths: "build/*.yml"
231294
depends_on: "copy-ami"
232295
plugins:
233-
- aws-assume-role-with-web-identity#v1.1.0:
296+
- aws-assume-role-with-web-identity#v1.4.0:
234297
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
298+
session-tags:
299+
- organization_slug
300+
- organization_id
301+
- pipeline_slug
235302

236303
- id: cleanup
237304
name: ":broom: Cleanup"
@@ -240,5 +307,9 @@ steps:
240307
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE}"
241308
depends_on: "publish"
242309
plugins:
243-
- aws-assume-role-with-web-identity#v1.1.0:
310+
- aws-assume-role-with-web-identity#v1.4.0:
244311
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
312+
session-tags:
313+
- organization_slug
314+
- organization_id
315+
- pipeline_slug
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
if [[ -z "${1:-}" ]]; then
5+
echo "Usage: $0 <VERSION>"
6+
echo "Example: $0 v5.5.0"
7+
exit 1
8+
fi
9+
10+
RELEASE_VERSION=$1
11+
12+
# 1. Get the previous release tag, excluding the current release version
13+
PREVIOUS_TAG=$(git describe --tags --abbrev=0 --match='v*' --exclude="$RELEASE_VERSION")
14+
15+
# 2. Generate the changelog with ghch
16+
echo "--- Generating changelog from ${PREVIOUS_TAG} to ${RELEASE_VERSION}"
17+
CHANGELOG_BODY=$(ghch --format=markdown --from="$PREVIOUS_TAG" --next-version="$RELEASE_VERSION")
18+
19+
# 3. Check for Buildkite Agent updates
20+
AGENT_INSTALL_SCRIPT_LINUX="packer/linux/scripts/install-buildkite-agent.sh"
21+
AGENT_INSTALL_SCRIPT_WINDOWS="packer/windows/scripts/install-buildkite-agent.ps1"
22+
23+
if git diff --name-only "$PREVIOUS_TAG..HEAD" -- "$AGENT_INSTALL_SCRIPT_LINUX" "$AGENT_INSTALL_SCRIPT_WINDOWS" | grep -q "."; then
24+
echo "--- Buildkite Agent version has changed. Fetching agent release notes."
25+
AGENT_VERSION=$(grep "AGENT_VERSION=" "$AGENT_INSTALL_SCRIPT_LINUX" | cut -d'=' -f2)
26+
AGENT_RELEASE_NOTES=$(gh release view "v${AGENT_VERSION}" --repo "buildkite/agent" --json body -q .body)
27+
AGENT_CHANGELOG_DETAILS="<details>\n <summary><h3>Agent Changelog</h3></summary>\n\n${AGENT_RELEASE_NOTES}\n</details>"
28+
CHANGELOG_BODY+="\n\n${AGENT_CHANGELOG_DETAILS}"
29+
fi
30+
31+
# 4. Update CHANGELOG.md, preserving the header
32+
echo "--- Updating CHANGELOG.md"
33+
CHANGELOG_HEADER=$(head -n 5 CHANGELOG.md)
34+
CHANGELOG_REST=$(tail -n +6 CHANGELOG.md)
35+
36+
# Construct the new file content
37+
NEW_CHANGELOG_CONTENT="${CHANGELOG_HEADER}\n\n${CHANGELOG_BODY}\n\n${CHANGELOG_REST}"
38+
39+
echo -e "$NEW_CHANGELOG_CONTENT" >CHANGELOG.md
40+
41+
echo "CHANGELOG.md has been updated for ${RELEASE_VERSION}. Please review and create a pull request."

.buildkite/steps/cfn-lint.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
echo "--- Installing cfn-lint"
5+
pip install -q cfn-lint==1.36.0
6+
7+
echo "--- Running cfn-lint on templates in templates/"
8+
# cfn-lint will scan all *.json, *.yaml, *.yml, *.template files in the directory and subdirectories.
9+
/var/lib/buildkite-agent/.local/bin/cfn-lint templates/*

.cfnlintrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ignore_checks:
2+
- E1011

.github/workflows/linear_issue_open.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Setup Node.js
1616
uses: actions/setup-node@v4
1717
with:
18-
node-version: "20"
18+
node-version: "22"
1919

2020
- name: Create Linear Issue
2121
uses: actions/github-script@v7

0 commit comments

Comments
 (0)