-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add email notifications for validation violations #302
Conversation
7f7489e
to
1494b5b
Compare
aa29263
to
6adf5f2
Compare
|
||
logger = logging.getLogger(__name__) | ||
logger = logging.getLogger("kadi") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes the logger use the same output format as the rest.
@@ -68,15 +205,22 @@ def main(args=None): | |||
maude.conf.cache_msid_queries = True | |||
fetch.CACHE = True | |||
|
|||
if opt.in_work: | |||
conf.include_in_work_command_events = True | |||
kadi.commands.conf.include_in_work_command_events = opt.in_work |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the unlikely event that a user has set the configuration in a file, the code now overrides that. I.e. the command line option wins.
opt : argparse.Namespace | ||
Command-line options | ||
""" | ||
from acdc.common import send_mail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
acdc is presently a non-fsds package. One of the reasons we let it go there was the idea that this acdc.common send mail import was also only used by other non-fsds packages. So I see this new import in kadi validation as suggesting one of several paths:
- Follow through and copy/move this send_mail into something like ska_helpers
- Put acdc back into ska3-flight
- Put this kadi validation and trending into a separate non-fsds package instead of kadi proper
- Leave it like this and leave acdc in non-fsds packages but realize the validation reporting then depends on a package outside of flight (practically, the validation is likely going to be run from HEAD ska3/flight which will have acdc installed).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Let's go with 4 right now. Tests should still pass without acdc installed. I have been bothered by having this utility living in acdc so this will get fixed in a reasonable time scale.
action="append", | ||
dest="emails", | ||
default=[], | ||
help='Email address for notification (multiple allowed, use "TEST" for testing)', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I don't know if it is useful to document in here that this TEST thing is a feature of acdc.common.send_mail where it just logs the output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be documented when that function gets a new home in ska_helpers.
Though I should have asked before I approved -- why does this need ska_helpers 0.13.0? |
I think it was the coerce_types thingy. |
Makes sense but is in 0.12.0 (0.13.0 just has a test update so I was trying to figure out if if you were calling out a different package or different release). |
Description
This PR adds email notification to
aca@cfa.harvard.edu
for violations.As part of this I did some refactoring to use smaller, more separable, processing functions. The first step was moving the mail validation script processing function from
validate.py
(implements validator functionality) tovalidate_states.py
(does the processing to produce a report page).Closes #271
Required dependencies
This requires:
Interface impacts
Email alert notification for any kadi command states validation violations.
Testing
Unit tests
Independent check of unit tests by [REVIEWER NAME]
Functional tests
On kady in ska3 2023.7, with the two git directories checked out at master corresponding to the versions shown above. The off_nom_roll violations are found because this processing does not include the improvements to ska_sun and chandra_aca.planets.
Output: https://icxc.cfa.harvard.edu/aspect/test_review_outputs/kadi/pr302/
Email: