Problem/Motivation
Both #3392147: Add an allowed IP list to the Ban module and #3553606: Add drush unban commands introduced breaking changes. Circumvent them instead.
Steps to reproduce
Proposed resolution
Throw a deprecation notice and use the \Drupal::service() method, wherever needed.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork ban-3575604
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
grevil commentedOk, I adjusted the constructor call, but I am unsure, how to revert the "unbanAllIps" from the interface.
We could simply remove it from the interface and keep it on the manager, but I am not really a big fan of that either... but I guess that is the only way.
Comment #4
grevil commentedPlease review!
Comment #5
angel_devoeted commentedBan unit tests ran successfully.
The
drush ban:flushalso runs without errors.In
BanMiddleware::__construct(), the$config_factoryargument is nullable but still required (no default value), so the deprecation path for calling it without the argument is not actually reachable.unbanAllIps()has been removed fromBanIpManagerInterface, butBanCommands::unbanAll()still calls$this->banIpManager->unbanAllIps().Comment #6
anybodyI think it makes sense to get @mstrelan's feedback here before we proceed. We should then also discuss creating a 2.x branch now or later with the interface additions?
Comment #7
mstrelan commentedWe now have an issue in
BanCommandswhere it's calling$this->banIpManager->unbanAllIps(), but since we are typing to the interface it's possible the actual implementation does not have that function. So either we need to check if the method exists, or put it back in the interface and roll out 2.x. FWIW I'm pretty sure phpstan level 8 would have detected this before it was rolled back to level 0.Comment #8
grevil commentedLet's keep it like this and publish it in 1.1.x.
I don't think anyone implements the BanIpManagerInterface without extending the BanIpManager. Of course it is technically not best practice to introduce breaking changes in a minor release, but I think we can make an exception here.
Comment #9
anybodyThanks @grevil, I won't set this RTBC, instead @mstrelan should please decide what should finally get reverted and how it should get resolved now. Shouldn't be our decision and these are all valid points. 2.x feels a bit early to me. I'm fine with any final decision @mstrelan makes on the next steps and implementation.
If it's fine like this, please RTBC.
Comment #10
mstrelan commentedYeah, that's probably fine.
Yes, while people are transitioning from core over the next few months they should be able to run
composer require drupal/banand not have breaking changes. We can open 2.x if we want to, but let's not release anything there yet.Comment #11
anybody@mstrelan @grevil I agree with that. Let's get things done here?
@mstrelan maybe create 2.x once all relevant issues that don't require breaking changes are resolved? Otherwise, it will just be additional work.
Comment #12
grevil commented@anybody the main problem is, that we already created an 1.1.x branch with no release. And if that branch now contains no (real) breaking changes, I'd suggest using that.
We can introduce breaking changes in 2.x since it is a major release, so I don't think it makes sense to create a major release while we already have a minor release branch setup.
But I am generally a bigger fan of major release branches, so we could just skip and ignore 1.1.x entirely. It has a dev release, so we can not completely kill it unfortunately.
Comment #13
anybodyOkay let's just resolve things and stick to 1.1.x-dev for now.
Comment #14
grevil commentedComment #16
grevil commented