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

refactor(overrides): Refactor service overrides to allow for more complexity #89

Merged
merged 48 commits into from
Jan 25, 2025

Conversation

ollieread
Copy link
Member

@ollieread ollieread commented Jan 11, 2025

This PR refactors the current service override functionality with the following key changes.

  • The introduction of a ServiceOverrideManager that is responsible for registering, booting and all other service override actions
  • The removal of the DeferrableServiceOverride interface and functionality to support deferring service overrides
  • The introduction of a request constructor for ServiceOverride implementations
  • The immediate instantiation of service overrides when registered
  • A new config file (config/sprout/overrides.php) to allow for more fine-grained complex config per service override
  • The introduction of an override tenancy option to provide a filtered list of overrides that are enabled for the tenancy
  • The introduction of an override.all tenancy option to enable all configured overrides
  • The migration of the core config config/sprout.php to config/sprout/core.php

@ollieread ollieread added type: refactor Refactoring of code status: accepted The issue has been accepted/acknowledged and is being actioned or will be labels Jan 11, 2025
@ollieread ollieread self-assigned this Jan 11, 2025
@ollieread ollieread added this to the V1 Release milestone Jan 11, 2025
Copy link

codecov bot commented Jan 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.08%. Comparing base (734a17b) to head (72ecd65).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@              Coverage Diff              @@
##               main      #89       +/-   ##
=============================================
+ Coverage     68.49%   83.08%   +14.59%     
- Complexity      507      553       +46     
=============================================
  Files            68       73        +5     
  Lines          1441     1555      +114     
=============================================
+ Hits            987     1292      +305     
+ Misses          454      263      -191     

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

The sprout driver for the cache manager wasn't added if the cache manager had already been resolved, and because the driver creation method was bound to the manager, it wasn't able to access $this->drivers
The sprout driver for the cache manager wasn't added if the cache manager had already been resolved, and because the driver creation method was bound to the manager, it wasn't able to access $this->drivers
@ollieread ollieread merged commit 4b399db into main Jan 25, 2025
4 checks passed
@ollieread ollieread deleted the refactor/service-overrides branch January 25, 2025 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepted The issue has been accepted/acknowledged and is being actioned or will be type: refactor Refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Separate service overrides to their own manager to allow for more complex configuration
1 participant