Skip to content

BuildCheck - once/if ProjectFinished is exposed via OM - facilitate proper WarnAsErrors promotability #10670

Open
@JanKrivanek

Description

@JanKrivanek

Context

#10618 has more context on issue and dilema of BuildCheck diagnostics promotability.
The fixing PR handles it by sending the info to the main node.
Main node is purging the WarnAsError dictionaries on project done:

if (buildEventArgs is ProjectFinishedEventArgs projectFinishedEvent && projectFinishedEvent.BuildEventContext != null)
{
WarningsConfigKey key = GetWarningsConfigKey(projectFinishedEvent);
_warningsAsErrorsByProject?.Remove(key);
_warningsNotAsErrorsByProject?.Remove(key);
_warningsAsMessagesByProject?.Remove(key);
}

At the same time - if we'd expose ProjectDone event through BuildCheck OM (it's now exposed internally - so we might want to do it publically later on) - then warnings can be logged for such project just after the ProjectDone event passes through the clearing code above and hence such warning would not be properly promoted/demoted.

Possible solutions

  • Not clearing the sets with warnings promotability/demotability this can however hurt perf.
  • Mark somehow that ProjectDone is processed by buildCheck and only clear the lookups after that
  • Process buildCheck diagnostics promotability during logging (so that it happens before LoggingService enqueues it - not after it dequeues it) and moving the clearing code couple lines after RouteBuildEvent is called

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions