refactor(alertd): retire the YAML alert engine and standalone CLI#441
Open
passcod wants to merge 2 commits into
Open
refactor(alertd): retire the YAML alert engine and standalone CLI#441passcod wants to merge 2 commits into
passcod wants to merge 2 commits into
Conversation
The YAML alert command, its definition/template/target parsing, the PostgreSQL-to-JSON helper it relied on, and its trycmd fixtures (plus the now-orphaned Postgres test fixture) are removed. The alerts engine is being retired in favour of the doctor healthcheck sweep. Co-authored-by: Claude <noreply@anthropic.com>
Removes the YAML alert subsystem from bestool-alertd, leaving a thin daemon that runs background tasks (the doctor sweep) on a schedule, posts to canopy, and serves task/status/health/metrics over HTTP. Canopy now owns alerting; the daemon no longer loads YAML alerts or sends email/Slack. Removed: the standalone binary (main.rs, the [[bin]], the cli feature), alert.rs, loader.rs, glob_resolver.rs, events.rs, targets, templates.rs, state_file.rs, scheduler.rs, commands, the alert HTTP endpoints, and the now-unused deps. InternalContext moves to a slim context.rs; DaemonConfig drops alert_globs, email, server_kind, and dry_run. The Windows service is kept and now runs the daemon via run_with_shutdown. bestool tamanu alertd loses the status/reload/loaded-alerts/pause/validate passthroughs and the alert-dir/email/server-kind plumbing; it always registers the doctor sweep. The obsolete release-alertd workflow is removed. Co-authored-by: Claude <noreply@anthropic.com>
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.
🤖 Phase 3 of consolidating monitoring (TODO #10, plan in
docs/plans/healthchecks-into-alertd.md). Stacked on #440.With the YAML alerts now covered by healthchecks (#440) and canopy owning alerting, this retires the YAML alert engine and the standalone CLI, leaving
bestool-alertdas a thin daemon that runs background tasks (the doctor sweep) on a schedule, posts to canopy, and serves task/status/health/metrics HTTP endpoints.Removed from
bestool-alertd: the alert engine (alert,loader,glob_resolver,events,targets,templates,state_file,scheduler), the daemon-controlcommands, and the standalone binary (main.rs, the[[bin]], theclifeature) plus its generated usage docs and theALERTS.md/TARGETS.mdformat docs.daemon.rsdrops file-watching, glob re-resolution, state persistence, the DB-down alert event (DB health is covered by thedb_connect/db_versionchecks now), and all reload paths — it keeps the canopy client + cert renewal, background-task scheduling, the HTTP server, shutdown handling, and the watchdog.DaemonConfigloses its alert-only fields;http_serverkeeps/,/status,/health,/metrics,/tasks/*.InternalContextmoved to a slimcontext.rs. A pile of now-unused deps (serde_yaml, tera, mailgun-rs, notify, walkdir, glob, blake3, clap, …) are dropped.bestool tamanu alertdkeepsrunand the Windows service subcommands (the daemon still runs as a Windows service to perform the sweep on Windows hosts —windows_service.rsis retained) and drops the alert-management subcommands and YAML-dir/email/server-kind config. The legacybestool tamanu alertscommand and its fixtures are removed, along with the now-deadrelease-alertd.ymlworkflow that built the deleted binary.bestool tamanu doctoris unchanged for users — it still fetches/tasks/doctor/latestand/tasks/doctor/recomputefrom the daemon.Verified: workspace build + clippy + fmt clean, alertd/bestool tests pass against the local central DB, and the Windows GNU cross-build is clean (the service code compiles against the trimmed
DaemonConfig).A follow-up phase reviews triggering thresholds across all checks (migrated land at FAIL).