Skip to content

Make invalid --porcelain test compatible with core option validation - #261

Merged
swissspidy merged 2 commits into
mainfrom
claude/media-command-ci-failure-n2n6vf
Sep 23, 2026
Merged

swissspidy merged 2 commits into
mainfrom
claude/media-command-ci-failure-n2n6vf

Conversation

@swissspidy

@swissspidy swissspidy commented Sep 23, 2026

Copy link
Copy Markdown
Member

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

Summary by CodeRabbit

  • Bug Fixes
    • Media imports no longer stop with a validation error when --porcelain is given an unrecognized string value. The command outputs the attachment URL when the value is url; 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.

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
@swissspidy
swissspidy requested a review from a team as a code owner September 23, 2026 06:12
Copilot AI lite review requested due to automatic review settings September 23, 2026 06:12

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 Sep 23, 2026

Copy link
Copy Markdown

Review in Change Stack →

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: d13baff0-5159-435c-80a4-529659683308

📥 Commits

Reviewing files that changed from the base of the PR and between ee69c48 and a18d944.

📒 Files selected for processing (2)
  • features/media-import.feature
  • src/Media_Command.php
💤 Files with no reviewable changes (1)
  • src/Media_Command.php

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The import command no longer rejects string values for --porcelain other than url. These values follow the existing output logic, which prints the attachment ID. The feature test updates its expected STDERR message.

Changes

Media import porcelain handling

Layer / File(s) Summary
Porcelain value handling
src/Media_Command.php, features/media-import.feature
The import command removes validation for non-url string values of --porcelain. The feature test updates its expected STDERR message to the parameter-validation format.

Priority: ⬇️ Low

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

Change: Other

Suggested reviewers: ernilambar

Merge Risk: ⚪ Minimal · up to a18d9

Invalid --porcelain values remain rejected before media import runs, and the updated test checks that behavior. No actionable merge-blocking risk remains.

🚥 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 and concisely describes the main change: updating the invalid --porcelain test to match core option validation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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

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.

@codecov

codecov Bot commented Sep 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@swissspidy
swissspidy merged commit c770538 into main Sep 23, 2026
57 checks passed
@swissspidy
swissspidy deleted the claude/media-command-ci-failure-n2n6vf branch September 23, 2026 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated-pr command:media-import Related to 'media import' command scope:testing Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants