Closes #8300: stop action_scheduler_run_queue_rucss cron when RUCSS is deactivated#8341
Open
Miraeld wants to merge 13 commits into
Open
Closes #8300: stop action_scheduler_run_queue_rucss cron when RUCSS is deactivated#8341Miraeld wants to merge 13 commits into
Miraeld wants to merge 13 commits into
Conversation
Adds full .aiassistant/ setup with issue workflow, QA engineer agent, knowledge graph builder (880 PHP/JS nodes indexed), architecture and compliance skills, and PHPCS specs. Adapted for wp-rocket: single edition, WP_Rocket\ namespace, Subscriber/ServiceProvider/Container patterns, wpm_apply_filters_typed enforcement, fix/enhancement/test branch prefixes, and TDD testing guide.
- make-issue-branch.sh: add optional 4th arg [base-ref] so branches are always created from the latest remote (origin/develop) regardless of current working branch - SKILL.md: step 10 passes origin/develop as base-ref; step 19 auto-assigns PR to self after creation; step 20 mentions e2e-qa-tester delegation and PR comment posting; QA Pipeline section adds e2e-qa-tester sub-agent, decision tree, and updated tooling table - qa-engineer.md: description adds "in an isolated context"; Strategy B delegates browser validation to e2e-qa-tester instead of doing Playwright directly; adds Step 5b (post full report as PR comment); output format adds "Tests that could not be automated" and "Screenshots" sections - e2e-qa-tester.md: new browser QA specialist agent adapted from backwpup-pro Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Ported from backwpup-pro. These scripts are used by the e2e-qa-tester agent to boot, seed, and tear down the local WordPress environment. - dev-up.sh: starts wp-env, activates wp-rocket, runs seed (pass --no-seed to skip) - dev-down.sh: stops wp-env (pass --destroy to wipe volumes/DB) - dev-seed.sh: sets license key from WP_ROCKET_TESTS_LICENSE_KEY env var and flushes the cache for a clean initial state
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fold knowledge graph step into grooming-agent invocation - Add lead-reviewer gate after implementation, before push - Formalise PR title format (Closes #N: title) - Require Co-Authored-By trailer on every AI commit - Restrict Type of change to exactly one checkbox - Apply Made by AI label on PR creation when available - Make base branch dynamic and propagate it to lead-reviewer and qa-engineer Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…agent Add architectural check (step 3c) prompting the grooming-agent to question whether a buggy method belongs in its current class before proposing a fix. The wp-rocket version also instructs the agent to use the knowledge graph to find all Subscribers for the feature. Relabel former c/d checks to d/e. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
grooming-agent and lead-reviewer no longer embed wp-rocket-architecture and wordpress-compliance rules inline. Agents now read the skill files at runtime, making skill files the single source of truth. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add manager agent: reads spec, decides scope (patch vs refactor), dispatches to backend and/or frontend agents — asks user when scope is ambiguous - Add backend-agent: implements PHP changes, runs PHPCS + PHPStan - Add frontend-agent: implements JS/CSS changes, runs linting - Add wp-rocket-frontend-architecture skill with frontend coding rules - Add .claude/commands symlink for new frontend architecture skill - Update grooming-agent: surfaces both implementation options without concluding; spec now includes an Implementation Options section for the manager to act on - Update issue-workflow: new 7-agent pipeline with max 3 retries on backend-agent, frontend-agent, lead-reviewer, and qa-engineer Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace flat manager pattern with an orchestrator that spawns specialized agents: grooming-reviewer, ci-agent, release-agent. Implementation agents (backend, frontend) now commit atomically. QA returns structured output. issue-workflow skill simplified to entry point only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace grooming-reviewer with challenger (conditional, adversarial, APPROVED/NEEDS_REVISION/BLOCKED verdicts, MoSCoW findings, GitHub comment) - Orchestrator: risk-based CHALLENGER trigger, DOD L2 independent gate, criticality-based lead-reviewer routing, NTH dispatch, updated escalation rules - lead-reviewer: criticality tiers (CRITICAL/HIGH/MEDIUM/LOW), inline PR comments - backend-agent / frontend-agent: reframe Verify as DOD L1 with self-correction Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
initialize_rucss_queue_runner() was using JobProcessor::is_allowed() which returns true if ANY registered factory (including Rocket Insights) is allowed. Replace the guard with a RUCSS-specific check via $factories['rucss']->manager()->is_allowed() so the action_scheduler_ run_queue_rucss cron event is not registered when RUCSS is off. Add unit tests covering the early-return guard cases. Fixes #8300 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Contributor
Author
Test Report — fix/8300-action-scheduler-run-queueBranch: fix/8300-action-scheduler-run-queue Acceptance Criteria
Unit Test RunNew tests added:
Smoke Tests
Overall: PASS Blockers: none Recommendations (non-blocking):
Tests that could not be automated
|
jeawhanlee
approved these changes
Jun 2, 2026
Contributor
jeawhanlee
left a comment
There was a problem hiding this comment.
LGTM
Didn't test it manually, but the code looks nice.
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.
Description
Fixes #8300
When the Remove Unused CSS (RUCSS) option is deactivated, the
action_scheduler_run_queue_rucssWP-Cron event was continuing to run every minute. The root cause was thatinitialize_rucss_queue_runner()inCommon\JobManager\Cron\Subscriberwas guarded byJobProcessor::is_allowed(), which returnstrueif any registered factory (including Rocket Insights) is allowed — not just RUCSS. This caused the RUCSS queue runner to keep initializing even when RUCSS was off but Rocket Insights was active.The fix replaces the generic guard with a RUCSS-specific check:
$this->factories['rucss']->manager()->is_allowed(). Now the queue runner only initializes when RUCSS is explicitly enabled.Type of change
Detailed scenario
What was tested
Strategy: Code analysis + unit test suite (local WordPress environment unreachable).
Unit tests: All 20
Cron\Subscriberunit tests pass (including 2 new tests added for this fix).shouldNotInitWhenRucssIsDisabledAndRocketInsightsIsActiveshouldNotInitWhenRucssFactoryIsAbsentshouldNotReceive('manager')on RI factoryManual verification against a live site (WP Control plugin showing cron events) is recommended before merge.
How to test
action_scheduler_run_queue_rucsscron event is scheduled (e.g. using WP Control plugin).inithook.action_scheduler_run_queue_rucsscron event is no longer scheduled.rocket_saas_pending_jobs) remain active as long as any SaaS feature is on.Affected Features & Quality Assurance Scope
schedule_pending_jobs,schedule_on_submit_jobs,schedule_removing_failed_jobsare unchanged and must continue to work for all active factories.Technical description
Documentation
Root cause:
Subscriber::initialize_rucss_queue_runner()called$this->job_processor->is_allowed().JobProcessor::is_allowed()iterates all registered factories and returnstrueif any one of them is allowed. With both RUCSS and Rocket Insights factories registered, Rocket Insights being active was sufficient to keep the RUCSS queue runner alive.Fix: Change the guard in
initialize_rucss_queue_runner()from:to:
The
isset()guard is defensive —$factories['rucss']is always wired byCommon\JobManager\ServiceProvider, but the guard prevents any fatal error if the key were absent in a future refactor.Other methods in the same Subscriber (
schedule_pending_jobs,schedule_clean_not_commonly_used_rows, etc.) correctly use the aggregatedJobProcessor::is_allowed()because they manage cron events shared across all SaaS features. Onlyinitialize_rucss_queue_runner()was RUCSS-specific and required a feature-specific check.New dependencies
None.
Risks
Low. The change is a single-line guard condition replacement. It cannot affect any other feature's cron scheduling. The only risk is if the
'rucss'factory key were renamed in theServiceProvider— mitigated by theisset()guard and by the fact that the key is also used inJobProcessorand other places.Mandatory Checklist
Code validation
Code style
Unticked items justification
N/A
Additional Checks