feat(alertd): grade and apply the reporting schema canopy offers - #868
dannash100 wants to merge 21 commits into
Conversation
|
🦸 Review Hero Summary Below consensus threshold (7 unique issues not confirmed by majority)
Nitpicks
Local fix prompt (copy to your coding agent) |
|
🦸 Review Hero Summary Below consensus threshold (7 unique issues not confirmed by majority)
Local fix prompt (copy to your coding agent) |
|
🦸 Review Hero Summary Below consensus threshold (2 unique issues not confirmed by majority)
Nitpicks
Local fix prompt (copy to your coding agent) |
|
🦸 Review Hero Summary Below consensus threshold (11 unique issues not confirmed by majority)
Nitpicks
Local fix prompt (copy to your coding agent) |
…-apply # Conflicts: # crates/alertd/Cargo.toml # crates/alertd/src/doctor/checks.rs
| Applying the offered schema is the check's self-heal action, so it runs only in the long-running daemon and only while the check is failing. | ||
| Applying is the only thing bestool does that writes to Tamanu's database: every check stays read-only, and the interactive doctor command never applies anything. | ||
|
|
||
| The schema's own SQL replaces the schema wholesale, so applying it needs no additional reconciliation. |
There was a problem hiding this comment.
To apply a new reporting schema, the old one is dropped first. Either this can be fully done within a migration, so it's safe, or it can't, and every self heal has the potential to not only not upgrade the schema, but also to break it permanently. Either way, that needs documenting, and also maybe reconsidering the concept of a healthcheck effectively performing upgrades.
|
🤖 Follow-up, not in this PR: |
Canopy has read and displayed
reportingSchemaVersionfor a while, and nothing produced it. This produces it, and grades the server against the schema canopy offers its group.reporting_schemacheck: read the version the schema stamped on itself, ask canopy what it offers for the version this server runs, fail when they differ.🦸 Review Hero