Skip to content

wordpress/webproject: do not report failed checks as "up to date" - #1

Open
staude wants to merge 1 commit into
mahype:mainfrom
staude:fix/wordpress-error-summary
Open

staude wants to merge 1 commit into
mahype:mainfrom
staude:fix/wordpress-error-summary

Conversation

@staude

@staude staude commented Sep 4, 2026

Copy link
Copy Markdown

Problem

When wp-cli fails for a WordPress site (or a package manager fails for a web project), the checker records the error in CheckResult.Error but 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 for wp as www-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 sites
    • 3 of 4 sites up to date, check failed for 1
    • 5 updates across 4 sites, check failed for 2
  • checker/webproject: same treatment per project (kept the existing security-count wording).
  • Summary building factored into a buildSummary helper in both packages, with table-driven tests.

CheckResult.Error is unchanged, so existing consumers keep the full error text.

Tests

go vet and go test ./checker/wordpress/ ./checker/webproject/ ./checker/ ./runner/ pass (run in a golang:1.25 container).

🤖 Generated with Claude Code

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>
@staude

staude commented Sep 4, 2026

Copy link
Copy Markdown
Author

Verified on a real host (Ubuntu 24.04, 4 WordPress sites, wp-cli via run_as: www-data), binary built from this branch, run with --notify=false:

  • config with one site pointing to a non-existent path → WORDPRESS — 14 updates across 4 sites, check failed for 1, error text unchanged in the WARNING line
  • same config with release 0.23.0 → WORDPRESS — 14 updates across 4 sites (failure invisible in the summary)
  • unmodified config with this branch → WORDPRESS — 19 updates across 4 sites (no behaviour change when nothing fails)

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.

1 participant