Expose add_to_blog, new_role, and blog_id fields in signup list and get - #630
Expose add_to_blog, new_role, and blog_id fields in signup list and get#630swissspidy wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthrough
ChangesSignup metadata exposure
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant CLI as WP-CLI
participant Command as Signup_Command
participant Records as Multisite signups
CLI->>Command: list with signup filters
Command->>Records: fetch signup records
Records-->>Command: signup data and serialized metadata
Command-->>CLI: filtered formatted fields
CLI->>Command: get signup
Command->>Records: fetch selected signup
Records-->>Command: normalized signup fields
Command-->>CLI: add_to_blog, new_role, and blog_id
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/Signup_Command.php (1)
149-166: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winApply
--per_pageafter metadata filtering.The SQL
LIMITruns before this loop, so--blog_id=228 --per_page=1can return no result even when a matching signup exists later in the table. Filter prepared items first, then slice the filtered list (or push applicable filters into SQL). Add a Behat regression case combining a metadata filter with--per_page.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/Signup_Command.php` around lines 149 - 166, Update the signup filtering flow around prepare_signup_array so metadata filters are applied to all eligible results before enforcing per_page pagination; avoid relying on the SQL LIMIT for this filtered path. Preserve existing filter matching behavior, then slice the filtered signups to the requested per_page count, and add a Behat regression case combining a metadata filter such as --blog_id with --per_page.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@src/Signup_Command.php`:
- Around line 149-166: Update the signup filtering flow around
prepare_signup_array so metadata filters are applied to all eligible results
before enforcing per_page pagination; avoid relying on the SQL LIMIT for this
filtered path. Preserve existing filter matching behavior, then slice the
filtered signups to the requested per_page count, and add a Behat regression
case combining a metadata filter such as --blog_id with --per_page.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 580fe291-bb09-4452-a4ec-906535fe388e
📒 Files selected for processing (2)
features/signup.featuresrc/Signup_Command.php
Exposes
add_to_blog,new_role, andblog_idas available fields forwp user signup listandwp user signup get, and enables filtering by them.add_to_blogandnew_roleare accessible as fields.add_to_blogandblog_idto allow querying and filtering by either name.Signup_Command::list_()to support filtering by--new_role,--blog_id, and--add_to_blog.Closes #629
Summary by CodeRabbit
New Features
add_to_blog,new_role, andblog_id.Tests