fix(notifications): preserve technical acronyms in alert labels

Merged
IZ
13d ago
+40-36

Uses uppercase URL, HTTP, ID, SSL, and API consistently in alert field labels.

Slice

  • Maintainer-led promotion of work already on staging. Ultimate target: main.
  • Scope: notification-copy.
  • Dependencies: none.
  • Overlap: #991 also changes alert-provider files; #988 owns typed trigger conditions.

Validation

  • Final branch: locked dependency install, bun run lint, bun run check-types, and bun run test passed.

Created and organized with OpenAI Codex assistance. Draft for reviewer verification; no merge or publication performed.


Summary by cubic

Normalizes alert field labels so technical acronyms render consistently in uppercase. Slack and Discord previously showed "Dashboard url" and "Http code"; email output now matches.

  • Moves formatMetadataLabel and isUserFacingMetadata into payload-utils.ts so all providers share the same label formatting and metadata visibility rules.
  • Uppercases api, http, id, ssl, and url in generated labels, with email tests covering the new labels in plain text and HTML.
  • Updates error fallback copy in Slack, Discord, and webhook providers from "Unable to read response" to "Failed to read response".

Summary by CodeRabbit

  • Bug Fixes
    • Notification metadata labels now use consistent title casing, with acronyms such as API, HTTP, SSL, and URL displayed in uppercase.
    • Discord, Slack, and webhook error messages now say “Failed to read response” when response details can’t be retrieved.
    • Email notifications include HTTP code, SSL expiry, and API endpoint labels in both plain-text and HTML formats.