Skip to content

Conversation

@andrestejerina97
Copy link
Contributor

@andrestejerina97 andrestejerina97 commented Dec 18, 2025

@andrestejerina97 andrestejerina97 force-pushed the feature/audit-formatters-event-site branch from 09bcf55 to 2c02e2b Compare December 18, 2025 18:38
@andrestejerina97 andrestejerina97 marked this pull request as ready for review December 18, 2025 18:39
@JpMaxMan JpMaxMan requested a review from smarcet December 18, 2025 19:54
@smarcet smarcet requested a review from Copilot December 22, 2025 16:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive audit logging support for Summit and event-related entities while refactoring existing audit formatters to use a shared buildChangeDetails method. The changes reorganize presentation-related formatters into a subdirectory for better code organization.

  • Adds 13 new audit log formatters for Summit entities (venues, locations, events, media types, etc.)
  • Refactors 6 existing formatters to use the new buildChangeDetails helper method from AbstractAuditLogFormatter
  • Reorganizes presentation-related formatters into a PresentationFormatters subdirectory

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
config/audit_log.php Registers new audit formatters and updates namespaces for moved presentation formatters
app/Audit/AbstractAuditLogFormatter.php Adds shared methods for formatting change details: buildChangeDetails, formatFieldChange, formatChangeValue, and getIgnoredFields
app/Audit/ConcreteFormatters/EntityUpdateAuditLogFormatter.php Adds return type hint to getIgnoredFields method
app/Audit/ConcreteFormatters/SummitAuditLogFormatter.php New formatter for Summit entity audit logs
app/Audit/ConcreteFormatters/SummitEventAuditLogFormatter.php New formatter for SummitEvent entity audit logs
app/Audit/ConcreteFormatters/SummitVenueAuditLogFormatter.php New formatter for SummitVenue entity audit logs
app/Audit/ConcreteFormatters/SummitVenueRoomAuditLogFormatter.php New formatter for SummitVenueRoom entity audit logs
app/Audit/ConcreteFormatters/SummitGeoLocatedLocationAuditLogFormatter.php New formatter for SummitGeoLocatedLocation entity audit logs
app/Audit/ConcreteFormatters/SummitExternalLocationAuditLogFormatter.php New formatter for SummitExternalLocation entity audit logs
app/Audit/ConcreteFormatters/SummitHotelAuditLogFormatter.php New formatter for SummitHotel entity audit logs
app/Audit/ConcreteFormatters/SummitAirportAuditLogFormatter.php New formatter for SummitAirport entity audit logs
app/Audit/ConcreteFormatters/SummitMediaUploadTypeAuditLogFormatter.php New formatter for SummitMediaUploadType entity audit logs
app/Audit/ConcreteFormatters/SummitEventAttendanceMetricAuditLogFormatter.php New formatter for SummitEventAttendanceMetric entity audit logs
app/Audit/ConcreteFormatters/PresentationFormatters/PresentationSpeakerAuditLogFormatter.php Moved to PresentationFormatters subdirectory (namespace change only)
app/Audit/ConcreteFormatters/PresentationFormatters/PresentationUserSubmissionAuditLogFormatter.php Moved to PresentationFormatters subdirectory and refactored to use buildChangeDetails
app/Audit/ConcreteFormatters/PresentationFormatters/PresentationTrackChairRatingTypeAuditLogFormatter.php Moved to PresentationFormatters subdirectory and refactored to use buildChangeDetails
app/Audit/ConcreteFormatters/PresentationFormatters/PresentationTrackChairScoreTypeAuditLogFormatter.php Moved to PresentationFormatters subdirectory and refactored to use buildChangeDetails
app/Audit/ConcreteFormatters/PresentationFormatters/PresentationSpeakerSummitAssistanceConfirmationAuditLogFormatter.php New formatter replacing SpeakerAssistanceAuditLogFormatter with simplified implementation
app/Audit/ConcreteFormatters/PresentationFormatters/PresentationVideoAuditLogFormatter.php New formatter for PresentationVideo entity audit logs
app/Audit/ConcreteFormatters/PresentationFormatters/PresentationSlideAuditLogFormatter.php New formatter for PresentationSlide entity audit logs
app/Audit/ConcreteFormatters/PresentationFormatters/PresentationLinkAuditLogFormatter.php New formatter for PresentationLink entity audit logs
app/Audit/ConcreteFormatters/PresentationFormatters/PresentationMediaUploadAuditLogFormatter.php New formatter for PresentationMediaUpload entity audit logs
app/Audit/ConcreteFormatters/PresentationFormatters/PresentationActionTypeAuditLogFormatter.php New formatter for PresentationActionType entity audit logs
app/Audit/ConcreteFormatters/SelectionPlanAuditLogFormatter.php Refactored to use buildChangeDetails and removed custom formatDate method
app/Audit/ConcreteFormatters/SubmissionInvitationAuditLogFormatter.php Refactored to use buildChangeDetails for cleaner update logging
app/Audit/ConcreteFormatters/SpeakerRegistrationRequestAuditLogFormatter.php Refactored to use buildChangeDetails for cleaner update logging
app/Audit/ConcreteFormatters/SummitTrackChairAuditLogFormatter.php Refactored to use buildChangeDetails for cleaner update logging
app/Audit/ConcreteFormatters/FeaturedSpeakerAuditLogFormatter.php Refactored to use buildChangeDetails for cleaner update logging

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +105 to +118
$fields_summary = count($changed_fields) . ' field(s) modified: ';
return $fields_summary . implode(' | ', $changed_fields);
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

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

