Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactors audit notification to mail, adds test, adds alerts check to scheduler #16251

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

Godmartinz
Copy link
Collaborator

@Godmartinz Godmartinz commented Feb 13, 2025

This adds an alerts_enabled check around the following scheduled daily alerts:

  • inventory-alerts
  • expiring-alerts
  • expected-checkin
  • upcoming-audits

This also refactors the Audit notification to use mailable.
A test has been added for this that checks

  • due for audit
  • overdue for audit
  • not due yet

Fixes: #16221
image

@Godmartinz Godmartinz requested a review from snipe as a code owner February 13, 2025 19:21
@Godmartinz Godmartinz changed the title refactors audit notification to mail, adds test, ads check to scheduler refactors audit notification to mail, adds test, adds alerts check to scheduler Feb 13, 2025
Copy link

what-the-diff bot commented Feb 13, 2025

PR Summary

  • Revamp of the Audit Report Notification Process:
    This PR primarily reconfigures how the system sends notifications about upcoming audits. Instead of the past notification system, the system will now utilize the SendUpcomingAuditMail to send out email notifications. This change not only simplifies the process by cutting out the AlertRecipient and accompanying notification use but also includes a check to verify if any assets are due for an audit before sending out an email.

  • Refinement of Kernel Scheduling:
    The PR modifies the logic behind kernel scheduling to ensure that the audit update command only functions when alerts are activated in the app settings. This change makes sure not to waste system resources on unnecessary tasks.

  • Introduction of New Mailable Class:
    The creation of the SendUpcomingAuditMail class is meant to handle the configuration and content of the email informed of upcoming audits. This new class helps maintain order and clarity for system-generated emails.

  • Improvement to Feature Tests:
    The PR builds upon the ExpiringAlertsNotificationTest with a new evaluation for the SendUpcomingAuditMail. This test confirms that emails about upcoming and overdue auditable assets are sent correctly, thereby aiding in ensuring the accuracy and reliability of the system.

  • Addition to Settings Helper:
    The inclusion of the setAuditWarningDays method in the Settings support class aids in altering audit warning durations. This addition makes the management of warning limits much more adaptable.

@Godmartinz Godmartinz requested review from marcusmoore and snipe and removed request for snipe February 13, 2025 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant