Skip to content
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

[chore] use multimod diff #8024

Merged
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
40 changes: 2 additions & 38 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -432,44 +432,8 @@ push-tags: $(MULTIMOD)
done;

.PHONY: check-changes
check-changes: $(YQ)
ifndef MODSET
@echo "MODSET not defined"
@echo "usage: make check-changes PREVIOUS_VERSION=<version eg 0.52.0> MODSET=beta"
exit 1
endif
ifndef PREVIOUS_VERSION
@echo "PREVIOUS_VERSION not defined"
@echo "usage: make check-changes PREVIOUS_VERSION=<version eg 0.52.0> MODSET=beta"
exit 1
else
ifeq (, $(findstring v,$(PREVIOUS_VERSION)))
NORMALIZED_PREVIOUS_VERSION="v$(PREVIOUS_VERSION)"
else
NORMALIZED_PREVIOUS_VERSION="$(PREVIOUS_VERSION)"
endif
endif
@all_submods=$$($(YQ) e '.module-sets.*.modules[] | select(. != "go.opentelemetry.io/collector")' versions.yaml | sed 's/^go\.opentelemetry\.io\/collector\///'); \
mods=$$($(YQ) e '.module-sets.$(MODSET).modules[]' versions.yaml | sed 's/^go\.opentelemetry\.io\/collector\///'); \
changed_files=""; \
for mod in $${mods}; do \
if [ "$${mod}" == "go.opentelemetry.io/collector" ]; then \
changed_files+=$$(git diff --name-only $(NORMALIZED_PREVIOUS_VERSION) -- $$(printf '%s\n' $${all_submods[@]} | sed 's/^/:!/' | paste -sd' ' -) | grep -E '.+\.go$$'); \
elif ! git rev-parse --quiet --verify $${mod}/$(NORMALIZED_PREVIOUS_VERSION) >/dev/null; then \
echo "Module $${mod} does not have a $(NORMALIZED_PREVIOUS_VERSION) tag"; \
echo "$(MODSET) release is required."; \
exit 0; \
else \
changed_files+=$$(git diff --name-only $${mod}/$(NORMALIZED_PREVIOUS_VERSION) -- $${mod} | grep -E '.+\.go$$'); \
fi; \
done; \
if [ -n "$${changed_files}" ]; then \
echo "The following files changed in $(MODSET) modules since $(NORMALIZED_PREVIOUS_VERSION): $${changed_files}"; \
else \
echo "No $(MODSET) modules have changed since $(NORMALIZED_PREVIOUS_VERSION)"; \
echo "No need to release $(MODSET)."; \
exit 1; \
fi
check-changes: $(MULTIMOD)
$(MULTIMOD) diff -p $(PREVIOUS_VERSION) -m $(MODSET)

.PHONY: prepare-release
prepare-release:
Expand Down
2 changes: 1 addition & 1 deletion internal/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/pavius/impi v0.0.3
go.opentelemetry.io/build-tools/checkdoc v0.9.0
go.opentelemetry.io/build-tools/chloggen v0.9.0
go.opentelemetry.io/build-tools/crosslink v0.8.0
go.opentelemetry.io/build-tools/crosslink v0.9.0
go.opentelemetry.io/build-tools/multimod v0.9.0
go.opentelemetry.io/build-tools/semconvgen v0.9.0
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1
Expand Down
6 changes: 3 additions & 3 deletions internal/tools/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6
github.com/onsi/ginkgo/v2 v2.9.4 h1:xR7vG4IXt5RWx6FfIjyAtsoMAtnc3C/rFXBBd2AjZwE=
github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE=
github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw=
github.com/otiai10/copy v1.11.0 h1:OKBD80J/mLBrwnzXqGtFCzprFSGioo30JcmR4APsNwc=
github.com/otiai10/copy v1.12.0 h1:cLMgSQnXBs1eehF0Wy/FAGsgDTDmAqFR7rQylBb1nDY=
github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE=
github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs=
github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo=
Expand Down Expand Up @@ -654,8 +654,8 @@ go.opentelemetry.io/build-tools/checkdoc v0.9.0 h1:Jk0MggS4gUJrRlq4XKSV4hmIyDU/T
go.opentelemetry.io/build-tools/checkdoc v0.9.0/go.mod h1:3dQZFtq1x9RrKDM3RWGo1BQjZxH67zUrKmsjLegWttc=
go.opentelemetry.io/build-tools/chloggen v0.9.0 h1:sHdl6T5NTlGhRwy7du4APkd2GZEamI4DfBitdKlzxGU=
go.opentelemetry.io/build-tools/chloggen v0.9.0/go.mod h1:zuYbAo3TkrHo3C7lCrM5dHWSS50BDr0UfRYtyBFv2dQ=
go.opentelemetry.io/build-tools/crosslink v0.8.0 h1:rYpcYwNX4//WbSvwHCiCPCczh9u+lYHLezrl9865nFA=
go.opentelemetry.io/build-tools/crosslink v0.8.0/go.mod h1:rWAN3EQ4rJn5ewknqw/0CkfkU4t7toCAtkl5q7VZP/M=
go.opentelemetry.io/build-tools/crosslink v0.9.0 h1:LOeJzMxsxBG2qMKeO22fRs91QvDfY+BA5pF1skTjbx0=
go.opentelemetry.io/build-tools/crosslink v0.9.0/go.mod h1:VaSi2ahs+r+v//m6OpqTkD5siSFVta9eTHhKqPsfH/Q=
go.opentelemetry.io/build-tools/multimod v0.9.0 h1:Im9PCGhfmKQC2XR0aTYzADNiOZLk9QEQgibDhadH+i0=
go.opentelemetry.io/build-tools/multimod v0.9.0/go.mod h1:9KdBtlVebuj00X4bIt6DX1zagilSzIQmkJo8XzQ9OTQ=
go.opentelemetry.io/build-tools/semconvgen v0.9.0 h1:Tsqd5KAVI2onoX+3Bjg7rD4kA8JdBxmxTUHcAZddYKw=
Expand Down