-
Notifications
You must be signed in to change notification settings - Fork 175
ci: automatically update OTel components #8288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
andrzej-stencel
merged 10 commits into
elastic:main
from
andrzej-stencel:update-otel-automatically
Jun 9, 2025
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
1e3d534
automatically update OTel components
andrzej-stencel 45e8d9f
Merge remote-tracking branch 'upstream/main' into update-otel-automat…
andrzej-stencel 373864e
restore `go mod tidy` in `update-otel.sh`
andrzej-stencel 8dfeccd
fix: install changelog tool if missing
andrzej-stencel bc9e62c
fix: add missing env vars to Updatecli target config
andrzej-stencel ebbb578
Merge remote-tracking branch 'upstream/main' into update-otel-automat…
andrzej-stencel ed86c71
define branch matrix as a static list
andrzej-stencel dc12b78
Merge branch 'main' into update-otel-automatically
andrzej-stencel 4853c2d
run Updatecli script from the main branch
andrzej-stencel dacbe72
Merge branch 'main' into update-otel-automatically
andrzej-stencel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- | ||
name: Update OTel | ||
pipelineid: 'updatecli-update-otel-{{ requiredEnv "BRANCH_NAME" }}' | ||
|
||
scms: | ||
default: | ||
kind: github | ||
spec: | ||
user: '{{ requiredEnv "GITHUB_ACTOR" }}' | ||
username: '{{ requiredEnv "GITHUB_ACTOR" }}' | ||
owner: '{{ .scm.owner }}' | ||
repository: '{{ .scm.repository }}' | ||
token: '{{ requiredEnv "GITHUB_TOKEN" }}' | ||
branch: '{{ requiredEnv "BRANCH_NAME" }}' | ||
commitusingapi: true | ||
|
||
sources: | ||
current_core_beta: | ||
kind: golang/gomod | ||
name: Get current OTel Collector core beta version in go.mod | ||
spec: | ||
module: go.opentelemetry.io/collector/receiver/otlpreceiver | ||
latest_core_beta: | ||
kind: golang/module | ||
name: Get latest OTel Collector core beta version | ||
spec: | ||
module: go.opentelemetry.io/collector/receiver/otlpreceiver | ||
latest_core_stable: | ||
kind: golang/module | ||
name: Get latest OTel Collector core stable version | ||
spec: | ||
module: go.opentelemetry.io/collector/component | ||
current_contrib: | ||
kind: golang/gomod | ||
name: Get current OTel Collector contrib version in go.mod | ||
spec: | ||
module: github.com/open-telemetry/opentelemetry-collector-contrib/connector/routingconnector | ||
latest_contrib: | ||
kind: golang/module | ||
name: Get latest OTel Collector contrib version | ||
spec: | ||
module: github.com/open-telemetry/opentelemetry-collector-contrib/connector/routingconnector | ||
|
||
conditions: | ||
is-new-version: | ||
name: Succeeds if the latest core or contrib OTel Collector version is different than the one in go.mod | ||
kind: shell | ||
disablesourceinput: true | ||
scmid: default | ||
spec: | ||
command: '[ {{ source "current_core_beta" }} != {{ source "latest_core_beta" }} ] || [ {{ source "current_contrib" }} != {{ source "latest_contrib" }} ]' | ||
|
||
targets: | ||
update-otel: | ||
name: Update OTel version | ||
kind: shell | ||
disablesourceinput: true | ||
spec: | ||
command: .ci/scripts/update-otel.sh {{ source "latest_core_beta" }} {{ source "latest_core_stable" }} {{ source "latest_contrib" }} | ||
|
||
actions: | ||
default: | ||
title: '[{{ requiredEnv "BRANCH_NAME" }}][Automation] Update OTel to {{ source "latest_contrib" }}' | ||
kind: github/pullrequest | ||
scmid: default | ||
spec: | ||
automerge: false | ||
labels: | ||
- automation | ||
- skip-changelog | ||
- "Team:Elastic-Agent-Control-Plane" | ||
description: | | ||
Updates OTel components to core [{{ source "latest_core_stable" }}/{{ source "latest_core_beta" }}](https://github.com/open-telemetry/opentelemetry-collector/releases/{{ source "latest_core_beta" }}) | ||
and contrib [{{ source "latest_contrib" }}](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/{{ source "latest_contrib" }}) | ||
on branch `{{ requiredEnv "BRANCH_NAME" }}`.' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: bump-otel-version | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '24 5 * * 1-5' | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | ||
|
||
jobs: | ||
filter: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 1 | ||
outputs: | ||
matrix: ${{ steps.generator.outputs.matrix }} | ||
permissions: | ||
contents: read | ||
steps: | ||
- id: generator | ||
uses: elastic/oblt-actions/elastic/active-branches@v1 | ||
with: | ||
# Only run on `main` and `8.19` branches | ||
exclude-branches: "7.17,8.17,8.18,9.0" | ||
andrzej-stencel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
filter-branches: true | ||
|
||
update-otel: | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
needs: | ||
- filter | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJson(needs.filter.outputs.matrix) }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ matrix.branch }} | ||
andrzej-stencel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: 'go.mod' | ||
|
||
- name: Run Updatecli in Apply mode | ||
uses: elastic/oblt-actions/updatecli/run@v1 | ||
with: | ||
command: apply --config .ci/updatecli/update-otel.yml --values .ci/updatecli/values.d/scm.yml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH_NAME: ${{ matrix.branch }} | ||
|
||
- 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>" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.