Skip to content

feat: add new formatters for signs and settings#499

Open
andrestejerina97 wants to merge 3 commits into
mainfrom
feature/add-sign-formatters
Open

feat: add new formatters for signs and settings#499
andrestejerina97 wants to merge 3 commits into
mainfrom
feature/add-sign-formatters

Conversation

@andrestejerina97
Copy link
Copy Markdown
Contributor

@andrestejerina97 andrestejerina97 commented Feb 18, 2026

@andrestejerina97 andrestejerina97 force-pushed the feature/add-sign-formatters branch 2 times, most recently from 34cfc95 to 9fd08aa Compare February 18, 2026 18:44
@andrestejerina97 andrestejerina97 marked this pull request as ready for review February 18, 2026 18:48
@andrestejerina97
Copy link
Copy Markdown
Contributor Author

@martinquiroga-exo ready to review

@andrestejerina97 andrestejerina97 force-pushed the feature/add-sign-formatters branch from 9fd08aa to 61e2862 Compare February 18, 2026 18:52
Copy link
Copy Markdown
Contributor

@martinquiroga-exo martinquiroga-exo left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@caseylocker caseylocker left a comment

Choose a reason for hiding this comment

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

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.

@andrestejerina97 andrestejerina97 force-pushed the feature/add-sign-formatters branch from 61e2862 to 1000ef9 Compare February 25, 2026 18:16
@andrestejerina97
Copy link
Copy Markdown
Contributor Author

Ready to review @caseylocker

Copy link
Copy Markdown
Contributor

@caseylocker caseylocker left a comment

Choose a reason for hiding this comment

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

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';

@andrestejerina97
Copy link
Copy Markdown
Contributor Author

@caseylocker thank you. It's ready to review

Copy link
Copy Markdown
Contributor

@caseylocker caseylocker left a comment

Choose a reason for hiding this comment

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

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.php are 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

@andrestejerina97 andrestejerina97 force-pushed the feature/add-sign-formatters branch from 60b5d43 to 3d33973 Compare May 8, 2026 20:12
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Warning

Rate limit exceeded

@andrestejerina97 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 13 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ae00e6a0-cf5a-4434-8a2a-58a58d353320

📥 Commits

Reviewing files that changed from the base of the PR and between 34e47f9 and 3d33973.

📒 Files selected for processing (11)
  • app/Audit/ConcreteFormatters/SummitDocumentAuditLogFormatter.php
  • app/Audit/ConcreteFormatters/SummitScheduleConfigAuditLogFormatter.php
  • app/Audit/ConcreteFormatters/SummitSchedulePreFilterElementConfigAuditLogFormatter.php
  • app/Audit/ConcreteFormatters/SummitSignAuditLogFormatter.php
  • app/Audit/ConcreteFormatters/TrackTagGroupAuditLogFormatter.php
  • config/audit_log.php
  • tests/OpenTelemetry/Formatters/SummitDocumentAuditLogFormatterTest.php
  • tests/OpenTelemetry/Formatters/SummitScheduleConfigAuditLogFormatterTest.php
  • tests/OpenTelemetry/Formatters/SummitSchedulePreFilterElementConfigAuditLogFormatterTest.php
  • tests/OpenTelemetry/Formatters/SummitSignAuditLogFormatterTest.php
  • tests/OpenTelemetry/Formatters/TrackTagGroupAuditLogFormatterTest.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/add-sign-formatters

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

📘 OpenAPI / Swagger preview

➡️ https://OpenStackweb.github.io/summit-api/openapi/pr-499/

This page is automatically updated on each push to this PR.

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