Repository navigation
Fix URL completion and prompt test with entity-command 3.0.3 - #6428
Conversation
entity-command 3.0.3 passes an explicit --number to WP_Site_Query, which reads -1 as a limit of 1, so URL completion only offered the main site. WP_Site_Query treats 0 as no limit, so pass --number=0 instead. Older entity-command versions ignore --number. The prompt scenario answered every prompt of `wp post list` in order, which broke once the command documented its filters. Pass --post_type directly and only prompt for --fields and --format. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D26yjkN2BiqCXT6p6o1WqS
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe prompt scenario now sets ChangesPrompt Scenario
Network URL Lookup
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~8 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The change adjusts site listing and narrows the prompt scenario’s inputs. No concrete regression is supported by the supplied context, so it appears ready to merge subject to normal checks. 🚥 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! |
CI on
maininstalls entity-command v3.0.3, which made three Behat scenarios fail: two incli-bash-completion.featureand one inprompt.feature.Completions::get_network_urls()lists the sites withwp site list --field=url --number=-1.wp site listentity-command#639, an explicit--numberis passed toget_sites().WP_Site_Queryrunsabsint()on it, so-1becameLIMIT 1and only the main site was offered.--number=0, whichWP_Site_Querytreats as no limit.--number, so they still list all sites.wp post list --promptin order.post listnow documents its filters (--p,--title,--name, …), so the answers landed on the wrong options.--post_type=postdirectly and runs--prompt=fields,format, so it no longer depends on that command's option list. It still checks that the full command is shown after the inputs, but no longer covers the generic--<field>=<value>prompt.Tests
cli-bash-completion.featureandprompt.featurepass with both entity-command v3.0.3 and the previous version, and PHPCS is clean. The full Behat suite wasn't run locally.🤖 Generated with Claude Code
https://claude.ai/code/session_01D26yjkN2BiqCXT6p6o1WqS
Generated by Claude Code
Summary by CodeRabbit
--number=0when retrieving site URLs, helping ensure the command returns the expected results.wp post listcommands now set the post type explicitly and request only the remaining options.