Skip to content

Commit cbcd579

Browse files
authored
[backport-kubernetes-1.83] Sync CI configuration with main branch (#20430)
Keep CI pipelines, GitHub Actions, and tooling consistent between active backport branches and `main`, so that automated backport workflows and tooling improvements land on all supported branches.
1 parent d62851b commit cbcd579

144 files changed

Lines changed: 12807 additions & 3203 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
2+
3+
env:
4+
SETUP_GVM_VERSION: "v0.6.0"
5+
LINUX_AGENT_IMAGE: "golang:${GO_VERSION}"
6+
YQ_VERSION: 'v4.35.2'
7+
GH_CLI_VERSION: "2.29.0"
8+
NOTIFY_TO: "ecosystem-team@elastic.co"
9+
10+
steps:
11+
- label: ":ballot_box_with_check: Backports inventory validation"
12+
key: "check-backports-inventory"
13+
command: ".buildkite/scripts/check_backports_inventory.sh"
14+
agents:
15+
image: "${LINUX_AGENT_IMAGE}"
16+
if_changed:
17+
- ".backports.yml"
18+
- ".buildkite/scripts/run_dev_scripts_tests.sh"
19+
- "dev/scripts/**.sh"
20+
- "cmd/backport/**"
21+
if: |
22+
build.env('BUILDKITE_PULL_REQUEST') == "false" && build.branch == "main"
23+
24+
- label: ":git: Create backport branches for new entries"
25+
key: "trigger-backport-create"
26+
command: ".buildkite/scripts/trigger_backport.sh"
27+
agents:
28+
image: "${LINUX_AGENT_IMAGE}"
29+
plugins:
30+
- elastic/vault-github-token#v0.1.0:
31+
depends_on:
32+
- step: "check-backports-inventory"
33+
allow_failure: false
34+
if_changed:
35+
- ".backports.yml"
36+
if: |
37+
build.env('BUILDKITE_PULL_REQUEST') == "false" &&
38+
build.branch == "main" &&
39+
build.env('BUILDKITE_PIPELINE_SLUG') == "integrations-backport-dispatch"
40+
41+
notify:
42+
- email: "$NOTIFY_TO"
43+
if: "build.state == 'failed' && build.env('BUILDKITE_PULL_REQUEST') == 'false'"

‎.buildkite/pipeline.backport.yml‎

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,31 @@ name: "integrations-backport"
55
env:
66
SETUP_GVM_VERSION: "v0.6.0"
77
YQ_VERSION: 'v4.35.2'
8+
GH_CLI_VERSION: "2.29.0"
89
# Agent images used in pipeline steps
910
LINUX_AGENT_IMAGE: "golang:${GO_VERSION}"
11+
NOTIFY_TO: "ecosystem-team@elastic.co"
1012

1113
steps:
1214

1315
- label: "Check that it runs from UI"
1416
key: "check-ui"
1517
command:
16-
- "buildkite-agent annotate \"The $BUILDKITE_PIPELINE_SLUG is used only for running from UI!\" --style 'warning'"
18+
- "buildkite-agent annotate \"The $${BUILDKITE_PIPELINE_SLUG} pipeline can only be triggered from the UI by members of the 'ecosystem' team, or via a trigger step from the 'integrations' or 'integrations-backport-dispatch' pipeline. For the recommended workflow see the [documentation](https://www.elastic.co/guide/en/integrations-developer/current/developer-workflow-support-old-package.html).\" --style 'warning'"
1719
- "exit 1"
18-
if: "build.source != 'ui'"
20+
if: |
21+
!(
22+
(build.source == 'ui' && build.creator.teams includes "ecosystem") ||
23+
(build.source == 'trigger_job' && build.env('BUILDKITE_TRIGGERED_FROM_BUILD_PIPELINE_SLUG') == 'integrations') ||
24+
(build.source == 'trigger_job' && build.env('BUILDKITE_TRIGGERED_FROM_BUILD_PIPELINE_SLUG') == 'integrations-backport-dispatch')
25+
)
26+
27+
# Ensure that the check-ui step runs before any other step
28+
- wait: ~
1929

2030
- input: "Input values for the variables"
2131
key: "input-variables"
32+
if: "build.source != 'trigger_job'"
2233
fields:
2334
- select: "DRY_RUN"
2435
key: "DRY_RUN"
@@ -47,7 +58,15 @@ steps:
4758
value: "true"
4859
- label: "False"
4960
value: "false"
50-
default: "false"
61+
default: "true"
62+
- text: "Backport branch name (optional, defaults to backport-<package>-<major>.<minor>)"
63+
key: "BACKPORT_BRANCH_NAME"
64+
required: false
65+
default: ""
66+
- text: "PR number to notify on completion (optional)"
67+
key: "PR_NUMBER"
68+
required: false
69+
default: ""
5170

5271
- label: "Creating the backport branch"
5372
key: "create-backport-branch"
@@ -62,3 +81,30 @@ steps:
6281
depends_on:
6382
- step: "input-variables"
6483
allow_failure: false
84+
85+
- label: ":github: Notify PR"
86+
key: "notify-pr"
87+
command: |
88+
if ! outcome=$$(buildkite-agent step get "outcome" --step "create-backport-branch"); then
89+
echo "Failed to retrieve step outcome, skipping PR notification"
90+
exit 0
91+
fi
92+
if [[ "$${outcome}" == "passed" ]]; then
93+
NOTIFY_STATUS=success .buildkite/scripts/notify_backport_pr.sh
94+
else
95+
NOTIFY_STATUS=failure .buildkite/scripts/notify_backport_pr.sh
96+
fi
97+
agents:
98+
image: "${LINUX_AGENT_IMAGE}"
99+
plugins:
100+
- elastic/vault-github-token#v0.1.0:
101+
depends_on:
102+
- step: "create-backport-branch"
103+
allow_failure: true
104+
105+
notify:
106+
# Only notify for automated backport creation failures (triggered by integrations-backport-dispatch).
107+
# Dry-run failures from PR builds (triggered by integrations) are already surfaced as a failing
108+
# CI status on the PR itself and do not warrant a team email.
109+
- email: "$NOTIFY_TO"
110+
if: "build.state == 'failed' && build.source == 'trigger_job' && build.env('BUILDKITE_TRIGGERED_FROM_BUILD_PIPELINE_SLUG') == 'integrations-backport-dispatch'"

‎.buildkite/pipeline.schedule-daily.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ steps:
3434
env:
3535
SERVERLESS: "false"
3636
FORCE_CHECK_ALL: "true"
37-
STACK_VERSION: 8.19.16-SNAPSHOT
37+
STACK_VERSION: 8.19.21-SNAPSHOT
3838
PUBLISH_COVERAGE_REPORTS: "true"
3939
depends_on:
4040
- step: "check"
@@ -48,7 +48,7 @@ steps:
4848
env:
4949
SERVERLESS: "false"
5050
FORCE_CHECK_ALL: "true"
51-
STACK_VERSION: 8.19.16-SNAPSHOT
51+
STACK_VERSION: 8.19.21-SNAPSHOT
5252
STACK_LOGSDB_ENABLED: "true"
5353
PUBLISH_COVERAGE_REPORTS: "false"
5454
depends_on:
@@ -86,13 +86,13 @@ steps:
8686
if: |
8787
build.env('TEST_PACKAGES_BASIC_SUBSCRIPTION') == "true"
8888
89-
- label: "Check integrations local stacks - Stack Version v9.5"
89+
- label: "Check integrations local stacks - Stack Version v9.6"
9090
trigger: "integrations"
9191
build:
9292
env:
9393
SERVERLESS: "false"
9494
FORCE_CHECK_ALL: "true"
95-
STACK_VERSION: 9.5.0-SNAPSHOT
95+
STACK_VERSION: 9.6.0-SNAPSHOT
9696
PUBLISH_COVERAGE_REPORTS: "false"
9797
depends_on:
9898
- step: "check"

‎.buildkite/pipeline.schedule-weekly.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@ steps:
2121
env:
2222
SERVERLESS: "false"
2323
FORCE_CHECK_ALL: "true"
24-
STACK_VERSION: 8.19.16-SNAPSHOT
24+
STACK_VERSION: 8.19.21-SNAPSHOT
2525
PUBLISH_COVERAGE_REPORTS: "false"
2626
ELASTIC_PACKAGE_DISABLE_ELASTIC_AGENT_WOLFI: "true"
2727
depends_on:
2828
- step: "check"
2929
allow_failure: false
3030

31-
- label: "Check integrations local stacks and non-wolfi images for Elastic Agent - Stack Version v9.5"
31+
- label: "Check integrations local stacks and non-wolfi images for Elastic Agent - Stack Version v9.6"
3232
trigger: "integrations"
3333
build:
3434
env:
3535
SERVERLESS: "false"
3636
FORCE_CHECK_ALL: "true"
37-
STACK_VERSION: 9.5.0-SNAPSHOT
37+
STACK_VERSION: 9.6.0-SNAPSHOT
3838
PUBLISH_COVERAGE_REPORTS: "false"
3939
ELASTIC_PACKAGE_DISABLE_ELASTIC_AGENT_WOLFI: "true"
4040
depends_on:

‎.buildkite/pipeline.yml‎

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,43 @@ steps:
7373
key: "check-dev-scripts"
7474
command: ".buildkite/scripts/run_dev_scripts_tests.sh"
7575

76+
- label: ":golang: Backport tool tests"
77+
key: "check-backport-tool"
78+
command: ".buildkite/scripts/check_backport_tool.sh"
79+
agents:
80+
image: "${LINUX_AGENT_IMAGE}"
81+
if_changed:
82+
- "cmd/backport/**"
83+
84+
- label: ":ballot_box_with_check: Backports inventory validation"
85+
key: "check-backports-inventory"
86+
command: ".buildkite/scripts/check_backports_inventory.sh"
87+
agents:
88+
image: "${LINUX_AGENT_IMAGE}"
89+
if_changed:
90+
- ".backports.yml"
91+
- ".buildkite/scripts/run_dev_scripts_tests.sh"
92+
- "dev/scripts/**.sh"
93+
- "cmd/backport/**"
94+
if: |
95+
build.env('BUILDKITE_PULL_REQUEST') != "false" &&
96+
build.env('BUILDKITE_PULL_REQUEST_BASE_BRANCH') == "main"
97+
98+
- label: ":git: Trigger backport dry-runs"
99+
key: "trigger-backport-dryrun"
100+
command: ".buildkite/scripts/trigger_backport.sh"
101+
agents:
102+
image: "${LINUX_AGENT_IMAGE}"
103+
depends_on:
104+
- step: "check-backports-inventory"
105+
allow_failure: false
106+
if_changed:
107+
- ".backports.yml"
108+
if: |
109+
build.env('BUILDKITE_PULL_REQUEST') != "false" &&
110+
build.env('BUILDKITE_PIPELINE_SLUG') == "integrations" &&
111+
build.env('BUILDKITE_PULL_REQUEST_BASE_BRANCH') == "main"
112+
76113
- label: ":junit: Sources Junit annotate"
77114
agents:
78115
# requires at least "bash", "curl" and "git"
@@ -89,10 +126,24 @@ steps:
89126
run-in-docker: false
90127
context: junit-sources
91128

129+
- label: ":scroll: Check changelog versions not in main"
130+
key: "check-changelog-versions-in-main"
131+
command: ".buildkite/scripts/check_changelog_versions_in_main.sh"
132+
agents:
133+
image: "${LINUX_AGENT_IMAGE}"
134+
cpu: "2"
135+
memory: "1G"
136+
if: |
137+
build.env('BUILDKITE_PULL_REQUEST') != "false" &&
138+
build.env('BUILDKITE_PULL_REQUEST_BASE_BRANCH') =~ /^backport-/
139+
if_changed:
140+
- "**/changelog.yml"
141+
92142
- label: ":scroll: Check changelog PR links"
93143
key: "check-changelog-pr-links"
94144
command: ".buildkite/scripts/check_changelog_entries.sh"
95-
soft_fail: true
145+
soft_fail:
146+
- exit_status: 2
96147
agents:
97148
image: "${LINUX_AGENT_IMAGE}"
98149
cpu: "2"
@@ -111,6 +162,25 @@ steps:
111162
if_changed:
112163
- "**/changelog.yml"
113164

165+
- label: ":busts_in_silhouette: Check backport package owners"
166+
key: "check-backport-owners"
167+
command: ".buildkite/scripts/check_backport_owners.sh"
168+
soft_fail: true
169+
agents:
170+
image: "${LINUX_AGENT_IMAGE}"
171+
cpu: "2"
172+
memory: "1G"
173+
plugins:
174+
- elastic/vault-github-token#v0.1.0:
175+
depends_on:
176+
- step: "check-buildkite-scripts"
177+
allow_failure: false
178+
if: |
179+
build.env('BUILDKITE_PULL_REQUEST') != "false" &&
180+
build.env('BUILDKITE_PULL_REQUEST_BASE_BRANCH') =~ /^backport-/
181+
if_changed:
182+
- "packages/**"
183+
- ".github/CODEOWNERS"
114184

115185
- label: "Trigger integrations"
116186
key: "test-integrations"

‎.buildkite/pull-requests.json‎

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,31 @@
1414
"skip_ci_labels": [],
1515
"skip_target_branches": [],
1616
"skip_ci_on_only_changed": [
17+
"^.agents/skills/",
1718
"^.buildkite/pipeline.backport.yml$",
19+
"^.buildkite/pipeline.backport-dispatch.yml$",
1820
"^.buildkite/pipeline.publish.yml$",
1921
"^.buildkite/pipeline.serverless.yml$",
2022
"^.buildkite/pipeline.schedule-daily.yml$",
2123
"^.buildkite/pipeline.schedule-weekly.yml$",
2224
"^.buildkite/pull-requests.json$",
2325
"^.buildkite/scripts/backport_branch.sh$",
2426
"^.buildkite/scripts/build_packages.sh$",
27+
"^.buildkite/scripts/check_backport_tool.sh$",
28+
"^.buildkite/scripts/notify_backport_pr.sh$",
29+
"^.github/actions/",
2530
"^.github/dependabot.yml$",
2631
"^.github/workflows/",
2732
"^.github/stale.yml$",
2833
"^.github/ISSUE_TEMPLATE/",
2934
"^.github/PULL_REQUEST_TEMPLATE.md$",
35+
"^.gitignore",
3036
"^.mergify.yml$",
3137
"^catalog-info.yaml$",
3238
"^docs/",
3339
"^CODE_OF_CONDUCT.md$",
3440
"^CONTRIBUTING.md$",
35-
"^README.md$",
36-
"^.agents/skills/"
41+
"^README.md$"
3742
],
3843
"always_require_ci_on_changed": []
3944
},
@@ -85,6 +90,22 @@
8590
"skip_ci_on_only_changed": [],
8691
"always_require_ci_on_changed": []
8792
},
93+
{
94+
"enabled": false,
95+
"pipelineSlug": "integrations-backport-dispatch",
96+
"allow_org_users": true,
97+
"allowed_repo_permissions": ["admin", "write"],
98+
"allowed_list": [],
99+
"set_commit_status": false,
100+
"build_on_commit": false,
101+
"build_on_comment": false,
102+
"trigger_comment_regex": "",
103+
"always_trigger_comment_regex": "",
104+
"skip_ci_labels": [],
105+
"skip_target_branches": [],
106+
"skip_ci_on_only_changed": [],
107+
"always_require_ci_on_changed": []
108+
},
88109
{
89110
"enabled": false,
90111
"pipelineSlug": "integrations-publish",

0 commit comments

Comments
 (0)