feat: add missing formatters in config and UT#508
feat: add missing formatters in config and UT#508andrestejerina97 wants to merge 1 commit intomainfrom
Conversation
953ae62 to
793b827
Compare
|
@martinquiroga-exo ready to review |
martinquiroga-exo
left a comment
There was a problem hiding this comment.
@andrestejerina97 please see comment
| $formatter = new PresentationTypeAuditLogFormatter(IAuditStrategy::EVENT_ENTITY_UPDATE); | ||
| $formatter->setContext(AuditContextBuilder::default()->build()); | ||
| $changeSet = [ | ||
| 'name' => ['Keynote', 'Opening Keynote'] |
There was a problem hiding this comment.
This should be type not name
caseylocker
left a comment
There was a problem hiding this comment.
Blockers
-
Inheritance gap —
RSVPQuestionTemplateAuditLogFormatteris dead code in production. Traced the path:AuditEventListener.php:45-58hands Doctrine's concrete entity to the strategy,AuditLogOtlpStrategy.php:59passes it through unchanged,AuditLogFormatterFactory.php:138does exactget_class($subject)lookup. No parent walk anywhere inapp/Audit— grep forgetRootEntityName|class_parents|is_subclass_of|getParentClassis empty. AndSummitRSVPTemplateQuestionFactory.php:38-80only ever instantiates concrete subtypes (9 cases, no default) — there's no production path that creates a bareRSVPQuestionTemplate. So every real audit event arrives asRSVPDropDownQuestionTemplate,RSVPCheckBoxListQuestionTemplate, etc.; the parent-class config key ataudit_log.php:283-286never matches. Same shape forPrivatePresentationCategoryGroupperPresentationCategoryGroup.php:31. Fix: register each concrete subclass individually — that's the precedent already in this file (SummitVenue/SummitVenueRoom/SummitExternalLocation/SummitHotel/SummitAirportat lines 107,111,135,139,143,147) — or havegetFormatterByContextfall back toclass_parents()on a miss. -
Martin's
'name'→'type'comment is still sitting there 6 weeks later.tests/OpenTelemetry/Formatters/PresentationTypeAuditLogFormatterTest.php:73uses change-set key'name', but the Doctrine property is$type(SummitEventType.php:37-38,#[ORM\Column(name: 'Type')]). Passes only becausebuildChangeDetailsdoesn't validate keys. One line. -
52 commits behind main, GitHub flags CONFLICTING. The conflict surface is just the new block at
config/audit_log.php:259-289. Rebase.
ref: https://app.clickup.com/t/86b8nemnj