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

Merged
merged 1 commit into from
Feb 24, 2025

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.50%. Comparing base (8cc3f95) to head (faaae31).
Report is 1 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.53%   78.50%   -0.04%     
==========================================
  Files         168      168              
  Lines        8760     8778      +18     
==========================================
+ Hits         6880     6891      +11     
- Misses       1880     1887       +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.

@phansys phansys merged commit 1205a91 into doctrine-extensions:main Feb 24, 2025
21 of 23 checks passed
@phansys
Copy link
Collaborator

phansys commented Feb 24, 2025

Thank you @mbabker!

@phansys
Copy link
Collaborator

phansys commented Feb 24, 2025

@stof, this was released under 3.19.0.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants