feat: add new formatters for signs and settings#499
feat: add new formatters for signs and settings#499andrestejerina97 wants to merge 3 commits intomainfrom
Conversation
34cfc95 to
9fd08aa
Compare
|
@martinquiroga-exo ready to review |
9fd08aa to
61e2862
Compare
caseylocker
left a comment
There was a problem hiding this comment.
SummitScheduleConfigAuditLogFormatter.php:36 calls getIsDefault() which doesn't exist on SummitScheduleConfig.
The entity only has isDefault() (line 278). In PHP 8+ this throws \Error, not \Exception, so the catch block won't save the day, it'll abort the transaction at flush time.
Fix both files:
- app/Audit/ConcreteFormatters/SummitScheduleConfigAuditLogFormatter.php:36: getIsDefault() → isDefault()
- tests/OpenTelemetry/Formatters/SummitScheduleConfigAuditLogFormatterTest.php:58: shouldReceive('getIsDefault') → shouldReceive('isDefault')
The test passes only because Mockery responds to whatever method name you configure — it doesn't validate against the real class.
61e2862 to
1000ef9
Compare
|
Ready to review @caseylocker |
caseylocker
left a comment
There was a problem hiding this comment.
SummitSchedulePreFilterElementConfigAuditLogFormatter — null config causes uncaught TypeError on pre-filter deletion
When a pre-filter is removed via SummitScheduleConfig::removePreFilter(), it calls $filter->clearConfig() which nulls the config relation before flush. Since getConfig() has a non-nullable return type (SummitScheduleConfig), PHP 8.3 throws a TypeError when the audit formatter calls it during onFlush. TypeError extends \Error, not \Exception, so neither the formatter's nor the listener's catch block catches it — the entire flush/transaction aborts.
Fix: In SummitSchedulePreFilterElementConfigAuditLogFormatter.php:35-36, guard the null config using the entity's hasConfig() method (available via One2ManyPropertyTrait):
$schedule_config = $subject->hasConfig() ? $subject->getConfig() : null;
$config_key = $schedule_config ? ($schedule_config->getKey() ?? 'Unknown Config') : 'Unknown Config';
|
@caseylocker thank you. It's ready to review |
caseylocker
left a comment
There was a problem hiding this comment.
APPROVE — Clean, well-structured PR adding 5 new audit log formatters for SummitDocument, SummitScheduleConfig, SummitSchedulePreFilterElementConfig, SummitSign, and TrackTagGroup.
Verified:
- All entity methods called in formatters confirmed to exist on their respective entities
- Follows established AbstractAuditLogFormatter pattern consistently
- Config registrations in
audit_log.phpare correct - 21 unit tests covering creation/update/deletion/invalid-subject (+ null config edge case for PreFilterElementConfig)
- All 20 CI checks passing
- No security or code quality concerns
ref: https://app.clickup.com/t/86b8jav0q