Skip to content

Versioning Phase 5 — IReporter-over-MSBuild adapter and BuildvanaSdkTask instrumentation #294

@rdeago

Description

@rdeago

Sub-issue of #267. Independent of Phase 4 (#293); prerequisite for Phase 7 (the NBGV swap), where the build-time version task runs VersioningService in-process. This implements the plumbing for design option (b) — run Core services inside tasks via constructor injection, bridging human-facing output through IReporter — rather than shelling to bv (a) or standing up a dedicated MSBuild DI library (c).

Scope

  • New IReporter implementation in Buildvana.Sdk.Tasks (it needs Microsoft.Build.*, so it cannot live in a host-agnostic Core library) backed by the task's TaskLoggingHelper (Log) and IBuildEngine — a sibling to the existing TaskLoggingHelperLogger ILogger bridge. Mapping:
    • Report(Error, …)Log.LogError; Report(Warning, …)Log.LogWarning; Report(Info|Detail|Trace, …)Log.LogMessage at MessageImportance.High|Normal|Low.
    • BeginActivity(title) → emit a start message and return an IActivityScope that emits the outcome/elapsed line on dispose (or a lightweight scope — MSBuild already timestamps; decide during implementation).
    • ChildOutput / ChildError → low-importance message / error passthrough.
    • Verbosity: set permissive (Trace) and let MSBuild's own verbosity/importance filtering gate visibility (the build's -v already governs this); document the rationale.
  • Wire it into BuildvanaSdkTask: expose an IReporter Reporter property (mirroring the existing Logger), lazily constructed from Log/BuildEngine, so derived tasks can hand it to Core services. Keep the existing ILogger bridge.
  • Tests: drive the adapter through a recording IBuildEngine and assert each IReporter call maps to the expected MSBuild event/severity (error, warning, the three message importances, activity start/outcome, child output/error). A capture IReporter for Core-service tests, if one is needed, belongs in Buildvana.Core.Testing, not here.
  • Nothing else changes: no task consumes the reporter for real work yet; existing tasks are unaffected; the build self-hosts.

Acceptance criteria

  • BuildvanaSdkTask exposes an engine-backed IReporter; the adapter maps every IReporter member to IBuildEngine/TaskLoggingHelper with correct severities and importances.
  • Unit tests pass in CI covering the full mapping via a recording build engine.
  • Existing tasks are unchanged in behavior; dotnet bv build self-hosts.
  • CHANGELOG: internal-only; no public entry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement[issue/PR] requests / implements new or improved functionality.refactor[issue/PR] requests / implements a refactor of existing code without affecting functionality.
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions