Closed gayathrirajendar closed 5 years ago
An investigative task related to the time formatting: depending on how people set up Jenkins, agents might not have the same timezone configured as the master node. In that case, we'll want to make sure that timestamps used in audit events are all UTC or include timezone info so we can use ZonedDateTime
or OffsetDateTime
instead of Instant
or LocalDateTime
.
Sure. Like it is planned in the other PR #23 , we can use ZonedDateTime
by fetching the zone from the system default value and have them formatted in the ISO - 8601 format. This has to be changed once that is accepted.
Does this answer the investigation?
That sounds like it would work. I'm not sure if any of the audit events we create are ever created on an agent instead of master, so the investigation might be to determine that. If we only ever create audit events using the master node, then we can likely just convert the local time to UTC.
Thanks for the contribution! You can follow up in the other PR for date-related improvements as you suggested.
Audit event for the start of the build was already present in the plugin. I am modifying it to add an event for the finish of the build too.
Steps:
[x] Add the event to the catalog
[x] Override the listener method and log the event
[x] Add/Modify the unit test to accommodate the changes.
See JENKINS-56645
Requesting review with @jvz