Repository navigation
Resolve Action Scheduler path from Composer install location, require Action Scheduler 4.2.* - #27
Merged
Merged
Conversation
… Action Scheduler 4.2.* The default path in Action_Scheduler_Driver::setup() assumed pinkcrab/queue was the root package, so it pointed inside vendor/pinkcrab/queue/vendor/ when installed as a dependency and threw 'Action Scheduler is not installed.'. It now uses Composer\InstalledVersions::getInstallPath() for woocommerce/action-scheduler, falling back to the root package vendor path. The pinkcrab_queue_action_scheduler_path filter is unchanged. Move woocommerce/action-scheduler from 3.9.* to 4.2.* to match the version current WooCommerce loads. Refs #26.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #27 +/- ##
=============================================
+ Coverage 99.56% 100.00% +0.43%
- Complexity 81 84 +3
=============================================
Files 10 10
Lines 231 229 -2
=============================================
- Hits 230 229 -1
+ Misses 1 0 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Remove the root package vendor path fallback from default_action_scheduler_path(). When pinkcrab/queue is the root package InstalledVersions already returns that path, so the fallback never ran. The method now returns an empty string when the package is not installed or has no install path, and setup() throws the existing RuntimeException. Require composer-runtime-api ^2.0 so Composer\InstalledVersions is always available, and drop the class_exists() check. The package name is a parameter so tests can cover the not installed and null install path cases.
Covers the branch in Queue::service() where App::make() returns null on the first call.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #26
Action_Scheduler_Driver::setup()now gets its default path from a new privatedefault_action_scheduler_path(), which usesComposer\InstalledVersions::getInstallPath( 'woocommerce/action-scheduler' )so Action Scheduler is found whenpinkcrab/queueis installed as a dependency as well as when it is the root package. If the package is not installed (or has no install path) it returns an empty string andsetup()throws the existingRuntimeException. Thepinkcrab_queue_action_scheduler_pathfilter is unchanged.composer-runtime-api: ^2.0soComposer\InstalledVersionsis always available.woocommerce/action-schedulerconstraint moved from3.9.*to4.2.*(4.2.0 requires PHP >=7.2, sophp >=8.0.0is unchanged).Queue::service()retrying whenApp::make()returns null on the first call.