Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ParameterName and PropertyName to TaskParameterEventArgs #10130

Merged
merged 9 commits into from May 23, 2024

Conversation

ladipro
Copy link
Member

@ladipro ladipro commented May 13, 2024

Contributes to #9881

Context

When TaskParameterEventArgs represents an output parameter of a task, it currently does not capture the name of the parameter. This information is generally useful as multiple output parameters can be assigned to the same item, and it's important for the BuildCheck infrastructure to provide a consistent object model to build analyzers.

Additionally, output parameters that are assigned to properties are currently logged as textual log messages Output Property: {0}={1} which miss the name of the parameter as well.

Changes Made

Added two new properties on the TaskParameterEventArgs class, including the requisite serialization support. Updated logging to populate the properties with the name of the task parameter and the name of the build property, respectively, and updated BuildCheck infra to expose it to analyzers subscribed to task parameter events.

All task parameters are now logged as the structured TaskParameterEventArgs and the kind of parameter (input, output to property, output to item) can be determined by examining the args.

Testing

  • Tweaked existing unit test and updated the relevant BuildCheck test.
  • Verified that when using the standard console logger, the resulting textual log is identical.
  • Verified that binlog viewer without the corresponding changes displays the forward-compat warning about unknown data.

Notes

@ladipro ladipro self-assigned this May 13, 2024
@ladipro ladipro marked this pull request as draft May 14, 2024 13:40
@ladipro ladipro changed the title Add ParameterName to TaskParameterEventArgs Add ParameterName and PropertyName to TaskParameterEventArgs May 15, 2024
Copy link
Member

@JanKrivanek JanKrivanek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@ladipro ladipro merged commit 147ecad into dotnet:main May 23, 2024
10 checks passed
@ladipro ladipro deleted the 9881-output-parameters branch May 23, 2024 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants