From bb42aea84a4151a2c20dc5e65d9e84c5fe53341d Mon Sep 17 00:00:00 2001 From: Roger Coll Date: Thu, 16 Oct 2025 09:19:47 +0200 Subject: [PATCH 1/5] ci: add workflow to bump OpenTelemetry Kube Stack version --- .ci/scripts/update-integration-testdata.sh | 9 +++ .ci/updatecli/updatecli-bump-kube-stack.yml | 60 +++++++++++++++++++ .github/workflows/bump-kube-stack-version.yml | 36 +++++++++++ 3 files changed, 105 insertions(+) create mode 100755 .ci/scripts/update-integration-testdata.sh create mode 100644 .ci/updatecli/updatecli-bump-kube-stack.yml create mode 100644 .github/workflows/bump-kube-stack-version.yml diff --git a/.ci/scripts/update-integration-testdata.sh b/.ci/scripts/update-integration-testdata.sh new file mode 100755 index 00000000000..8794104e752 --- /dev/null +++ b/.ci/scripts/update-integration-testdata.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# +# This script is executed by the automation we are putting in place +# and it requires the git add/commit commands. +# +set -euo pipefail + +echo "~~~ Updating integration tests testdata" +mage integration:buildKubernetesTestData diff --git a/.ci/updatecli/updatecli-bump-kube-stack.yml b/.ci/updatecli/updatecli-bump-kube-stack.yml new file mode 100644 index 00000000000..ea85ceb7d00 --- /dev/null +++ b/.ci/updatecli/updatecli-bump-kube-stack.yml @@ -0,0 +1,60 @@ +--- +name: Bump OpenTelemetry Kube Stack Helm Chart to latest versions + +scms: + elastic-agent: + kind: github + spec: + user: '{{ requiredEnv "GITHUB_ACTOR" }}' + username: '{{ requiredEnv "GITHUB_ACTOR" }}' + owner: '{{ .scm.owner }}' + repository: '{{ .scm.repository }}' + token: '{{ requiredEnv "GITHUB_TOKEN" }}' + commitusingapi: true + branch: '{{ .scm.branch }}' + force: false + + +actions: + elastic-agent: + kind: github/pullrequest + scmid: elastic-agent + spec: + automerge: false + labels: + - backport-active-8 + - backport-active-9 + - dependencies + - skip-changelog + - Team:Elastic-Agent-Control-Plane + title: '[otel/kube-stack] Update the OpenTelemetry Kube Stack Helm Chart to latest versions' + description: | + Update the versions of the OpenTelemetry Kube Stack Helm Chart being used in the OpenTelemetry Onboarding configuration. + +sources: + opentelemetry-kube-stack-helm: + name: "Get latest OpenTelemetry Kube Stack Helm Chart release" + kind: helmchart + spec: + url: https://open-telemetry.github.io/opentelemetry-helm-charts + name: opentelemetry-kube-stack + +targets: + update-tested-kube-stack: + name: "Update tested OpenTelemetry Kube Stack Helm Chart in k8s.go" + kind: file + scmid: elastic-agent + sourceid: opentelemetry-kube-stack-helm + spec: + file: "testing/integration/k8s/k8s.go" + matchpattern: "KubeStackChartVersion .*" + replacepattern: 'KubeStackChartVersion = "{{ source "opentelemetry-kube-stack-helm" }}"' + + update-testdata: + name: 'Update local OpenTelemetry Kube Stack Helm Chart files' + dependson: + - update-tested-kube-stack + scmid: elastic-agent + kind: shell + spec: + command: .ci/scripts/update-integration-testdata.sh diff --git a/.github/workflows/bump-kube-stack-version.yml b/.github/workflows/bump-kube-stack-version.yml new file mode 100644 index 00000000000..8a3e8ce736a --- /dev/null +++ b/.github/workflows/bump-kube-stack-version.yml @@ -0,0 +1,36 @@ +--- +name: bump-edot-images + +on: + workflow_dispatch: + schedule: + - cron: "0 20 * * 1-6" + +permissions: + contents: read + +env: + JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + +jobs: + bump: + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + + - uses: elastic/oblt-actions/updatecli/run@v1 + with: + command: apply --config .ci/updatecli/updatecli-bump-kube-stack.yml --values .ci/updatecli/values.d/scm.yml + version-file: .updatecli-version + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - if: ${{ failure() }} + uses: elastic/oblt-actions/slack/send@v1 + with: + bot-token: ${{ secrets.SLACK_BOT_TOKEN }} + channel-id: "#ingest-notifications" + message: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, `@agent-team` please look what's going on <${{ env.JOB_URL }}|here>" From 9a2baf83176498919e00ffa62e953d44a099c042 Mon Sep 17 00:00:00 2001 From: Roger Coll Date: Thu, 16 Oct 2025 10:43:39 +0200 Subject: [PATCH 2/5] Update .github/workflows/bump-kube-stack-version.yml Co-authored-by: Victor Martinez --- .github/workflows/bump-kube-stack-version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bump-kube-stack-version.yml b/.github/workflows/bump-kube-stack-version.yml index 8a3e8ce736a..761a0a3e819 100644 --- a/.github/workflows/bump-kube-stack-version.yml +++ b/.github/workflows/bump-kube-stack-version.yml @@ -1,5 +1,5 @@ --- -name: bump-edot-images +name: bump-kube-stack-version on: workflow_dispatch: From 77ff9c7fdb16aceb9d0c39000e381a5fd494bba5 Mon Sep 17 00:00:00 2001 From: Roger Coll Date: Thu, 16 Oct 2025 10:43:49 +0200 Subject: [PATCH 3/5] Update .ci/updatecli/updatecli-bump-kube-stack.yml Co-authored-by: Victor Martinez --- .ci/updatecli/updatecli-bump-kube-stack.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.ci/updatecli/updatecli-bump-kube-stack.yml b/.ci/updatecli/updatecli-bump-kube-stack.yml index ea85ceb7d00..67376ebc9bf 100644 --- a/.ci/updatecli/updatecli-bump-kube-stack.yml +++ b/.ci/updatecli/updatecli-bump-kube-stack.yml @@ -22,8 +22,7 @@ actions: spec: automerge: false labels: - - backport-active-8 - - backport-active-9 + - backport-active-all - dependencies - skip-changelog - Team:Elastic-Agent-Control-Plane From 34a766b84fd49654b6701822a7dc6c795c1abcf6 Mon Sep 17 00:00:00 2001 From: Roger Coll Date: Thu, 16 Oct 2025 12:14:42 +0200 Subject: [PATCH 4/5] use regex group for version replacement --- .ci/scripts/update-integration-testdata.sh | 2 +- .ci/updatecli/updatecli-bump-kube-stack.yml | 9 ++++++--- .github/workflows/bump-kube-stack-version.yml | 6 ++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.ci/scripts/update-integration-testdata.sh b/.ci/scripts/update-integration-testdata.sh index 8794104e752..c53c01e86bf 100755 --- a/.ci/scripts/update-integration-testdata.sh +++ b/.ci/scripts/update-integration-testdata.sh @@ -5,5 +5,5 @@ # set -euo pipefail -echo "~~~ Updating integration tests testdata" +echo "~~~ Running mage integration:buildKubernetesTestData" mage integration:buildKubernetesTestData diff --git a/.ci/updatecli/updatecli-bump-kube-stack.yml b/.ci/updatecli/updatecli-bump-kube-stack.yml index 67376ebc9bf..10ca5ef0cec 100644 --- a/.ci/updatecli/updatecli-bump-kube-stack.yml +++ b/.ci/updatecli/updatecli-bump-kube-stack.yml @@ -46,8 +46,8 @@ targets: sourceid: opentelemetry-kube-stack-helm spec: file: "testing/integration/k8s/k8s.go" - matchpattern: "KubeStackChartVersion .*" - replacepattern: 'KubeStackChartVersion = "{{ source "opentelemetry-kube-stack-helm" }}"' + matchpattern: '(KubeStackChartVersion\s*=\s)".*"' + replacepattern: '$1"{{ source "opentelemetry-kube-stack-helm" }}"' update-testdata: name: 'Update local OpenTelemetry Kube Stack Helm Chart files' @@ -56,4 +56,7 @@ targets: scmid: elastic-agent kind: shell spec: - command: .ci/scripts/update-integration-testdata.sh + command: /home/neck/Documents/github/rogercoll/elastic-agent/.ci/scripts/update-integration-testdata.sh + environments: + - name: PATH + - name: HOME diff --git a/.github/workflows/bump-kube-stack-version.yml b/.github/workflows/bump-kube-stack-version.yml index 761a0a3e819..9394fb22c38 100644 --- a/.github/workflows/bump-kube-stack-version.yml +++ b/.github/workflows/bump-kube-stack-version.yml @@ -21,6 +21,12 @@ jobs: steps: - uses: actions/checkout@v5 + - name: Install mage + uses: magefile/mage-action@6f50bbb8ea47d56e62dee92392788acbc8192d0b # v3.1.0 + with: + version: v1.14.0 + install-only: true + - uses: elastic/oblt-actions/updatecli/run@v1 with: command: apply --config .ci/updatecli/updatecli-bump-kube-stack.yml --values .ci/updatecli/values.d/scm.yml From 4a53ad59c69e6c2feb9acd4348be1805732e15fa Mon Sep 17 00:00:00 2001 From: Roger Coll Date: Thu, 16 Oct 2025 12:19:33 +0200 Subject: [PATCH 5/5] add script codeowners and target backport-9 branch --- .ci/updatecli/updatecli-bump-kube-stack.yml | 2 +- .github/CODEOWNERS | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.ci/updatecli/updatecli-bump-kube-stack.yml b/.ci/updatecli/updatecli-bump-kube-stack.yml index 10ca5ef0cec..f20c9bc6344 100644 --- a/.ci/updatecli/updatecli-bump-kube-stack.yml +++ b/.ci/updatecli/updatecli-bump-kube-stack.yml @@ -22,7 +22,7 @@ actions: spec: automerge: false labels: - - backport-active-all + - backport-active-9 - dependencies - skip-changelog - Team:Elastic-Agent-Control-Plane diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0eb263b23d5..9cdfc153f25 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -13,6 +13,7 @@ changelog/fragments/ /.buildkite @elastic/elastic-agent-control-plane @elastic/observablt-ci /.ci @elastic/elastic-agent-control-plane @elastic/observablt-ci /.ci/scripts/ecp-internal-release.sh @elastic/elastic-agent-control-plane +/.ci/scripts/update-integration-testdata.sh @elastic/elastic-agent-control-plane /.ci/scripts/update-otel.sh @elastic/elastic-agent-control-plane /.github @elastic/elastic-agent-control-plane @elastic/observablt-ci /.github/CODEOWNERS @elastic/ingest-tech-lead