这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@galatanovidiu
Copy link
Contributor

Ensures that the init action has fired before initializing the adapter in WP-CLI context.

This prevents potential issues where commands might not have access to servers if the adapter initializes too early. It now hooks into the init action if it hasn't already fired.

Ensures that the `init` action has fired before initializing the adapter in WP-CLI context.

This prevents potential issues where commands might not have access to servers if the adapter initializes too early. It now hooks into the `init` action if it hasn't already fired.
Copilot AI review requested due to automatic review settings November 6, 2025 14:39
@github-actions
Copy link

github-actions bot commented Nov 6, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: galatanovidiu <ovidiu-galatan@git.wordpress.org>
Co-authored-by: JasonTheAdams <jason_the_adams@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves WP-CLI initialization timing by ensuring the init action has fired before initializing the adapter, and corrects indentation for a translator comment.

  • Adds a check using did_action('init') to handle WP-CLI initialization at the appropriate time
  • Fixes indentation of a translator comment to align with WordPress coding standards

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Simplifies the initialization process for the McpAdapter in WP-CLI context by directly hooking into the `init` action without checking if it has already fired.
@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.74%. Comparing base (db59ef5) to head (5f73743).
⚠️ Report is 1 commits behind head on trunk.

Files with missing lines Patch % Lines
includes/Core/McpAdapter.php 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##              trunk      #86   +/-   ##
=========================================
  Coverage     79.74%   79.74%           
  Complexity      858      858           
=========================================
  Files            46       46           
  Lines          3080     3080           
=========================================
  Hits           2456     2456           
  Misses          624      624           
Flag Coverage Δ
unit 79.74% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@JasonTheAdams JasonTheAdams left a comment

Choose a reason for hiding this comment

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

Good catch! LGTM! 🎉

@galatanovidiu galatanovidiu merged commit 653ca8d into trunk Nov 6, 2025
18 of 19 checks passed
@galatanovidiu galatanovidiu deleted the fix/wp-cli-init-timing branch November 6, 2025 14:56
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.

3 participants