Skip to content

improvement(pki): add daily expiration alert#5552

Merged
saifsmailbox98 merged 12 commits intomainfrom
saif/eng-4580-enable-daily-alerts-for-certificate-alerts-after-threshold
Mar 2, 2026
Merged

improvement(pki): add daily expiration alert#5552
saifsmailbox98 merged 12 commits intomainfrom
saif/eng-4580-enable-daily-alerts-for-certificate-alerts-after-threshold

Conversation

@saifsmailbox98
Copy link
Contributor

@saifsmailbox98 saifsmailbox98 commented Feb 27, 2026

Context

Add a daily alert toggle to PKI expiration so that daily notifications are sent from the threshold to expiry

Screenshots

Please check the docs for the screenshot

Steps to verify the change

Type

  • Fix
  • Feature
  • Improvement
  • Breaking
  • Docs
  • Chore

Checklist

  • Title follows the conventional commit format: type(scope): short description (scope is optional, e.g., fix: prevent crash on sync or fix(api): handle null response).
  • Tested locally
  • Updated docs (if needed)
  • Read the contributing guide

@linear
Copy link

linear bot commented Feb 27, 2026

@maidul98
Copy link
Collaborator

maidul98 commented Feb 27, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 27, 2026

Greptile Summary

This PR adds a daily notification toggle to PKI expiration alerts, allowing users to receive daily reminders from the alert threshold until certificate expiry, rather than a single notification.

Key Changes:

  • Added notificationConfig JSONB column to pki_alerts_v2 table with proper idempotent migration
  • When daily notifications are enabled, the deduplication window is set to 24 hours, ensuring alerts fire daily within the threshold period
  • Frontend includes a "Daily Alerts" toggle switch in the alert creation form with clear user-facing description
  • Documentation updated to explain the feature behavior
  • No breaking API changes - field is optional and nullable, maintaining backward compatibility

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation is clean, well-tested, and follows best practices. The migration is properly idempotent, the database schema change is non-breaking (nullable field), all type definitions are consistent across backend and frontend, and documentation has been updated. No security issues were identified.
  • No files require special attention

Important Files Changed

Filename Overview
backend/src/db/migrations/20260227120000_add-notification-config-to-pki-alerts-v2.ts Adds notificationConfig column to PKI alerts table; properly idempotent with table and column existence checks
backend/src/services/pki-alert-v2/pki-alert-v2-types.ts Adds NotificationConfigSchema with enableDailyNotification boolean field; properly integrated into alert types
backend/src/services/pki-alert-v2/pki-alert-v2-queue.ts Updates deduplication window logic: uses 24-hour window when daily notifications enabled, preserving existing behavior otherwise
frontend/src/views/PkiAlertsV2Page/components/CreatePkiAlertV2FormSteps.tsx Adds Daily Alerts toggle UI (lines 394-416) for expiration alerts with clear description of functionality

Last reviewed commit: f220064

@saifsmailbox98 saifsmailbox98 merged commit 100ff8b into main Mar 2, 2026
14 checks passed
zeekay pushed a commit to hanzoai/kms that referenced this pull request Mar 4, 2026
* Add support for daily notification in PKI Alert

* Add docs

* Rename migration file

* Move label element wrapping to span in CreatePkiAlertV2FormSteps and reorder notificationConfig in PkiAlertsV2 schema

* Run prettier

* refactor: use TNotificationConfig type in evaluateAlert instead of unknown

* refactor: use NotificationConfigSchema in router response schemas

* refactor: simplify notificationConfig serialization in DAL updateById

* fix: only show Daily Alerts field for expiration alerts in view modal

* update: replace alert-create-modal image in docs

* docs: update daily alerts description and add warning for external renewals

* docs: simplify daily alerts warning message
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.

3 participants