amazon-cloudwatch-agent icon indicating copy to clipboard operation
amazon-cloudwatch-agent copied to clipboard

Add script to update OTel dependencies and simplify GitHub Action

Open the-mann opened this issue 2 months ago • 0 comments

Description of the issue

The current GitHub Action workflow for updating OpenTelemetry dependencies uses many individual go mod edit commands, making it verbose and hard to maintain. Additionally, there's no easy way for developers to manually update these dependencies locally.

Description of changes

  • Added scripts/update-otel-deps.sh: A script that uses regex to update all amazon-contributing/opentelemetry-collector-contrib dependencies to the latest commit from the aws-cwa-dev branch
  • Added make update-otel-deps target: Provides an easy way for developers to run the update script
  • Simplified GitHub Action: Updated .github/workflows/otel-fork-replace.yml to use the new script instead of individual go mod edit commands
  • Improved safety: The regex only targets replace directives (with => prefix) to avoid accidentally updating dependencies in the require section
  • Proper formatting: Uses space-separated format compatible with go mod, letting go mod tidy generate correct pseudo-versions

License

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Tests

  • Tested regex pattern to ensure it only matches amazon-contributing dependencies in replace directives
  • Verified script works with make update-otel-deps
  • Confirmed go mod tidy generates proper pseudo-versions after script execution

Requirements

Before commiting your code, please do the following steps.

  1. Run make fmt and make fmt-sh
  2. Run make lint

Integration Tests

To run integration tests against this PR, add the ready for testing label.

the-mann avatar Dec 11 '25 18:12 the-mann