Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .ci/updatecli.d/bump-upstream-agent-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Upgrade the upstream agent version and related transitive dependencies
# This task
# - checks if the current otel-agent version referenced by the distro is the latest release
# - if not, it will update the agent version AND the semconv and contrib versions to match the upstream

scms:
githubConfig:
kind: github
spec:
user: '{{ requiredEnv "GITHUB_ACTOR" }}'
owner: JonasKunz
repository: elastic-otel-java
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
branch: main
commitusingapi: true

sources:

upstream-agent-version:
kind: githubrelease
spec:
owner: open-telemetry
repository: opentelemetry-java-instrumentation
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
typefilter:
latest: true
transformers:
- trimprefix: "v"

distro-otel-agent-version:
kind: toml
scmid: githubConfig
spec:
file: gradle/libs.versions.toml
key: versions.opentelemetryJavaagentAlpha

conditions:
update-required:
disablesourceinput: true
kind: shell
spec:
command: test "{{ source "upstream-agent-version" }}-alpha" != "{{ source "distro-otel-agent-version" }}"

targets:

update-agent-version:
name: "Update upstream OpenTelemetry agent version and related dependencies"
conditionids: [update-required]
disablesourceinput: true
kind: shell # toml action currently erases comments, so we fallback to regex-replace
scmid: githubConfig
spec:
command: gradle/update-upstream.sh v{{ source "upstream-agent-version" }} && echo "Update successful"

actions:
open-pr:
kind: github/pullrequest
scmid: githubConfig
title: 'Update upstream OpenTelemetry agent dependencies to {{ source "upstream-agent-version" }}'
spec:
automerge: false
labels:
- dependencies
description: |
@elastic/apm-agent-java, can you please approve and merge this PR?
32 changes: 32 additions & 0 deletions .github/workflows/updatecli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: updatecli

on:
workflow_dispatch: ~
#schedule:
# - cron: '0 6 * * *'

#permissions:
# contents: read

jobs:
bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
#- uses: actions/setup-java@v4
# with:
# java-version: 11
# distribution: temurin

- uses: elastic/oblt-actions/updatecli/run@v1
with:
command: "--experimental apply --config .ci/updatecli.d"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

#- if: failure()
# uses: elastic/oblt-actions/slack/send@v1
# with:
# bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
# channel-id: "#apm-agent-java"
# message: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, @robots-ci please look what's going on <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>"
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ opentelemetryProto = "1.3.2-alpha"

# otel agent, we rely on the '*-alpha' and get the non-alpha dependencies transitively
# updated from upstream agent with .ci/update-upstream.sh
opentelemetryJavaagentAlpha = "2.4.0-alpha"
opentelemetryJavaagentAlpha = "2.6.0-alpha"

# otel contrib
# updated from upstream agent with .ci/update-upstream.sh
Expand Down