Verbosity flag provides no extra information (#1501) #1968
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fix
--verbosity debugflag not working in Homebrew-installed and GitHub release binaries.The
--verbosityflag was not functioning in binaries built with GoReleaser (used for Homebrew and GitHub releases). When users ran commands likeastro workspace list --verbosity debug, no debug output was displayed, even though the flag was recognized and validated.Root Cause: GoReleaser uses the
-Xlinker flag to inject version information at compile time. This interferes with cobra's package-level variable binding mechanism, preventing theverboseLevelvariable from receiving the flag value.Solution: Modified
SetupLoggingincmd/root_hooks.goto read the flag value directly from the cobra command object instead of relying on the package-level variable. This bypasses the broken binding and ensures the logger is correctly configured in all build environments.Impact:
🎟 Issue(s)
Closes #1501 #1690
🧪 Functional Testing
A/B Testing with Homebrew Build Flags:
go build -ldflags="-s -w -X github.com/astronomer/astro-cli/version.CurrVersion=1.37.0"→ No debug output📸 Screenshots
📋 Checklist
make testbefore taking out of draftmake lintbefore taking out of draft