Skip to content

Conversation

@mlaetitia
Copy link
Contributor

@mlaetitia mlaetitia commented Jul 23, 2025

In this PR

  • Add --skip-themes --skip-plugins to the safetynet install command on the site cloning (in case there's an issue with the site, we're still able to install safety.net)
  • Remove the search-replace step from the site cloning processes as WP Cloud already includes this on the infrastructure cloning process

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability of SafetyNet plugin installation during site cloning and staging by skipping the loading of other plugins and themes.
    • Removed the automatic URL search-and-replace step during site clone and staging processes.

…P Cloud already includes this on the infrastructure cloning process
@coderabbitai
Copy link

coderabbitai bot commented Jul 23, 2025

Walkthrough

The changes update the site cloning commands by modifying the SafetyNet plugin installation step to use the --skip-plugins --skip-themes flags with WP-CLI, ensuring other plugins and themes are not loaded during installation. Additionally, the WP-CLI search-replace step for updating URLs has been removed from both commands.

Changes

File(s) Change Summary
commands/Pressable_Site_Clone.php Added --skip-plugins --skip-themes to SafetyNet plugin install; removed WP-CLI search-replace command.
commands/WPCOM_Site_Clone.php Added --skip-plugins --skip-themes to SafetyNet plugin install; removed WP-CLI search-replace command.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CloneCommand
    participant WP_CLI

    User->>CloneCommand: Initiate site clone
    CloneCommand->>WP_CLI: Install SafetyNet plugin (--skip-plugins --skip-themes)
    WP_CLI-->>CloneCommand: Plugin installed
    CloneCommand->>WP_CLI: Flush cache
    WP_CLI-->>CloneCommand: Cache flushed
    CloneCommand-->>User: Clone complete
Loading

Estimated code review effort

2 (~12 minutes)

Poem

A bunny hopped through code today,
Tweaked plugin installs the clever way.
No more search-replace in sight,
Skipping themes and plugins right.
With caches flushed and steps made lean,
The cloning process runs more clean!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d6a3854 and b029ede.

📒 Files selected for processing (2)
  • commands/Pressable_Site_Clone.php (1 hunks)
  • commands/WPCOM_Site_Clone.php (1 hunks)
🧬 Code Graph Analysis (2)
commands/Pressable_Site_Clone.php (1)
includes/functions-pressable.php (1)
  • run_pressable_site_wp_cli_command (612-623)
commands/WPCOM_Site_Clone.php (1)
includes/functions-wpcom.php (1)
  • run_wpcom_site_wp_cli_command (626-637)
🧰 Additional context used
🧬 Code Graph Analysis (2)
commands/Pressable_Site_Clone.php (1)
includes/functions-pressable.php (1)
  • run_pressable_site_wp_cli_command (612-623)
commands/WPCOM_Site_Clone.php (1)
includes/functions-wpcom.php (1)
  • run_wpcom_site_wp_cli_command (626-637)
🔇 Additional comments (3)
commands/Pressable_Site_Clone.php (2)

246-246: LGTM! Good practice to isolate plugin installation.

The addition of --skip-plugins --skip-themes flags ensures that other plugins and themes don't interfere during SafetyNet installation, which is a best practice for plugin installations in potentially unstable environments.


1-357: Verify search-replace command removal mentioned in AI summary.

The AI summary mentions removal of a WP-CLI search-replace command that replaced the original site URL with the clone URL, but no removed lines are visible in the current code. This could indicate an inconsistency between the summary and the actual changes.

#!/bin/bash
# Description: Search for any remaining search-replace commands in the codebase
# Expected: Should not find any search-replace commands in site cloning files

echo "Searching for search-replace commands in site cloning files..."
rg -A 3 -B 3 "search-replace" commands/Pressable_Site_Clone.php commands/WPCOM_Site_Clone.php || echo "No search-replace commands found"

echo -e "\nSearching for search-replace patterns in all command files..."
rg -A 3 -B 3 "search.replace|search_replace" commands/ || echo "No search-replace patterns found"

Likely an incorrect or invalid review comment.

commands/WPCOM_Site_Clone.php (1)

203-203: LGTM! Consistent implementation across site cloning commands.

The addition of --skip-plugins --skip-themes flags maintains consistency with the same change in commands/Pressable_Site_Clone.php and follows the same best practice of isolating plugin installation from other plugins and themes.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@mlaetitia mlaetitia changed the title Adding --skip-themes --skip-plugins to site cloning commands Adding --skip-themes --skip-plugins to safetynet install command on the site cloning Jul 23, 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.

2 participants