The variable name 'fields_summary' is misleading because it contains both a count and a prefix string, not just a summary. Consider renaming to 'fields_prefix' or directly inline the concatenation to improve clarity.

Suggested change
$fields_summary = count($changed_fields) . ' field(s) modified: ';
return $fields_summary . implode(' | ', $changed_fields);
return sprintf('%d field(s) modified: %s', count($changed_fields), implode(' | ', $changed_fields));

Copilot uses AI. Check for mistakes.

class SummitEventAuditLogFormatter extends AbstractAuditLogFormatter
{
private string $event_type;
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

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

The variable name 'event_type' is confusing in this context because this formatter deals with Summit entities, and 'event_type' could be mistaken for a summit event type. Consider renaming to 'audit_event_type' or 'operation_type' to clarify this refers to the audit operation (creation/update/deletion).

Copilot uses AI. Check for mistakes.
$summit = $subject->getSummit();
$summit_name = $summit ? ($summit->getName() ?? 'Unknown Summit') : 'Unknown Summit';


Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

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

There is an unnecessary blank line here that should be removed to maintain consistency with the formatting of other audit log formatters in this PR.

Suggested change

Copilot uses AI. Check for mistakes.
@OpenStackweb OpenStackweb deleted a comment from Copilot AI Dec 22, 2025
@OpenStackweb OpenStackweb deleted a comment from Copilot AI Dec 22, 2025
"[%s - %s]",
$this->formatDate($subject->getSubmissionBeginDate()),
$this->formatDate($subject->getSubmissionEndDate())
$subject->getSubmissionBeginDate()?->format('Y-m-d H:i:s') ?? 'N/A',
Copy link
Collaborator

Choose a reason for hiding this comment

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

please move this to an util and use it everywhere ( how to format the dates ) so we are consistent

@OpenStackweb OpenStackweb deleted a comment from Copilot AI Dec 22, 2025

class SummitEventAttendanceMetricAuditLogFormatter extends AbstractAuditLogFormatter
{
private string $event_type;
Copy link
Collaborator

Choose a reason for hiding this comment

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

this private string $event_type;

public function __construct(string $event_type)
{
    $this->event_type = $event_type;
}

is repetead all over the code
lets move it to AbstractAuditLogFormatter

@OpenStackweb OpenStackweb deleted a comment from Copilot AI Dec 22, 2025
Copy link
Collaborator

@smarcet smarcet left a comment

Choose a reason for hiding this comment

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

@andrestejerina97 please review comments

Copy link
Collaborator

@smarcet smarcet left a comment

Choose a reason for hiding this comment

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

@andrestejerina97 please review comments

@andrestejerina97 andrestejerina97 force-pushed the feature/audit-formatters-event-site branch from 9831428 to cbba14f Compare December 22, 2025 20:23
Copy link
Collaborator

@smarcet smarcet left a comment

Choose a reason for hiding this comment

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

LGTM

@smarcet smarcet merged commit 42535dd into main Dec 23, 2025
5 checks passed
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.

3 participants