fix: suppress wait messages and progress bars in quiet mode#41
Open
Fnuworsu wants to merge 3 commits intomicrosoft:mainfrom
Open
fix: suppress wait messages and progress bars in quiet mode#41Fnuworsu wants to merge 3 commits intomicrosoft:mainfrom
Fnuworsu wants to merge 3 commits intomicrosoft:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Propagates the -q/--quiet flag into the azldev event/rendering layer so long-running spinners and progress bars don’t emit output during quiet runs.
Changes:
- Thread
quietfromApp→appEventListener→event, and short-circuitSetLongRunning/SetProgresswhen quiet is enabled - Update event listener initialization call sites to pass the
quietsetting - Add a new
testproj/fixture directory (TOML config + local.gitignore)
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| testproj/azldev.toml | Adds a sample project config (appears duplicative of existing scenario testdata). |
| testproj/.gitignore | Ignores build/output directories for the new testproj/ fixture. |
| internal/app/azldev/eventlistener.go | Adds quiet to the event listener and propagates it into created events. |
| internal/app/azldev/event.go | Skips spinner/progress rendering when quiet is enabled. |
| internal/app/azldev/core/testutils/testenv.go | Updates test env setup for the new NewEventListener(..., quiet) signature. |
| internal/app/azldev/app.go | Passes a.quiet into event listener setup (including after reinitializing logging). |
Author
|
@microsoft-github-policy-service agree |
26fe3c7 to
0913be1
Compare
…t#37) Signed-off-by: Fnuworsu <nuworsufelix49@gmail.com>
e06ba55 to
5d63da0
Compare
Member
|
@Fnuworsu Thanks for working on this! I've queued the PR checks to run and will make sure someone reviews the code changes. |
9138b13 to
b128661
Compare
b128661 to
1787183
Compare
Author
1787183 to
c9ff8e1
Compare
Author
|
@reubeno the code format workflow failed the last time. I went through it and made necessary changes. Can you restart the PR checks? |
7fe52bd to
b9997fc
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
internal/app/azldev/eventlistener.go:64
- This test sets event.quiet directly, so it doesn’t validate the PR’s main behavior change: plumbing the App’s -q flag into appEventListener.StartEvent() and into each created event. Consider adding a test that constructs a listener with quiet=true, calls StartEvent(), and asserts no stderr control output and that SetLongRunning/SetProgress are effectively suppressed through that path.
}
}
// Event implements the [opctx.EventListener] interface.
//
Signed-off-by: Fnuworsu <nuworsufelix49@gmail.com>
19e9741 to
8059d61
Compare
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
Fixes #37.
When running
azldevwith the-q(or--quiet) flag, the user expects minimal output. However, the spinner ("Waiting for mock...") and progress bars would still write tostderrbecause their rendering logic inevent.godid not respect the quiet configuration.This PR flows the parsed
quietflag down fromapp.goto theappEventListenerand subsequently to eachevent, explicitly ignoring calls toSetLongRunningandSetProgressdirectly writing toos.Stderrif quiet mode is enabled.Testing
Unit Tests
Added
TestEvent_QuietModeSkipsLongRunningAndProgressRenderingto verifyos.Stderroutput suppression.By capturing
os.Stderrand manually invoking.SetLongRunning()and.SetProgress(), the unit test guarantees that these indicators emit zero visual artifact string data when initialized withquiet = true. Tests strictly validate empty output buffers, null spinner references, and uninitialized component objects.Signed-off-by: Fnuworsu nuworsufelix49@gmail.com