From 7ca12f12d4ddeb19c09183f2042f1e2da6135e1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Mon, 26 Feb 2024 19:29:56 +0100 Subject: [PATCH 1/4] multimod: Fix to log 'Using versioning file' to stderr instead of stdout --- .chloggen/multimod-print-using-to-stderr.yaml | 16 ++++++++++++++++ Makefile | 2 +- multimod/cmd/prerelease.go | 3 +-- multimod/cmd/sync.go | 2 +- multimod/cmd/tag.go | 3 +-- multimod/cmd/verify.go | 3 +-- 6 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 .chloggen/multimod-print-using-to-stderr.yaml diff --git a/.chloggen/multimod-print-using-to-stderr.yaml b/.chloggen/multimod-print-using-to-stderr.yaml new file mode 100644 index 00000000..a76f43ea --- /dev/null +++ b/.chloggen/multimod-print-using-to-stderr.yaml @@ -0,0 +1,16 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: bug_fix + +# The name of the component, or a single word describing the area of concern, (e.g. crosslink) +component: multimod + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Fix to log 'Using versioning file' to stderr instead of stdout + +# One or more tracking issues related to the change +issues: [] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: diff --git a/Makefile b/Makefile index 1684d1f1..8f4d4e5d 100644 --- a/Makefile +++ b/Makefile @@ -196,7 +196,7 @@ REMOTE?=git@github.com:open-telemetry/opentelemetry-go-build-tools.git .PHONY: push-tags push-tags: | $(MULTIMOD) $(MULTIMOD) verify - set -e; for tag in `$(MULTIMOD) tag -m tools -c ${COMMIT} --print-tags | grep -v "Using" `; do \ + set -e; for tag in `$(MULTIMOD) tag -m tools -c ${COMMIT} --print-tags ; do \ echo "pushing tag $${tag}"; \ git push ${REMOTE} $${tag}; \ done; diff --git a/multimod/cmd/prerelease.go b/multimod/cmd/prerelease.go index 17b62e02..65cc58c6 100644 --- a/multimod/cmd/prerelease.go +++ b/multimod/cmd/prerelease.go @@ -15,7 +15,6 @@ package cmd import ( - "fmt" "log" "github.com/spf13/cobra" @@ -55,7 +54,7 @@ var prereleaseCmd = &cobra.Command{ } }, Run: func(*cobra.Command, []string) { - fmt.Println("Using versioning file", versioningFile) + log.Println("Using versioning file", versioningFile) prerelease.Run(versioningFile, moduleSetNames, allModuleSets, skipGoModTidy, commitToDifferentBranch) }, diff --git a/multimod/cmd/sync.go b/multimod/cmd/sync.go index 0187e332..55d000b3 100644 --- a/multimod/cmd/sync.go +++ b/multimod/cmd/sync.go @@ -56,7 +56,7 @@ var syncCmd = &cobra.Command{ } }, Run: func(*cobra.Command, []string) { - fmt.Println("Using versioning file", versioningFile) + log.Println("Using versioning file", versioningFile) if otherVersioningFile == "" { otherVersioningFile = filepath.Join(otherRepoRoot, diff --git a/multimod/cmd/tag.go b/multimod/cmd/tag.go index 813b74a4..1cb13f74 100644 --- a/multimod/cmd/tag.go +++ b/multimod/cmd/tag.go @@ -15,7 +15,6 @@ package cmd import ( - "fmt" "log" "github.com/spf13/cobra" @@ -38,7 +37,7 @@ var tagCmd = &cobra.Command{ - Creates new Git tags for all modules being updated. - If tagging fails in the middle of the script, the recently created tags will be deleted.`, Run: func(*cobra.Command, []string) { - fmt.Println("Using versioning file", versioningFile) + log.Println("Using versioning file", versioningFile) tag.Run(versioningFile, moduleSetName, commitHash, deleteModuleSetTags, printTags) }, diff --git a/multimod/cmd/verify.go b/multimod/cmd/verify.go index b52d7fe7..df962fc8 100644 --- a/multimod/cmd/verify.go +++ b/multimod/cmd/verify.go @@ -15,7 +15,6 @@ package cmd import ( - "fmt" "log" "github.com/spf13/cobra" @@ -34,7 +33,7 @@ var verifyCmd = &cobra.Command{ - Script warns if any stable modules depend on any unstable modules. `, Run: func(*cobra.Command, []string) { - fmt.Println("Using versioning file", versioningFile) + log.Println("Using versioning file", versioningFile) verify.Run(versioningFile) }, From ee2af1b25e88f86db5b136e435409a03f3b5b596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Mon, 26 Feb 2024 19:32:51 +0100 Subject: [PATCH 2/4] add PR no --- .chloggen/multimod-print-using-to-stderr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.chloggen/multimod-print-using-to-stderr.yaml b/.chloggen/multimod-print-using-to-stderr.yaml index a76f43ea..9c00f39b 100644 --- a/.chloggen/multimod-print-using-to-stderr.yaml +++ b/.chloggen/multimod-print-using-to-stderr.yaml @@ -8,7 +8,7 @@ component: multimod note: Fix to log 'Using versioning file' to stderr instead of stdout # One or more tracking issues related to the change -issues: [] +issues: [507] # (Optional) One or more lines of additional information to render under the primary note. # These lines will be padded with 2 spaces and then inserted directly into the document. From f3728cdee8a192dd4d07fca3f04c864ccfe0b307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Mon, 26 Feb 2024 19:35:28 +0100 Subject: [PATCH 3/4] Add missing backtick --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8f4d4e5d..1d9545f4 100644 --- a/Makefile +++ b/Makefile @@ -196,7 +196,7 @@ REMOTE?=git@github.com:open-telemetry/opentelemetry-go-build-tools.git .PHONY: push-tags push-tags: | $(MULTIMOD) $(MULTIMOD) verify - set -e; for tag in `$(MULTIMOD) tag -m tools -c ${COMMIT} --print-tags ; do \ + set -e; for tag in `$(MULTIMOD) tag -m tools -c ${COMMIT} --print-tags `; do \ echo "pushing tag $${tag}"; \ git push ${REMOTE} $${tag}; \ done; From 05fe1b15b8aa8e529f842206828f6322b8fbd0e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Mon, 26 Feb 2024 20:02:15 +0100 Subject: [PATCH 4/4] Fix delete output --- .chloggen/multimod-print-using-to-stderr.yaml | 2 +- multimod/internal/tag/tag.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.chloggen/multimod-print-using-to-stderr.yaml b/.chloggen/multimod-print-using-to-stderr.yaml index 9c00f39b..01fd21e4 100644 --- a/.chloggen/multimod-print-using-to-stderr.yaml +++ b/.chloggen/multimod-print-using-to-stderr.yaml @@ -5,7 +5,7 @@ change_type: bug_fix component: multimod # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Fix to log 'Using versioning file' to stderr instead of stdout +note: Fix to log 'Using versioning file' and 'Successfully deleted module tags' to stderr instead of stdout # One or more tracking issues related to the change issues: [507] diff --git a/multimod/internal/tag/tag.go b/multimod/internal/tag/tag.go index 68cb63ec..04123627 100644 --- a/multimod/internal/tag/tag.go +++ b/multimod/internal/tag/tag.go @@ -49,7 +49,7 @@ func Run(versioningFile, moduleSetName, commitHash string, deleteModuleSetTags b log.Fatalf("Error deleting tags for the specified module set: %v", err) } - fmt.Println("Successfully deleted module tags") + log.Println("Successfully deleted module tags") } else { if err := t.tagAllModules(nil); err != nil { log.Fatalf("unable to tag modules: %v", err)