Skip to content

Fix URL completion and prompt test with entity-command 3.0.3 - #6428

Merged
swissspidy merged 1 commit into
mainfrom
claude/fix-tests-entity-command-3.0.3
Oct 7, 2026
Merged

swissspidy merged 1 commit into
mainfrom
claude/fix-tests-entity-command-3.0.3

Conversation

@swissspidy

@swissspidy swissspidy commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

CI on main installs entity-command v3.0.3, which made three Behat scenarios fail: two in cli-bash-completion.feature and one in prompt.feature.

  • URL completion: Completions::get_network_urls() lists the sites with wp site list --field=url --number=-1.
  • Prompt scenario: the test answered every prompt of wp post list --prompt in order.
    • post list now documents its filters (--p, --title, --name, …), so the answers landed on the wrong options.
    • The test now passes --post_type=post directly 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.feature and prompt.feature pass 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

  • Bug Fixes
    • Network site listings now use --number=0 when retrieving site URLs, helping ensure the command returns the expected results.
    • Prompted wp post list commands now set the post type explicitly and request only the remaining options.

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
@swissspidy
swissspidy requested a review from a team as a code owner October 7, 2026 13:03
Copilot AI balanced review requested due to automatic review settings October 7, 2026 13:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4c033b19-c85d-47ee-b253-37ae98353e74
📥 Commits

Reviewing files that changed from the base of the PR and between e00beea and 70a61b6.

📒 Files selected for processing (2)
  • features/prompt.feature
  • php/WP_CLI/Completions.php

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The prompt scenario now sets post_type on the command and prompts for fields and format. Network URL lookup now requests site list with --number=0.

Changes

Prompt Scenario

Layer / File(s) Summary
Prompt command and expected input
features/prompt.feature
The scenario sets --post_type=post on the command and limits prompted inputs to fields and format.

Network URL Lookup

Layer / File(s) Summary
Site list request
php/WP_CLI/Completions.php
The network URL lookup passes --number=0 to site list.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: schlessera

Merge Risk: ⚪ Minimal · up to 70a61

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)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies both changes: fixing URL completion and updating the prompt test for entity-command 3.0.3.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added bug command:cli-completions Related to 'cli completions' command dependent parameter:prompt scope:testing Related to testing labels Oct 7, 2026
@swissspidy swissspidy added this to the 3.0.0 milestone Oct 7, 2026
@swissspidy
swissspidy merged commit 840d43f into main Oct 7, 2026
64 checks passed
@swissspidy
swissspidy deleted the claude/fix-tests-entity-command-3.0.3 branch October 7, 2026 13:17
@codecov

codecov Bot commented Oct 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug command:cli-completions Related to 'cli completions' command dependent parameter:prompt scope:testing Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants