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

Auditor always includes the last copy of the report, even if it doesn't correspond to the latest run #54

Open
jacobdadams opened this issue Mar 1, 2021 · 1 comment
Labels
bug Something isn't working enhancement New feature or request
Milestone

Comments

@jacobdadams
Copy link
Member

Via supervisor, auditor includes credentials.REPORT_BASE_PATH as an attachment in the email. However, this file won't be updated if there is an error that causes the checks/fixes to bomb out before they're finished. Thus, an error email will have an out-of-date report that causes confusion when troubleshooting.

One solution is to atomize the report writing so that auditor writes to the report for every item instead of after everything is finished (see TODO before def log_report()).

@jacobdadams jacobdadams added bug Something isn't working enhancement New feature or request labels Mar 1, 2021
@jacobdadams jacobdadams added this to the 3.0 milestone Mar 1, 2021
@jacobdadams
Copy link
Member Author

One cause of this may be when the AGOL connection times out before completing all the fixes, and when it goes to write the log report dictionary it doesn't have all the expected keys so it fails:

#: ...

Exception: Invalid token.
(Error Code: 498)

During handling of the above exception, another exception occurred:

#: ...

  File "c:\dev\auditor\src\auditor\auditor.py", line 79, in log_report
    item_list.extend([str(item_report_dict[col]) for col in columns])

  File "c:\dev\auditor\src\auditor\auditor.py", line 79, in <listcomp>
    item_list.extend([str(item_report_dict[col]) for col in columns])

KeyError: 'metadata_result'

We could either pre-populate the keys with empty data or make log_report() more robust.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant