-
-
Notifications
You must be signed in to change notification settings - Fork 425
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
[4.x] Add command to bring the tenants up and down from maintenance and remove deprecated exception #761
Conversation
Hey. This looks good, thanks for the contribution! I think I had some maintenance mode related tasks written in my backlog for v4, so I'll probably merge this when working on the feature. Should be in January I think. |
Codecov Report
@@ Coverage Diff @@
## 3.x #761 +/- ##
============================================
- Coverage 87.02% 85.62% -1.40%
- Complexity 372 375 +3
============================================
Files 103 105 +2
Lines 1102 1120 +18
============================================
Hits 959 959
- Misses 143 161 +18
Continue to review full report at Codecov.
|
Closing #757 and will finish that here. We could probably add |
Laravel now simply throws a If you give me a few days, I can update the code and comply to the new maintenance mode used by Laravel and then update the commands so that we can use the same parameters as Laravel. Note: Naturally this would allow #757 |
Sure, thanks a lot for the work on this! FWIW if there's a signature change, you can use the version in Laravel 9. And probably change the target to the |
I'm glade you mentioned Laravel 9 because coincidently two PRs (1, 2) have been accepted during those last few days and it changed the maintenance system. L9 will now have a configurable driver for the maintenance storage system (which will determine how and where the data is stored), at the time of writing this comment there are two drivers/managers file: Which is the old way to put the application to maintenance ; cache : Which will store the data inside the cache. The reason they added drivers, is because when using a load balancer and you set the application into maintenance mode it would only work on the application the command has been typed on... so a cache driver was needed. But this package doesn't need such implementation because even if you would use a load balancer, there should be only one database connection per tenant for all applications (at least in most use cases). So I think to keep things simple, this PR will keep its own feature and keep storing the data in the database. It might be important to mention in the documentation that the maintenance mode doesn't uses the driver from the config file. Maybe in another PR we can try to create our custom driver, tenant compatible. |
That is in the |
Yes |
Just a note: the tests will fail because |
@stancl the PR is done and all the tests have been added. |
Probably wait until master is updated 👍🏻 When we add L9 support, I'll merge 3.x into master |
@lukinovec I think we should finish this PR before the pending tenants since it's smaller and it interacts with the trait adding a Also, the tests are showing as failing, but I think they'll run differently when the CI is triggered again since I simplified the CI matrix in the |
Only php-cs-fixer is failing, tests seem to be passing, so CI-wise this PR is ready now. I'll look at the code now and see if this is ready to be merged. |
@stein-j Is anything unimplemented yet or is the PR fully ready? Is the code made to work with Laravel 9 (the changes you made to the way tenants are put into maintenance mode)? |
@stancl I want to go over it again, it's been a while and a file was changed in another PR since (https://github.com/archtechx/tenancy/pull/802/files#diff-40487242039e9842dc87ba96285282e42d0cc5b9a7dbeac6f115c4ee2bb8db59). Let me get back to you in a few hours. |
@stancl what will be the minimum requirements for Laravel and PHP for V4 ? |
Just that the syntax is updated for Laravel 9. I think you already did this since the PR is recent. But I'm just checking in case anything is missing. |
Ok, it's all good. |
FYI I merged |
Thanks for your work on this PR! |
This PR changes the maintenance mode to comply to the changes made in Laravel 8.
New
Adds two CLI commands to the package:
tenancy:up
andtenancy:down
with the same parameters as the default Laravel command except for the optionrender
because it is not possible to render a page before Laravel is booted for a specific tenant.Adds the function
bringUpFromMaintenance
in the traitMaintenanceMode
.Changes
A tenant in maintenance mode now throws an
HttpException
exception instead of the deprecatedMaintenanceModeException
exception.Closes #533.