refactor!: rename template field body_html to email_body_html (v1.2.0 breaking)#29
Merged
fxthiry merged 1 commit intorelease/1.2.0from Apr 15, 2026
Merged
Conversation
Only the email notifier consumes this field. Telegram, Mattermost, and webhook have always ignored it. The old name suggested a generic HTML output slot, which directly misled at least one user into putting Telegram content in body_html and leaving body empty (issue #26). Breaking change: configs using `body_html:` are rejected at load with serde's "unknown field" error, which lists `email_body_html` among the expected fields. Migration is a one-liner per template and applies equally to inline templates and split `templates.d/` files. No behavior change elsewhere. Email fallback preserved exactly: `email_body_html.or(body)`. The runtime semantics are identical after the rename — only the field identifier changed, at every call site. CHANGELOG entry added for v1.2.0 bundling this breaking change with the previously merged fixes for #25 (dotted fields) and #26 (empty telegram guard + honest example).
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.
Summary
Breaking rename of the template output field
body_html→email_body_html. Only the email notifier has ever consumed this field; the old name suggested a generic HTML slot that directly misled the user in #26. Renaming removes the ambiguity.Bundled with the fixes for #25 and #26 (already merged into
release/1.2.0) to ship as v1.2.0.Breaking change
Configs using
body_html:are rejected at load. Thanks to the pre-existing#[serde(deny_unknown_fields)]onTemplateConfig, serde produces an actionable error:The expected-fields list names
email_body_htmldirectly, sovalerter --validatepoints users at the migration on the first run. The migration applies equally to inline templates and splittemplates.d/files.No alias, no custom deserializer — the rename is intentionally nondeniable per project memory "no backward-compat shims when you can just change the code".
Semantic preservation
Email fallback unchanged:
email_body_html.or(body). Telegram / Mattermost / webhook continue to ignore the field (behavior identical — it was always ignored, just less obvious).Test plan
cargo test --lib— 444 passed (baseline 443 + 1 new regression test)cargo testfull suite — 498 passed, 22 ignored (SMTP MailHog + doctests)cargo clippy --all-targets --all-features -- -D warnings— cleancargo run --bin valerter -- --validate -c config/config.example.yaml— exit 0body_html:rejected with error mentioning bothbody_htmlandemail_body_htmlrelease/1.2.0rc build (reporter validation)Review hints
Spec + suggested review order:
_bmad-output/implementation-artifacts/spec-rename-body-html-to-email-body-html.md(local, not in VCS).Key entry points:
src/config/types.rs:156—TemplateConfigfield renamesrc/template.rs:38—RenderedMessagefield renamesrc/notify/email.rs:409— consumer logic (preserved semantics)src/config/tests.rs:750— new regression test for breaking rejectionCHANGELOG.md:8— v1.2.0 entryThree adversarial reviewers ran on the diff. One raised five false-positive findings that did not reproduce (fixture existence,
deny_unknown_fieldspresence, test behavior — all verified green locally). Legitimate findings patched in the same PR: fixture file added to index, CHANGELOGUnreleased/[1.2.0]duplication resolved,docs/architecture.md:160double-email heading fixed, CHANGELOG migration note now explicitly mentionstemplates.d/. Deferred items logged indeferred-work.md.