Skip to content

Commit

Permalink
multimod: Fix to log 'Using versioning file' and 'Successfully delete…
Browse files Browse the repository at this point in the history
…d module tags' to stderr instead of stdout (#507)
  • Loading branch information
pellared authored Feb 29, 2024
1 parent 5655634 commit fa341a2
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 9 deletions.
16 changes: 16 additions & 0 deletions .chloggen/multimod-print-using-to-stderr.yaml
Original file line number Diff line number Diff line change
@@ -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' and 'Successfully deleted module tags' to stderr instead of stdout

# One or more tracking issues related to the change
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.
# Use pipe (|) for multiline entries.
subtext:
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions multimod/cmd/prerelease.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package cmd

import (
"fmt"
"log"

"github.com/spf13/cobra"
Expand Down Expand Up @@ -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)
},
Expand Down
2 changes: 1 addition & 1 deletion multimod/cmd/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions multimod/cmd/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package cmd

import (
"fmt"
"log"

"github.com/spf13/cobra"
Expand All @@ -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)
},
Expand Down
3 changes: 1 addition & 2 deletions multimod/cmd/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package cmd

import (
"fmt"
"log"

"github.com/spf13/cobra"
Expand All @@ -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)
},
Expand Down
2 changes: 1 addition & 1 deletion multimod/internal/tag/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fa341a2

Please sign in to comment.