Skip to content

Expose add_to_blog, new_role, and blog_id fields in signup list and get - #630

Open
swissspidy wants to merge 2 commits into
mainfrom
add/signup-fields
Open

Expose add_to_blog, new_role, and blog_id fields in signup list and get#630
swissspidy wants to merge 2 commits into
mainfrom
add/signup-fields

Conversation

@swissspidy

@swissspidy swissspidy commented Jul 29, 2026

Copy link
Copy Markdown
Member

Exposes add_to_blog, new_role, and blog_id as available fields for wp user signup list and wp user signup get, and enables filtering by them.

  • Unserializes signup meta properties so add_to_blog and new_role are accessible as fields.
  • Aliases add_to_blog and blog_id to allow querying and filtering by either name.
  • Updates filtering logic in Signup_Command::list_() to support filtering by --new_role, --blog_id, and --add_to_blog.
  • Added acceptance test scenarios covering field output and filtering.

Closes #629

Summary by CodeRabbit

  • New Features
    • Added signup list and detail fields for add_to_blog, new_role, and blog_id.
    • Enabled filtering of signup lists by blog_id, add_to_blog, and new_role, plus corresponding retrieval via get.
  • Bug Fixes
    • Improved signup list behavior so filtering and pagination produce consistent results.
    • Enhanced how signup metadata is surfaced in list/get output for consistent field selection.
  • Tests
    • Extended signup scenarios to cover new fields, filtering, pagination, and detailed lookups.
    • Updated multisite signup test execution for more reliable command runs.

@swissspidy
swissspidy requested a review from a team as a code owner July 29, 2026 10:15
@swissspidy swissspidy added this to the 2.8.13 milestone Jul 29, 2026
@github-actions github-actions Bot added command:network-meta Related to 'network meta' command command:network-meta-get Related to 'network meta get' command command:network-meta-list Related to 'network meta list' command command:network-meta-update Related to 'network meta update' command labels Jul 29, 2026
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1caf2a77-371d-4440-81ff-cd3b5e99e35d

📥 Commits

Reviewing files that changed from the base of the PR and between 0aa207b and 688c459.

📒 Files selected for processing (2)
  • features/signup.feature
  • src/Signup_Command.php
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/Signup_Command.php
  • features/signup.feature

📝 Walkthrough

Walkthrough

Signup_Command now exposes normalized add_to_blog, new_role, and blog_id fields, supports filtering and pagination by them, and formats retrieved signups consistently. Signup feature coverage validates the new behavior and updates wp eval quoting across existing scenarios.

Changes

Signup metadata exposure

Layer / File(s) Summary
Normalize signup metadata and output fields
src/Signup_Command.php
Serialized signup metadata is promoted to top-level fields, blog identifiers are synchronized, and get uses an object for field selection and formatting.
Filter and validate signup fields
src/Signup_Command.php, features/signup.feature
Listing filters prepared signup records by new_role, blog_id, and add_to_blog, applies pagination after filtering, and feature scenarios validate listing, retrieval, pagination, filtering, and updated command quoting.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI as WP-CLI
  participant Signup_Command
  participant MultisiteSignups
  CLI->>Signup_Command: list with signup filters
  Signup_Command->>MultisiteSignups: fetch signup records
  MultisiteSignups-->>Signup_Command: signup data and serialized metadata
  Signup_Command-->>CLI: filtered and paginated fields
  CLI->>Signup_Command: get signup
  Signup_Command->>MultisiteSignups: fetch selected signup
  MultisiteSignups-->>Signup_Command: normalized signup fields
  Signup_Command-->>CLI: add_to_blog, new_role, and blog_id
Loading
🚥 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 summarizes the main change: exposing signup fields in list/get output.
Linked Issues check ✅ Passed The PR exposes blog_id and new_role as queryable/output fields and adds the requested multisite signup support.
Out of Scope Changes check ✅ Passed Changes stay focused on signup field exposure, filtering, and tests; no clear unrelated code appears.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add/signup-fields

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

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.83333% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Signup_Command.php 95.83% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@swissspidy swissspidy added command:user-signup Related to 'user signup' command command:user-signup-get Related to 'user signup get' command command:user-signup-list Related to 'user signup list' command and removed command:network-meta Related to 'network meta' command command:network-meta-get Related to 'network meta get' command command:network-meta-list Related to 'network meta list' command command:network-meta-update Related to 'network meta update' command labels Jul 29, 2026
@swissspidy

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

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

Labels

command:user-signup Related to 'user signup' command command:user-signup-get Related to 'user signup get' command command:user-signup-list Related to 'user signup list' command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please expose add_to_blog and new_role as fields in signup

1 participant