Fix 'user' on batch tag operations when viewed via Audit Logs #506
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this change?
Batch tags were always logged as "default user" because a the logging function expected an implicit
User
object but the caller was expecting to provide an implicitString
username.This issue highlighted how easy it is for bugs to creep in with implicit parameters that have default values, so I have also removed the default value from all functions that have an
implicit user(name): Option[String]
parameter. In doing so I identified a few places where we could be logging username but weren't.The bug report also mentioned duplicated audit log entries. We were logging batch tag operations when the Job was created and when the Step was carried out. I have removed the Step level logging.
Tested in CODE. Old audit entry shows "Default User", newer entry shows david.furey
How to test