feat: in verbose mode have mock print all output#231
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the mock runner to make verbose mode stream much more of mock’s output directly to the console, and adjusts the long-running UX so progress spinners don’t interfere with live output.
Changes:
- Add
--verboseto mock invocations whenctx.Verbose()is enabled (and keep--quietfor non-verbose runs). - Skip the indeterminate “Waiting for mock…” spinner during RPM builds when running in verbose mode.
| if r.verbose { | ||
| // Have mock stream its full build output (including build.log) live to the console. | ||
| args = append(args, "--verbose") | ||
| } else { | ||
| args = append(args, "--quiet") | ||
| } |
| if r.verbose { | ||
| // Have mock stream its full build output (including build.log) live to the console. | ||
| args = append(args, "--verbose") | ||
| } else { | ||
| args = append(args, "--quiet") | ||
| } |
| // In verbose mode, mock streams its full build output to the console, so we skip the | ||
| // indeterminate progress spinner (which would otherwise fight with the live output). | ||
| if !r.verbose { | ||
| extcmd = extcmd.SetLongRunning("Waiting for mock (building RPM)...") |
There was a problem hiding this comment.
Would it be cleaner to change what .SetLongRunning() does in verbose mode?
There was a problem hiding this comment.
⚠️ Not ready to approve
There is a misleading error message in Runner.InitRoot that reports an SRPM build failure instead of a root initialization failure.
Copilot's findings
Comments suppressed due to low confidence (1)
internal/rpm/mock/mock.go:249
- In InitRoot, the error message on failure still says "mock failed to build SRPM", which is misleading for callers troubleshooting root initialization failures. Please update the message to reflect that this is the root init path.
extcmd.SetLongRunning("Waiting for mock (initializing build root)...")
err = extcmd.Run(ctx)
if err != nil {
return fmt.Errorf("mock failed to build SRPM:\n%w", err)
- Files reviewed: 7/7 changed files
- Comments generated: 0 new
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
48b97d2 to
be84a11
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
internal/rpm/mock/mock.go:249
InitRootreturns an error message that says mock “failed to build SRPM”, which is misleading for a root initialization failure. This makes troubleshooting harder whenmock --initfails.
extcmd.SetLongRunning("Waiting for mock (initializing build root)...")
err = extcmd.Run(ctx)
if err != nil {
return fmt.Errorf("mock failed to build SRPM:\n%w", err)
This is VERY verbose, but it is very useful for tracking progress in pipelines etc.