Skip to content

fix: suppress wait messages and progress bars in quiet mode#41

Open
Fnuworsu wants to merge 3 commits intomicrosoft:mainfrom
Fnuworsu:fix/quiet-progress-bars
Open

fix: suppress wait messages and progress bars in quiet mode#41
Fnuworsu wants to merge 3 commits intomicrosoft:mainfrom
Fnuworsu:fix/quiet-progress-bars

Conversation

@Fnuworsu
Copy link
Copy Markdown

@Fnuworsu Fnuworsu commented Mar 26, 2026

Description

Fixes #37.

When running azldev with the -q (or --quiet) flag, the user expects minimal output. However, the spinner ("Waiting for mock...") and progress bars would still write to stderr because their rendering logic in event.go did not respect the quiet configuration.

This PR flows the parsed quiet flag down from app.go to the appEventListener and subsequently to each event, explicitly ignoring calls to SetLongRunning and SetProgress directly writing to os.Stderr if quiet mode is enabled.

Testing

Unit Tests
Added TestEvent_QuietModeSkipsLongRunningAndProgressRendering to verify os.Stderr output suppression.

By capturing os.Stderr and manually invoking .SetLongRunning() and .SetProgress(), the unit test guarantees that these indicators emit zero visual artifact string data when initialized with quiet = true. Tests strictly validate empty output buffers, null spinner references, and uninitialized component objects.

Signed-off-by: Fnuworsu nuworsufelix49@gmail.com

Copilot AI review requested due to automatic review settings March 26, 2026 07:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 quiet from AppappEventListenerevent, and short-circuit SetLongRunning/SetProgress when quiet is enabled
  • Update event listener initialization call sites to pass the quiet setting
  • 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).

@Fnuworsu Fnuworsu changed the title Fix #37: Suppress Wait messages and progress bars in quiet mode fix: suppress wait messages and progress bars in quiet mode (#37) Mar 26, 2026
@Fnuworsu
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@Fnuworsu Fnuworsu force-pushed the fix/quiet-progress-bars branch from 26fe3c7 to 0913be1 Compare March 26, 2026 07:39
Copilot AI review requested due to automatic review settings March 26, 2026 07:42
…t#37)

Signed-off-by: Fnuworsu <nuworsufelix49@gmail.com>
@Fnuworsu Fnuworsu force-pushed the fix/quiet-progress-bars branch from e06ba55 to 5d63da0 Compare March 26, 2026 07:44
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

@Fnuworsu Fnuworsu changed the title fix: suppress wait messages and progress bars in quiet mode (#37) fix: suppress wait messages and progress bars in quiet mode Mar 26, 2026
@reubeno
Copy link
Copy Markdown
Member

reubeno commented Mar 31, 2026

@Fnuworsu Thanks for working on this! I've queued the PR checks to run and will make sure someone reviews the code changes.

Copilot AI review requested due to automatic review settings March 31, 2026 20:17
@Fnuworsu Fnuworsu force-pushed the fix/quiet-progress-bars branch from 9138b13 to b128661 Compare March 31, 2026 20:17
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

@Fnuworsu Fnuworsu force-pushed the fix/quiet-progress-bars branch from b128661 to 1787183 Compare March 31, 2026 20:25
@Fnuworsu
Copy link
Copy Markdown
Author

Fnuworsu commented Mar 31, 2026

@Fnuworsu Thanks for working on this! I've queued the PR checks to run and will make sure someone reviews the code changes.

@reubeno Can you queue the PR checks again? Thank you!

Copilot AI review requested due to automatic review settings March 31, 2026 21:21
@Fnuworsu Fnuworsu force-pushed the fix/quiet-progress-bars branch from 1787183 to c9ff8e1 Compare March 31, 2026 21:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

@Fnuworsu
Copy link
Copy Markdown
Author

@reubeno the code format workflow failed the last time. I went through it and made necessary changes. Can you restart the PR checks?

Copilot AI review requested due to automatic review settings March 31, 2026 21:25
@Fnuworsu Fnuworsu force-pushed the fix/quiet-progress-bars branch from 7fe52bd to b9997fc Compare March 31, 2026 21:28
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
//

Copilot AI review requested due to automatic review settings March 31, 2026 21:31
Signed-off-by: Fnuworsu <nuworsufelix49@gmail.com>
@Fnuworsu Fnuworsu force-pushed the fix/quiet-progress-bars branch from 19e9741 to 8059d61 Compare March 31, 2026 21:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

-q still shows "Waiting for mock" messages

3 participants