Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for an actor provider for extensions which use a user reference #2914

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mbabker
Copy link
Contributor

@mbabker mbabker commented Feb 1, 2025

Ref: #2843

This is kind of a fresh take on #2074 which is seemingly more relevant with stuff like FrankenPHP out there nowadays. For now I went with a single interface that can be used by all extensions (since loggable (and the WIP revisionable) have a similar thing), but since the extensions also have different requirements (blameable supports strings and associations, loggable only supports strings), maybe this needs more refinement. Also for now there aren't any implementations shipped in this library, what goes on within a provider is probably better handled either in the framework integrations or directly within an application.

Copy link

codecov bot commented Feb 1, 2025

Codecov Report

Attention: Patch coverage is 72.41379% with 8 lines in your changes missing coverage. Please review.

Project coverage is 78.59%. Comparing base (b6048c1) to head (686a7c1).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/Loggable/LoggableListener.php 56.25% 7 Missing ⚠️
src/Blameable/BlameableListener.php 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2914      +/-   ##
==========================================
- Coverage   78.64%   78.59%   -0.05%     
==========================================
  Files         171      171              
  Lines        8775     8789      +14     
==========================================
+ Hits         6901     6908       +7     
- Misses       1874     1881       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@stof
Copy link
Contributor

stof commented Feb 7, 2025

This seems like a good idea.

One benefit (once I implement the actor provider in StofDoctrineExtensionsBundle) is that this will avoid reading the authenticated user early in the request (requiring to potentially start the session), even in requests that won't ever record a blameable change.

@stof
Copy link
Contributor

stof commented Feb 17, 2025

@mbabker what is the plan for this PR ? Are you going to merge it ? I got a new report on the bundle that would also be solved by migrating to the actor provider.

@mbabker mbabker marked this pull request as ready for review February 17, 2025 14:44
@mbabker
Copy link
Contributor Author

mbabker commented Feb 17, 2025

I went ahead and did a quick docs update, should be ready for review/merge now.

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.

2 participants