Skip to content

Resolve Action Scheduler path from Composer install location, require Action Scheduler 4.2.* - #27

Merged
gin0115 merged 3 commits into
masterfrom
fix/action-scheduler-path
Oct 17, 2026
Merged

gin0115 merged 3 commits into
masterfrom
fix/action-scheduler-path

Conversation

@gin0115

@gin0115 gin0115 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #26

  • Action_Scheduler_Driver::setup() now gets its default path from a new private default_action_scheduler_path(), which uses Composer\InstalledVersions::getInstallPath( 'woocommerce/action-scheduler' ) so Action Scheduler is found when pinkcrab/queue is 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 and setup() throws the existing RuntimeException. The pinkcrab_queue_action_scheduler_path filter is unchanged.
  • Requires composer-runtime-api: ^2.0 so Composer\InstalledVersions is always available.
  • woocommerce/action-scheduler constraint moved from 3.9.* to 4.2.* (4.2.0 requires PHP >=7.2, so php >=8.0.0 is unchanged).
  • README updated to match.
  • Unit tests cover the installed path, a package that is not installed, and a package with a null install path.
  • Added a functional test for Queue::service() retrying when App::make() returns null on the first call.

… 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

codecov Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (461eed5) to head (41e5124).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.
@gin0115
gin0115 merged commit ee2f31a into master Oct 17, 2026
23 checks passed
@gin0115 gin0115 mentioned this pull request Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default Action Scheduler path fails when installed as a dependency, and Action Scheduler constraint is out of date

1 participant