Skip to content

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

Conversation

andrzej-stencel
Copy link
Contributor

What does this PR do?

Creates a new Updatecli configuration to check if a new version of OTel Collector components is available. If it is, Updatecli runs the update-otel.sh script and creates a new PR with the changes.

Also creates a new GitHub Actions workflow to trigger the Updatecli configuration daily. The workflow is configured torun for the main branch and for the 8.19 branch.

Why is it important?

We want to be on the latest version of OTel Collector components on main and 8.19 branches. We already had a script to update OTel dependencies that took as parameters the versions to update to. What this PR adds is checking for latest OTel versions online and triggering the script if an update is required.

Checklist

  • I have read and understood the pull request guidelines of this project.
  • My code follows the style guidelines of this project
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [ ] I have added an entry in ./changelog/fragments using the changelog tool
  • [ ] I have added an integration test or an E2E test

How to test this PR locally

BRANCH_NAME=main updatecli diff --config ./.ci/updatecli/update-otel.yml

This will succeed locally if you remove the references to SCM from the file .ci/updatecli/update-otel.yml: scms, conditions.is-new-version.scmid, actions.

Related issues

Creates a new GitHub Actions workflow that runs Updatecli daily to check if a new version of OTel components is available. If it is, Updatecli runs the `update-otel.sh` script and creates a new PR with the changes.

These automated updates are currently configured to run for the `main` branch and for the `8.19` branch.
@andrzej-stencel andrzej-stencel requested review from a team as code owners June 2, 2025 12:28
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

Copy link
Contributor

mergify bot commented Jun 2, 2025

This pull request does not have a backport label. Could you fix it @andrzej-stencel? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-./d./d is the label that automatically backports to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

@andrzej-stencel andrzej-stencel added the backport-8.19 Automated backport to the 8.19 branch label Jun 2, 2025
@andrzej-stencel andrzej-stencel requested review from a team, ycombinator and kaanyalti and removed request for a team June 2, 2025 13:31
@v1v
Copy link
Member

v1v commented Jun 2, 2025

To test locally against the main branch, you can use the below snippet (as long as you have gh locally):

$ gh pr checkout 8288
$ GITHUB_TOKEN=$(gh auth token) \
  GITHUB_ACTOR=v1v \
  BRANCH_NAME=main updatecli diff \
    --config ./.ci/updatecli/update-otel.yml 
    --values .ci/updatecli/values.d/scm.yml


+++++++++++
+ PREPARE +
+++++++++++
[..]


condition: condition#is-new-version
------------------------
The shell 🐚 command "/bin/sh /var/folders/t7/ghqdh8cx2g12pwb_w0ncmw900000gn/T/updatecli/bin/b8e0f34aa6b0f3e4759c4ad975a6de8175acea171186f323dc1c3c345e68a176.sh" exited on error (exit code 1) with the following output:
----
----

command stderr output was:
----
----
shell command failed. Expected exit code 0 but got 1
✗ shell condition of type "console/output" not passing

target: target#update-otel
------------------


ACTIONS
========

No target found for action "default"

=============================

SUMMARY:



- Update OTel:
	Source:
		✔ [current_contrib] Get current OTel Collector contrib version in go.mod
		✔ [current_core_beta] Get current OTel Collector core beta version in go.mod
		✔ [latest_contrib] Get latest OTel Collector contrib version
		✔ [latest_core_beta] Get latest OTel Collector core beta version
		✔ [latest_core_stable] Get latest OTel Collector core stable version
	Condition:
		✗ [is-new-version] Succeeds if the latest core or contrib OTel Collector version is different than the one in go.mod
	Target:
		- [update-otel] 


Run Summary
===========
Pipeline(s) run:
  * Changed:	0
  * Failed:	0
  * Skipped:	1
  * Succeeded:	0
  * Total:	1

Copy link
Contributor

mergify bot commented Jun 3, 2025

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b update-otel-automatically upstream/update-otel-automatically
git merge upstream/main
git push upstream update-otel-automatically

v1v
v1v previously approved these changes Jun 4, 2025
Copy link
Member

@v1v v1v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Copy link
Contributor

mergify bot commented Jun 5, 2025

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b update-otel-automatically upstream/update-otel-automatically
git merge upstream/main
git push upstream update-otel-automatically

