Skip to content

Conversation

@the-mann
Copy link
Contributor

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.

- Add scripts/update-otel-deps.sh to update all amazon-contributing/opentelemetry-collector-contrib dependencies to latest commit from aws-cwa-dev branch
- Add make update-otel-deps target
- Update .github/workflows/otel-fork-replace.yml to use the new script
- Use regex to ensure only amazon-contributing dependencies are updated
@the-mann the-mann requested a review from a team as a code owner December 11, 2025 18:47
@TravisStark TravisStark added the ready for testing Indicates this PR is ready for integration tests to run label Dec 15, 2025
TravisStark
TravisStark previously approved these changes Dec 15, 2025
…or handling

- Accept commit SHA as parameter in update-otel-deps.sh script
- Pass SHA from workflow step output to script for consistency
- Add error handling and progress messages
- Make go mod tidy verbose to show what it's doing
- Check for go.mod existence before attempting updates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for testing Indicates this PR is ready for integration tests to run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants