Conversation
When wp-cli (or a package manager) fails for a site, the checker stored the error in CheckResult.Error but still summarised the run as "all sites are up to date". Dashboards such as Update Wall show the summary prominently and the error only in a detail field, so broken checks went unnoticed for months (e.g. "sudo: a password is required" on every run). Track which sites/projects failed and say so in the summary: - "check failed for all N sites" - "K of N sites up to date, check failed for M" - "X updates across N sites, check failed for M" Same for the webproject checker. Summary building is factored into a tested helper. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Author
|
Verified on a real host (Ubuntu 24.04, 4 WordPress sites, wp-cli via
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When
wp-clifails for a WordPress site (or a package manager fails for a web project), the checker records the error inCheckResult.Errorbut still sets the summary to "all sites are up to date". Notifiers and dashboards (Update Wall, Slack summaries) show the summary prominently and the error only as a secondary field — so a broken check looks like a healthy one.Real-world example: on two of our servers the WordPress watcher failed on every run with
sudo: a password is required(missing sudoers rule forwpaswww-data), and for months the dashboard reported both sites as up to date.Change
checker/wordpress: track which sites failed and reflect that in the summary:check failed for all 4 sites3 of 4 sites up to date, check failed for 15 updates across 4 sites, check failed for 2checker/webproject: same treatment per project (kept the existing security-count wording).buildSummaryhelper in both packages, with table-driven tests.CheckResult.Erroris unchanged, so existing consumers keep the full error text.Tests
go vetandgo test ./checker/wordpress/ ./checker/webproject/ ./checker/ ./runner/pass (run in agolang:1.25container).🤖 Generated with Claude Code