-
-
Notifications
You must be signed in to change notification settings - Fork 217
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
Stale Case Data Mail Report #35446
base: master
Are you sure you want to change the base?
Stale Case Data Mail Report #35446
Conversation
Code looks fine, though I only skimmed it. Do you know how many domains currently meet this criteria on prod? I wonder if it would be helpful to filter them, possibly by subscription, to domains that solutions is most likely to take action on. |
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 is nice. Just a couple of suggestions.
) | ||
|
||
@property | ||
def rows(self): |
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.
Using table.rows
twice will run the query twice. How about something like this?
def __init__():
self._rows = None
@property
def rows(self):
if self._rows is None:
self._rows = []
# etc.
return self._rows
@staticmethod | ||
def format_as_table(row_data, data_tables_header): |
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 is a useful function, but it is more generic than this class, and it expects its headers to be a list of DataTablesHeader instances. For those reasons, I would pull it out of here, move it somewhere under corehq/apps/reports/datatables/
, and maybe rename it. If you feel that having a method is useful, you could change this to something like:
def format_as_table(self):
return datatable_as_text(self.rows, self.headers)
(Obviously assumes that self.rows
doesn't run the query again.)
(Not applicable here because it's probably not worth an additional requirement, but useful to know about: Tablib is cool, and it can do this. (Also, I'm biased, because I wrote that bit.))
Product Description
No user-facing changes. This new report is only sent out via mail and is not included in HQ's UI.
Technical Summary
Link to ticket here.
A new periodic Celery task is created with the responsibility of sending out a email report to the
SOLUTIONS_AES_EMAIL
email address on a monthly basis. This is a simple report that contains a formatted table listing domains which have open cases that have not been modified in over a year.The goal of this report is to identify which domains could be potential candidates for auto-update rules to be implemented.
Feature Flag
None
Safety Assurance
Safety story
Automated test coverage
Unit tests exist for the new
StaleCasesTable
class and test to make sure that it retrieves the correct data and formats it appropriately.QA Plan
No QA planned.
Rollback instructions
Labels & Review