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

Log TaskParameterEvent for scalar parameters #9908

Merged
merged 2 commits into from
Apr 3, 2024

Conversation

ladipro
Copy link
Member

@ladipro ladipro commented Mar 22, 2024

Fixes #9827

Context

TaskParameterEvent with TaskParameterMessageKind.TaskInput is currently used only for parameters that are lists. Parameters that are simple strings are logged as a specially formatted low-importance message.

The binlog viewer contains logic to recognize this special message and recover the Name and Value to be rendered in the viewer UI. Since we will use this event for analyzers, it would be unfortunate to add one more place with this suboptimal processing.

Changes Made

Unified the logic in TaskExecutionHost to log all parameters as TaskParameterEvent with TaskParameterMessageKind.TaskInput. The change is under a change wave check.

Testing

  • Added a new unit test.
  • Compared diagnostic-level output with task parameter logging enabled with and without the change. No differences were found when passing null, empty, false, true, numeric, string, or stringified item list parameters.
  • Compared the appearance in binlog for the same sample values as above. No differences were observed.
  • Compared OrchardCore binlogs with and without the change. They're the same size and the only difference I found was in rendering the SolutionConfigurationContents parameter which is a string but the content looks formatted so it was rendered incorrectly as a list of items.

Notes

As @KirillOsenkov pointed out in the issue, we don't really depend on the textual messages so we don't have to do any double-logging. The viewer can remove parsing the textual messages on its own schedule.

@KirillOsenkov
Copy link
Member

Let's check that the diag output for console loggers doesn't change, as well as let's see how it looks like in the binlog for null, empty string, numbers, booleans and such.

What is the current behavior for scalar parameters that have the default value? (0, null, false)

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.

Looks good.

+1 on quick manual test of binlog and FileLog appearance for the change

@ladipro
Copy link
Member Author

ladipro commented Mar 25, 2024

Done. No differences found with our textual logging (with task parameter logging enabled) or with the way it looks in the viewer. I have exported the tree as XML from the viewer and the SolutionConfigurationContents mismatch is still the only difference I've found.

@ladipro
Copy link
Member Author

ladipro commented Mar 25, 2024

I am adding screenshots of SolutionConfigurationContents for completeness.

Before:

image

After:

image

Before looks nicer but it's lying.

Copy link
Member

@AR-May AR-May left a comment

Choose a reason for hiding this comment

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

LGTM

@ladipro ladipro merged commit 563c7b0 into dotnet:main Apr 3, 2024
9 checks passed
@KirillOsenkov
Copy link
Member

Just a note that the viewer can't remove parsing textual messages because we still need to read all legacy binlogs.

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.

Log TaskParameterEvent for scalar task parameters as well
6 participants