-
Notifications
You must be signed in to change notification settings - Fork 1k
Add WP_CLI_ALIAS_GROUPS_PARALLEL environment variable for concurrent alias group execution #6129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@copilot In |
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
|
@copilot Instead of a new global argument, let's steer this with a new environment variable. |
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Changed to use |
Add support for parallel processing of alias groups in WP-CLI.
Currently, when running a command against an alias group (e.g.,
@allor a custom group like@both), WP-CLI processes each alias sequentially. This change adds support for parallel execution via theWP_CLI_ALIAS_GROUPS_PARALLELenvironment variable, significantly improving execution speed when running commands across multiple WordPress installations.Changes Made
WP_CLI_ALIAS_GROUPS_PARALLELenvironment variable supportrun_alias_group()method in Runner.php to check the environment variableImplementation Details
The implementation uses the
WP_CLI_ALIAS_GROUPS_PARALLELenvironment variable:1), spawns all alias processes concurrently before waiting for resultsUsage Examples
Performance Benefits
This change provides significant performance improvements when:
Backward Compatibility
The default behavior remains unchanged - aliases are processed sequentially unless the
WP_CLI_ALIAS_GROUPS_PARALLELenvironment variable is set. This ensures no breaking changes for existing workflows.Security Summary
✅ All shell arguments are properly escaped using
escapeshellarg()✅ No new security vulnerabilities introduced
✅ Code review completed with no issues
✅ CodeQL security scan completed with no findings
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.