Replace bv's logging with Buildvana.Core.ConsoleOutput#287
Conversation
Introduce host-agnostic contracts (IReporter, IActivityScope, MessageLevel, Verbosity, null stubs, and formatting extensions) in Buildvana.Core.Abstractions, plus a System.Console-backed ConsoleReporter in the new Buildvana.Core.ConsoleOutput project. The reporter writes leveled, color-coded lines without a logger category, groups work into activities (begin -> detail -> outcome), and passes child-process output through verbatim. BCL-only; no consumers yet. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
RunAsync streamed only standard output line-by-line; standard error was captured but never surfaced live. Add an onStderr callback alongside onStdout so a caller can stream both, keeping the two distinguishable. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
bv used Microsoft.Extensions.Logging purely to write to the console. Migrate every call site to IReporter: class-name categories are gone, messages render as clean color-coded lines, and dotnet/MSBuild output now streams through live (stdout to stdout, stderr to stderr) instead of being hidden unless the build fails. Pipeline steps and the release flow are grouped into activities. Delete the SpectreLogger bridge, drop the Microsoft.Extensions.Logging package references from the tool and from Buildvana.Core.Abstractions, and give Buildvana.Sdk.Tasks an explicit Microsoft.Extensions.Logging.Abstractions reference (it previously resolved it transitively through Abstractions). Verbosity behavior is unchanged. Closes Tenacom#286 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@claude please review this PR. |
|
Claude finished @rdeago's task in 6m 5s —— View job PR Review
This is a well-crafted PR that cleanly separates console-output concerns from Design observationsActivity "done" at Detail vs "begin" at Info At Style-guide issue
// ~148 chars — should be wrapped
private Task<ProcessResult> RunDotNetAsync(IEnumerable<string> args, bool streamOutput = true, CancellationToken cancellationToken = default)Per the project's style guide, parameter lists that push the line past 120 characters must be wrapped one-param-per-line, with the closing private Task<ProcessResult> RunDotNetAsync(
IEnumerable<string> args,
bool streamOutput = true,
CancellationToken cancellationToken = default)
=> _processRunner.RunAsync(
DotNetMuxer,
args,
onStdout: streamOutput ? _reporter.ChildOutput : null,
onStderr: streamOutput ? _reporter.ChildError : null,
cancellationToken: cancellationToken);Fix this →%60%20must%20stay%20on%20the%20last%20parameter%E2%80%99s%20line%20per%20SA1111.) Nits / observations (no action required)
What looks good
One blocking issue (the long declaration in |
It's common to output an outcome-describing message at Info level immediately before closing an activity scope. This allows that message to be incorporated into the scope's closing line, reducing output clutter at Normal verbosity level and below.
…sity This is useful for processes like `dotnet` whose verbosity we set equal to ours.
- Build `dotnet` paraneter lists declaratively, preferring ternaries to `if` blocks - Formalize verbosity and output streaming requirements into an `InvocationKind` private enum - Make the intent of the parameter to `ContinuousIntegrationBuildArg()` clearer
- Coverage-related parameters are not in the core MTP parameter set; therefore, they have to be specified via configuration file. Otherwise, `bv test` will fail if at least a test project does not depend on `Microsoft.Testing.Extensions.CodeCoverage`. - Passing `--force-english-output` to `dotnet nuget` should be the user's choice, not an imposition.
|
@claude thanks for the review!
They're both at Info now.
Fixed.
The spec says "when present and not an empty string (regardless of its value)" (emphasis mine). Our check is fully compliant.
There's no I have also added other changes, not in the original scope of the PR. Please review again. |
|
Claude finished @rdeago's task in 5m 50s —— View job PR Re-Review
Previous-review items — confirmed
New code — correctness issue
if (verbosity is not null && (int)verbosity <= (int)Verbosity)
{
return; // ← discards the line
}This discards lines when The interface doc says "The verbosity level at which the line should be written"; the method comment says "if a verbosity is specified, respect it … useful for child processes whose verbosity we control." Both point to a minimum-threshold contract:
The fix: if (verbosity is not null && (int)verbosity > (int)Verbosity)
{
return;
}The same fix applies to Question —
|
|
Thanks again @claude!
Fixed. Also added an extension method on
One more inverted check. Thanks for the catch. Please review again. |
|
Claude finished @rdeago's task in 2m 35s —— View job PR Re-Review (round 3)
Previous-review items — all confirmed
One new item
// ReSharper disable once UnusedMember.Local
Informational,The suppression comment is the tell: the member exists but nothing calls What looks good
One blocking item ( |
As a side effect, InvocationKind members are now referenced at least once, removing the cause for the ReSharoper suppression on Informational and preventing reviewers from flagging it as dead code.
It's used now. |
Summary
Buildvana.Core.ConsoleOutput: aSystem.Console-backedIReporter(contracts inBuildvana.Core.Abstractions, BCL-only) that replacesbv's misuse ofMicrosoft.Extensions.Loggingfor console output.dotnet/MSBuild output streams through live (stdout→stdout, stderr→stderr) instead of being hidden unless the build fails. Work is grouped into depth-tagged activities ([1] Build…[1] Build: done (3.2s)).SpectreLoggerbridge andMicrosoft.Extensions.Logging(.Abstractions) from the tool;Buildvana.Sdk.Taskskeeps its MSBuild bridge with an explicitM.E.Logging.Abstractionsreference.Notable design choices (reviewer context)
error:red,warning:yellow,info:/detail:/trace:uncolored; labels ragged (single space).NO_COLORhonored;--coloroverrides it.IActivityScope.Complete()gates the outcome line (no "done" on exception); both the starting and outcome line render at Info; an instance stack supplies the[depth]tag.GitServicewas not given an activity (its logging is all-Detaildiscovery + silent ops); a "Git" activity likely belongs at the callers later.error:(always visible) rather than the old yellow line.Additional changes (not in the issue)
dotnetinvocations inDotNetService.dotnetparameters of non-general use (they will be added in this repo'sbuildvana.jsoncfile when it is created).Lazy<T>: an injectedLazy<T>will resolveTfrom the service provider when evaluated. This lets us injectLazy<NuGetPushConfiguration>intoDotNetServiceinstead of the service provider itself.Test plan
dotnet bv pack— 0 errors, 0 warnings, tests pass, artifacts producedinspectcode --severity=WARNING— 0 resultserror:pathCloses #286
🤖 Generated with Claude Code