feat: add new formatters for signs and settings#499
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
60b5d43 to
3d33973
Compare
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
📘 OpenAPI / Swagger preview ➡️ https://OpenStackweb.github.io/summit-api/openapi/pr-499/ This page is automatically updated on each push to this PR. |
ref: https://app.clickup.com/t/86b8jav0q