Include support for banner/ajax/load controller (enterprise specific) #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Have a Magento Commerce 2.2 site which I just rolled out a modified version of this extension on a short while ago. Enterprise has a
banner/ajax/load
call which similarly reads from session, but never writes, so the changes here are adding support for that.On my local test site with a
sleep(5)
added to exaggerate requests to bothbanner/ajax/load
andcustomer/section/load
for easily testing the lock release I get the following results:Before installation (click to expand image):

After modified module is installed (click to expand image):

For now, I have this installed on the site by adding the following into the
composer.json
file to pull the modified module:Given these changes introduce a hard dependency on the Commerce/Enterprise only
Magento\Banner\Controller\Ajax\Load
class intests/Integration/AbstractSessionTest.php
, the integration tests will fail if they are run from an open-source code base. DI rules targeting non-existent classes are merely ignored, so the module will install and run no problem on open-source however (verified this on a vanilla 2.3.3 OS with sample data).I'm opening this PR both to share the work that I've done, but also ask for ideas on path forward to supporting controllers that do not exist in open-source. Have you guys thought about this yet and what might you suggest to support both open-source and enterprise?
One thought I had is perhaps splitting it to a separate module dependent on this one, keeping them nice and clean but that has the downside of multiple modules to maintain. Alternatively, the tests could be setup so only the open-source tests are run perhaps by using a different phpunit.xml file for enterprise and opensource integration testing where the enterprise one included additional tests, and then splitting
AbstractSessionTest::setUpSpies
out of the abstract to avoid hard dependencies on irrelevant controller classes.Thoughts?