From 9ac039a4ae2f980f9c356111ccf40d1e4935d2f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Mon, 21 Aug 2023 17:50:45 +0200 Subject: [PATCH] Add gorelease Make target (#4169) * Add gorelease Make target * Update RELEASING.md * Update RELEASING.md * Fix merge --------- Co-authored-by: Tyler Yahn Co-authored-by: Tyler Yahn --- Makefile | 15 +++++++++++++-- RELEASING.md | 7 +++++++ tools/go.mod | 2 +- tools/tools.go | 1 + 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b3111cbb2f2..b67ab65e5ae 100644 --- a/Makefile +++ b/Makefile @@ -71,7 +71,10 @@ $(CROSSLINK): PACKAGE=go.opentelemetry.io/build-tools/crosslink GOTMPL = $(TOOLS)/gotmpl $(GOTMPL): PACKAGE=go.opentelemetry.io/build-tools/gotmpl -tools: $(GOLANGCI_LINT) $(MISSPELL) $(GOCOVMERGE) $(STRINGER) $(PORTO) $(MULTIMOD) $(DBOTCONF) $(CROSSLINK) $(GOTMPL) +GORELEASE = $(TOOLS)/gorelease +$(GORELEASE): PACKAGE=golang.org/x/exp/cmd/gorelease + +tools: $(GOLANGCI_LINT) $(MISSPELL) $(GOCOVMERGE) $(STRINGER) $(PORTO) $(MULTIMOD) $(DBOTCONF) $(CROSSLINK) $(GOTMPL) $(GORELEASE) # Generate @@ -289,13 +292,21 @@ test-gomemcache: # Releasing +.PHONY: gorelease +gorelease: $(OTEL_GO_MOD_DIRS:%=gorelease/%) +gorelease/%: DIR=$* +gorelease/%:| $(GORELEASE) + @echo "gorelease in $(DIR):" \ + && cd $(DIR) \ + && $(GORELEASE) \ + || echo "" + COREPATH ?= "../opentelemetry-go" .PHONY: sync-core sync-core: | $(MULTIMOD) @[ ! -d $COREPATH ] || ( echo ">> Path to core repository must be set in COREPATH and must exist"; exit 1 ) $(MULTIMOD) verify && $(MULTIMOD) sync -a -o ${COREPATH} - .PHONY: prerelease prerelease: | $(MULTIMOD) @[ "${MODSET}" ] || ( echo ">> env var MODSET is not set"; exit 1 ) diff --git a/RELEASING.md b/RELEASING.md index 386a366225b..6504e8a1f58 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -12,6 +12,13 @@ versions will be. If you are making a release to upgrade the upstream go.opentelemetry.io/otel packages, all module sets will likely need to be released. +### Breaking changes validation + +You can run `make gorelease` that runs [gorelease](https://pkg.go.dev/golang.org/x/exp/cmd/gorelease) +to ensure that there are no unwanted changes done in the public API. + +You can check/report problems with `gorelease` [here](https://golang.org/issues/26420). + ### Create a release branch Update the versions of the module sets you have identified in `versions.yaml`. diff --git a/tools/go.mod b/tools/go.mod index df67abb67f1..4621899f540 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -13,6 +13,7 @@ require ( go.opentelemetry.io/build-tools/dbotconf v0.11.0 go.opentelemetry.io/build-tools/gotmpl v0.11.0 go.opentelemetry.io/build-tools/multimod v0.11.0 + golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea golang.org/x/tools v0.12.0 ) @@ -193,7 +194,6 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.24.0 // indirect golang.org/x/crypto v0.12.0 // indirect - golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea // indirect golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 // indirect golang.org/x/mod v0.12.0 // indirect golang.org/x/net v0.14.0 // indirect diff --git a/tools/tools.go b/tools/tools.go index c0090ee9f0b..f79b050bf08 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -26,5 +26,6 @@ import ( _ "go.opentelemetry.io/build-tools/dbotconf" _ "go.opentelemetry.io/build-tools/gotmpl" _ "go.opentelemetry.io/build-tools/multimod" + _ "golang.org/x/exp/cmd/gorelease" _ "golang.org/x/tools/cmd/stringer" )