Make invalid --porcelain test compatible with core option validation - #261
Conversation
wp-cli/wp-cli#6410 validates `options` for optional-value flags such as `[--porcelain[=<field>]]` in the framework, so `--porcelain=invalid` is now rejected with a generic "Parameter errors" message before the command runs. Assert on the parts common to both the old command-level error and the new framework error so the scenario passes with either wp-cli version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013PyGcB6bxx6zExR9LLHv99
WP-CLI now validates `options` for optional-value flags such as `[--porcelain[=<field>]]` itself (wp-cli/wp-cli#6410), so the command-level check is unreachable. Update the scenario to expect the framework's error message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013PyGcB6bxx6zExR9LLHv99
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe import command no longer rejects string values for ChangesMedia import porcelain handling
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~8 minutes Change: Other Suggested reviewers: Merge Risk: ⚪ Minimal · up to Invalid 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
wp-cli/wp-cli#6410 validates
optionsfor optional-value flags such as[--porcelain[=<field>]]in the framework, so--porcelain=invalidis nowrejected with a generic "Parameter errors" message before the command runs.
Assert on the parts common to both the old command-level error and the new
framework error so the scenario passes with either wp-cli version.
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_013PyGcB6bxx6zExR9LLHv99
Summary by CodeRabbit
--porcelainis given an unrecognized string value. The command outputs the attachment URL when the value isurl; for other string values, it outputs the attachment ID. This changes the error users see for invalid values into a successful import with attachment ID output.