swiatekm
swiatekm previously approved these changes Jun 6, 2025
v1v
v1v previously approved these changes Jun 6, 2025
Copy link
Member

@v1v v1v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a question about where the updatecli pipeline needs to be defined

@andrzej-stencel andrzej-stencel dismissed stale reviews from v1v and swiatekm via 4853c2d June 9, 2025 07:26
@andrzej-stencel andrzej-stencel merged commit 7766913 into elastic:main Jun 9, 2025
8 checks passed
@andrzej-stencel andrzej-stencel deleted the update-otel-automatically branch June 9, 2025 08:02
mergify bot pushed a commit that referenced this pull request Jun 9, 2025
* automatically update OTel components

Creates a new GitHub Actions workflow that runs Updatecli daily to check if a new version of OTel components is available. If it is, Updatecli runs the `update-otel.sh` script and creates a new PR with the changes.

These automated updates are currently configured to run for the `main` branch and for the `8.19` branch.

* restore `go mod tidy` in `update-otel.sh`

Forward-porting #8326

* fix: install changelog tool if missing

* fix: add missing env vars to Updatecli target config

* define branch matrix as a static list

* run Updatecli script from the main branch

(cherry picked from commit 7766913)
andrzej-stencel added a commit that referenced this pull request Jun 9, 2025
* automatically update OTel components

Creates a new GitHub Actions workflow that runs Updatecli daily to check if a new version of OTel components is available. If it is, Updatecli runs the `update-otel.sh` script and creates a new PR with the changes.

These automated updates are currently configured to run for the `main` branch and for the `8.19` branch.

* restore `go mod tidy` in `update-otel.sh`

Forward-porting #8326

* fix: install changelog tool if missing

* fix: add missing env vars to Updatecli target config

* define branch matrix as a static list

* run Updatecli script from the main branch

(cherry picked from commit 7766913)

Co-authored-by: Andrzej Stencel <andrzej.stencel@elastic.co>
michel-laterman pushed a commit to michel-laterman/elastic-agent that referenced this pull request Jun 9, 2025
* automatically update OTel components

Creates a new GitHub Actions workflow that runs Updatecli daily to check if a new version of OTel components is available. If it is, Updatecli runs the `update-otel.sh` script and creates a new PR with the changes.

These automated updates are currently configured to run for the `main` branch and for the `8.19` branch.

* restore `go mod tidy` in `update-otel.sh`

Forward-porting elastic#8326

* fix: install changelog tool if missing

* fix: add missing env vars to Updatecli target config

* define branch matrix as a static list

* run Updatecli script from the main branch
v1v added a commit that referenced this pull request Jun 12, 2025
…ts-oblt-cli

* feature/serverless-its-oblt-cli: (51 commits)
  as agreed let's move the group to the kb.integration pipeline
  Update .github/workflows/serverless-project.yml
  ci: invoke serverless integration tests package from BK
  github-actions: create a serverless project daily
  [tests] split up serverless and resource leaks integration tests (#8396)
  chore: Update to elastic/beats@dfdc12e33de0 (#8446)
  Lock upgrade marker (#8254)
  build(deps): bump github.com/elastic/elastic-agent-system-metrics from 0.11.12 to 0.11.13 (#8420)
  Add docker image name template and renamed fips cloud specs (#8429)
  buildkite(scripts): refactor common scripts (#8365)
  Use require.Eventually to try and address flakiness (#8421)
  Fix pre-command to support extended testing (#8418)
  [Automation] Bump Golang version to 1.24.4 (#8384)
  chore: Update to elastic/beats@aed2a8b768bd (#8423)
  [main][Automation] Update versions (#8425)
  Add Pipeline to deploy custom agent image for FIPS testing (#8035)
  ci: automatically update OTel components (#8288)
  [Automation] Bump VM Image version to 1749258065 (#8390)
  fix: increase context timeout to accommodate for slower machines in Test_checkForUnprivilegedVault (#8374)
  otel: add cumulativetodeltaprocessor to EDOT collector (#8372)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.19 Automated backport to the 8.19 branch ci skip-changelog Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update all OTel upstream dependencies regularly and atomically
5 participants