Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 9, 2025

This PR implements support for the enableMultisite step in Blueprints v2, addressing the gap where this popular step from v1 was not supported in the initial v2 implementation.

Changes Made

New Files

  • EnableMultisiteStep.php - Step implementation that uses WP-CLI's core multisite-convert command
  • EnableMultisiteStepTest.php - Unit tests for step execution and multisite verification
  • V1ToV2TranspilerTest.php - Tests for transpiler conversion functionality

Modified Files

  • appendix-A-blueprint-v2-schema.ts - Added EnableMultisiteStep type definition and included it in the Step union type
  • V1ToV2Transpiler.php - Updated to convert v1 enableMultisite steps instead of warning about them being unsupported
  • Runner.php - Added import and case handling for EnableMultisiteStep instantiation
  • proposal.md - Removed note about multisite being intentionally excluded from v2

Implementation Details

The enableMultisite step:

  • Uses WP-CLI's reliable core multisite-convert command to convert existing WordPress installations to multisite
  • Supports an optional wpCliPath parameter for custom WP-CLI executable paths
  • Maintains full backward compatibility with v1 Blueprints containing enableMultisite steps
  • Follows the established patterns for step implementation in the codebase

Example Usage

v2 Blueprint

{
  "version": 2,
  "additionalStepsAfterExecution": [
    {
      "step": "enableMultisite"
    }
  ]
}

v1 Blueprint (automatically transpiled)

{
  "steps": [
    {
      "step": "enableMultisite",
      "wpCliPath": "/custom/wp-cli.phar"
    }
  ]
}

Testing

Added comprehensive test coverage including:

  • Step execution with and without custom WP-CLI paths
  • Multisite enablement verification through WordPress constants and functions
  • V1-to-V2 transpiler conversion with various parameter combinations

Fixes #130.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9013cd039fe5740953f9fdeebd19d901b80e26f2
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/L56tc4 /usr/bin/composer install (http block)
  • https://api.github.com/repos/doctrine/instantiator/zipball/f427191c2690b0518194683d900f892ecd72c8a0
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/L56tc4 /usr/bin/composer install (http block)
  • https://api.github.com/repos/myclabs/DeepCopy/zipball/1720ddd719e16cf0db4eb1c6eca108031636d46c
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/L56tc4 /usr/bin/composer install (http block)
  • https://api.github.com/repos/yetanotherape/diff-match-patch/zipball/a0c37bc694c27ddccbd4989f72908ce524261bd1
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/Zp9xRc /usr/bin/composer install --no-dev (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] [Blueprints v2] Support enableMultisite step [Blueprints v2] Add support for enableMultisite step Jul 9, 2025
Copilot AI requested a review from adamziel July 9, 2025 14:12
@JanJakes JanJakes closed this in #136 Aug 6, 2025
@JanJakes JanJakes deleted the copilot/fix-130 branch August 6, 2025 12:39
adamziel pushed a commit to articles-adamziel-com/old-php-toolkit that referenced this pull request Aug 25, 2025
adamziel pushed a commit to wp-php-toolkit/blueprints that referenced this pull request Sep 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Blueprints v2] Support enableMultisite step

2 participants