Verbosity flag provides no extra information (#1501)#1968
Open
ronidelacruz-astro wants to merge 4 commits intomainfrom
Open
Verbosity flag provides no extra information (#1501)#1968ronidelacruz-astro wants to merge 4 commits intomainfrom
ronidelacruz-astro wants to merge 4 commits intomainfrom
Conversation
for more information, see https://pre-commit.ci
Pull Request Test Coverage Report for Build 3594e26d-8682-4297-8627-84e8d776b975Details
💛 - Coveralls |
neel-astro
reviewed
Oct 23, 2025
Contributor
Author
You're right that we need more debug logs, but there was also a real bug: the logger wasn't being set to debug level at all in Homebrew builds due to GoReleaser's |
… into fix-verbosity-issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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