Fix automatic comment moderation without provider#554
Conversation
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #554 +/- ##
=============================================
+ Coverage 71.20% 71.21% +0.01%
- Complexity 1150 1151 +1
=============================================
Files 67 67
Lines 5563 5565 +2
=============================================
+ Hits 3961 3963 +2
Misses 1602 1602
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fixed - Prevent analyzing newly inserted comments when no provider is configured. Co-authored-by: ekamran <ekamran@git.wordpress.org> Co-authored-by: dkotter <dkotter@git.wordpress.org>

What?
Prevents automatic Comment Moderation from attempting to analyze newly inserted comments when no AI provider credentials are configured.
Why?
Manual Comment Moderation actions already avoid running analysis without provider credentials. The automatic
wp_insert_commentpath did not, which could silently mark new comments with_wpai_analysis_status=failedeven though no provider was configured.How?
Testing Instructions
_wpai_analysis_status=failed.Tested locally with: