[CI logging] Introduce BuildEventTracker and migrate TerminalLogger
- Dominant language
- C#
- Stars
- 5.5k
- Forks
- 1.5k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 141
Description
### Summary
Introduce `BuildEventTracker`, migrate `TerminalLogger` to use it, and complete a reusable presentation-neutral snapshot model in one PR.
### Background and Motivation
`TerminalLogger` currently combines build-event subscription, context correlation, mutable lifecycle state, and terminal presentation. A CI logger needs much of the same event-processing information, but duplicating that logic would make the implementations inconsistent and difficult to maintain.
The shared event-processing layer should be completed before adding the CI logger.
### Proposed Feature
Add `BuildEventTracker` as the common layer between `IEventSource` and logger presentation.
`BuildEventTracker` will:
- own event attachment and detachment;
- correlate evaluation, project, target, task, and node contexts;
- maintain build and project lifecycle state;
- expose immutable, presentation-neutral lifecycle and diagnostic snapshots;
- avoid terminal- or provider-specific formatting;
- avoid requesting or retaining data that consumers do not require.
Migrate `TerminalLogger` to consume tracker snapshots while preserving its existing output and behavior. Remove tracker dependencies on terminal-specific state such as `TerminalProjectInfo` and `EvalProjectInfo`.
```text
IEventSource
|
v
BuildEventTracker
|-- lifecycle snapshots
|-- diagnostic snapshots
`-- context correlation
|
`-- TerminalLogger
```
The snapshot model should provide the context required by both terminal and future CI presentation without exposing mutable tracker state.
Validation should cover event correlation, lifecycle transitions, attach/detach behavior, concurrent builds, and Terminal Logger output compatibility.
### Alternative Designs
Keeping event processing inside `TerminalLogger` would require the CI logger to duplicate correlation and lifecycle logic. Sharing terminal-specific mutable objects would couple future loggers to terminal rendering. Presentation-neutral immutable snapshots provide a cleaner boundary.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the existing TerminalLogger and IEventSource event flow to understand event attachment, context correlation, and lifecycle state. Define the BuildEventTracker boundary and immutable snapshots, then migrate TerminalLogger while preserving its output. Done means event correlation, lifecycle transitions, attach/detach behavior, concurrent builds, and Terminal Logger compatibility are validated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- build-system, devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100