Skip to content

Turn block into a command namespace#2

Merged
schlessera merged 4 commits intomainfrom
fix/change-block-into-command-namespace
Dec 10, 2025
Merged

Turn block into a command namespace#2
schlessera merged 4 commits intomainfrom
fix/change-block-into-command-namespace

Conversation

@schlessera
Copy link
Copy Markdown
Member

@schlessera schlessera commented Dec 10, 2025

The empty block command would be better as a command namespace.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @schlessera, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant architectural improvement by refactoring the WP-CLI block command into a command namespace. This change streamlines the command structure, making it easier to manage and discover block-related functionalities through a more organized hierarchy. The implementation includes a conditional check for the CommandNamespace class, ensuring robust compatibility across various WP-CLI setups.

Highlights

  • Refactored Block Command: The core block command has been refactored to extend WP_CLI\Dispatcher\CommandNamespace, transforming it from a standalone command into a command namespace.
  • Improved Command Structure: This change enhances the organization and presentation of block-related subcommands (like block type, block pattern), leading to clearer help screens and a more intuitive user experience.
  • Conditional Registration: The block command's registration as a namespace is now conditional, ensuring compatibility with environments where the CommandNamespace class might not be available.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@schlessera schlessera added the enhancement New feature or request label Dec 10, 2025
@schlessera schlessera added this to the 1.0.0 milestone Dec 10, 2025
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the block command to be a command namespace, which improves the help screen output on modern WP-CLI versions.

My review focuses on ensuring backward compatibility, which seems to be the intent given the conditional checks. I've identified a critical issue that would cause a fatal error on older WP-CLI versions and provided a fix. I've also suggested an improvement to the command registration logic to ensure a consistent and helpful experience across all versions.

Comment thread block-command.php Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 10, 2025

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@schlessera schlessera force-pushed the fix/change-block-into-command-namespace branch from 374bb93 to 68e9559 Compare December 10, 2025 11:20
@schlessera schlessera merged commit 23d2318 into main Dec 10, 2025
43 of 44 checks passed
@schlessera schlessera deleted the fix/change-block-into-command-namespace branch December 10, 2025 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant