Reject invalid Requires at least header values - #392
Conversation
|
Warning Review limit reached
Next review available in: 50 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughChangesPlugin version validation
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR hardens wp scaffold plugin-tests by parsing the plugin readme.txt “Requires at least” header more defensively so that only valid WordPress version strings are used when generating CI configs (reducing the chance of invalid or malicious values being propagated).
Changes:
- Update
Scaffold_Command::scaffold_plugin_theme_tests()to only add “Requires at least” to the CI test matrix when it matches an allowed version format. - Add a Behat scenario ensuring an invalid
Requires at leastline is ignored when generating CircleCI config.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/Scaffold_Command.php |
Adds validation around parsing Requires at least so invalid values are ignored for the CI matrix. |
features/scaffold-plugin-tests.feature |
Adds an acceptance test scenario covering invalid Requires at least values in readme.txt. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| And the {PLUGIN_DIR}/.circleci/config.yml file should not contain: | ||
| """ | ||
| 6.4; echo exploit # | ||
| """ |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Summary by CodeRabbit
Bug Fixes
Tests