Skip to content
Merged
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
4 changes: 3 additions & 1 deletion .github/workflows/update-otel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
exec > >(tee log.out) 2>&1
LAST_COMMIT="$(git -C ./opentelemetry-collector/ rev-parse HEAD)"
LAST_CONTRIB_COMMIT="$(git -C ./opentelemetry-collector-contrib/ rev-parse HEAD)"
GO_VERSION="$(grep '^go ' ./opentelemetry-collector/service/go.mod | awk '{print $2}')"
cd nrdot-collector-components
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
Expand All @@ -54,6 +55,7 @@ jobs:
make gennrdotcol
echo "LAST_COMMIT=$LAST_COMMIT" >> "$GITHUB_ENV"
echo "LAST_CONTRIB_COMMIT=$LAST_CONTRIB_COMMIT" >> "$GITHUB_ENV"
echo "GO_VERSION=$GO_VERSION" >> "$GITHUB_ENV"
echo "BRANCH_NAME=$branch" >> "$GITHUB_ENV"
- name: Gets packages from links with retries
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
Expand All @@ -64,7 +66,7 @@ jobs:
retry_on: error
command: |
cd nrdot-collector-components
make update-otel OTEL_STABLE_VERSION=${{ env.LAST_COMMIT }} OTEL_VERSION=${{ env.LAST_COMMIT }} CONTRIB_VERSION=${{ env.LAST_CONTRIB_COMMIT }}
make update-otel OTEL_STABLE_VERSION=${{ env.LAST_COMMIT }} OTEL_VERSION=${{ env.LAST_COMMIT }} CONTRIB_VERSION=${{ env.LAST_CONTRIB_COMMIT }} GO_VERSION=${{ env.GO_VERSION }}
- name: Push and create PR
run: |
cd nrdot-collector-components
Expand Down
25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -443,11 +443,36 @@ define updatehelper
done
endef

.PHONY: update-golang
update-golang:
ifndef VERSION
$(error VERSION is required. Usage: make update-golang VERSION=1.24.11)
endif
@echo "Bumping Go version to $(VERSION)..."

# Update main go.mod
@echo "Updating main go.mod..."
@sed -i '' -E 's/^go [0-9]+\.[0-9]+.*/go $(VERSION)/' go.mod

# Update all module go.mod files
@echo "Updating all module go.mod files..."
@find . -name "go.mod" -type f -not -path "./go.mod" -exec sed -i '' -E 's/^go [0-9]+\.[0-9]+\.[0-9]+/go $(VERSION)/g' {} \;

@echo ""
@echo "✓ Successfully bumped golang version to $(VERSION)"
@echo ""

.PHONY: update-otel
update-otel:$(MULTIMOD)
# Make sure cmd/nrdotcol/go.mod and cmd/oteltestbedcol/go.mod are present
$(MAKE) gennrdotcol
$(MAKE) genoteltestbedcol
# Update Go version if provided
ifdef GO_VERSION
@echo "Updating Go version to $(GO_VERSION)..."
$(MAKE) update-golang VERSION=$(GO_VERSION)
git add . && git commit -s -m "[chore] update golang to $(GO_VERSION)" --allow-empty || true
endif
$(MULTIMOD) sync -s=true -o ../opentelemetry-collector -m stable --commit-hash "$(OTEL_STABLE_VERSION)"
git add . && git commit -s -m "[chore] multimod update stable modules" || true
$(MULTIMOD) sync -s=true -o ../opentelemetry-collector -m beta --commit-hash "$(OTEL_VERSION)"
Expand Down
Loading