Closed Stephen-ONeil closed 1 year ago
Coverage Report
File Stmts Miss Cover Missing phac_aspc/django excel.py 148 28 81% 17–18, 49, 71, 81, 85, 119–121, 125–129, 132–133, 162, 170, 187–188, 214, 217, 219, 221, 224, 230, 236, 255–256, 263–264 fields.py 79 16 80% 46, 67–80, 102–105, 120–125, 128–132 phac_aspc/django/admin/decorators admin_decorators.py 18 2 89% 37–38 phac_aspc/django/helpers/auth backend.py 28 28 0% 2–36 views.py 44 27 39% 22, 27–30, 35–43, 48–100 phac_aspc/django/helpers/locale code.py 8 3 62% 10, 13–14 phac_aspc/django/helpers/logging configure_logging.py 29 1 97% 187 json_post_handlers.py 27 3 89% 8–9, 61 utils.py 11 2 82% 43, 48 phac_aspc/django/helpers/templatetags phac_aspc_auth.py 7 1 86% 14 phac_aspc_localization.py 11 4 64% 11, 26–29 phac_aspc/django/helpers/views wet.py 10 6 40% 12–19 phac_aspc/django/localization hooks.py 6 6 0% 2–16 phac_aspc/django/localization/decorators __init__.py 2 2 0% 4–6 localization_decorators.py 11 11 0% 4–46 phac_aspc/django/settings logging.py 18 7 61% 28–36, 46–50 security.py 21 9 57% 34–45 phac_aspc/django/settings/utils configure_settings_for_tests.py 3 2 33% 15–19 TOTAL 676 158 77%
Tests | Skipped | Failures | Errors | Time |
---|---|---|---|---|
33 | 0 :zzz: | 0 :x: | 0 :fire: | 2.664s :stopwatch: |
I plan to write a few more tests still, just for extra solid coverage, but otherwise this is all ready for review.
Will have an impact on down-stream consumers once released, since the default logging configuration is currently part of the from phac_aspc.django.settings import *
pattern, and will require one or two PHAC_ASPC_...
env vars depending on a given project's environment. Either I fiddle with that pattern to make it opt-in, or we make this a managed roll-out and walk all of our devs through the new logging feature.
I was also curious, @lucbelliveau, do we have a way to deploy release candidate tagged versions of the package? Could be worth doing that before this merges, because it'd be good to do a pilot test in an Azure Cloud app before this goes wide-release. I believe it's ready, but can't test in Azure myself.
@Dhanani I've tagged you as a reviewer specifically for the small Azure logging handler component. Still think we should meet to get on the same page about logging too!
I think this looks good, we'll want to be careful not to interrupt itap with this type of work when merging, the logging seems a bit fragile right now. At the very least I need to get a release out before we merge this
Agreed that it shouldn't be rushed in. I do need at least one project to test the Azure logging capability out since I don't have a playground of my own there. I'll probably revisit putting the whole thing behind an env var flag, disabled by default at least for now.
@Stephen-ONeil there is no way to deploy RCs to pypi at the moment - but you could try something like this:
pip install git+https://github.com/PHACDataHub/django-phac_aspc-helpers.git@logging-helpers
@Stephen-ONeil For sure! I'm free this Thursday if you want to setup a meeting :)
Coverage Report
File Stmts Miss Cover Missing phac_aspc/django excel.py 148 28 81% 17–18, 49, 71, 81, 85, 119–121, 125–129, 132–133, 162, 170, 187–188, 214, 217, 219, 221, 224, 230, 236, 255–256, 263–264 fields.py 79 16 80% 46, 67–80, 102–105, 120–125, 128–132 phac_aspc/django/admin/decorators admin_decorators.py 18 2 89% 37–38 phac_aspc/django/helpers jinja_dtl_interop_utils.py 7 1 86% 21 phac_aspc/django/helpers/auth backend.py 28 28 0% 2–36 views.py 44 27 39% 22, 27–30, 35–43, 48–100 phac_aspc/django/helpers/locale code.py 8 3 62% 10, 13–14 phac_aspc/django/helpers/logging configure_logging.py 29 1 97% 187 json_post_handlers.py 27 3 89% 8–9, 61 utils.py 11 2 82% 43, 48 phac_aspc/django/helpers/templatetags phac_aspc_auth.py 7 1 86% 14 phac_aspc_localization.py 11 4 64% 11, 26–29 phac_aspc/django/helpers/views wet.py 10 6 40% 12–19 phac_aspc/django/localization hooks.py 6 6 0% 2–16 phac_aspc/django/localization/decorators __init__.py 2 2 0% 4–6 localization_decorators.py 11 11 0% 4–46 phac_aspc/django/settings logging.py 18 7 61% 28–36, 46–50 security.py 21 9 57% 34–45 phac_aspc/django/settings/utils configure_settings_for_tests.py 3 2 33% 15–19 TOTAL 703 159 77%
Tests | Skipped | Failures | Errors | Time |
---|---|---|---|---|
37 | 0 :zzz: | 0 :x: | 0 :fire: | 2.824s :stopwatch: |
Oop, that last second merge from main bumped the linter version on this branch and added a new lint error. I'll hotfix that over on main.
Closes #22
TODO:
logging_utils.py
in to multiple modulesconfigure_uniform_std_lib_and_structlog_logging
functionhandlers
andformatters
configs; some default set but consumers can override/import and configure the handlers and formatters provided by the helpers repo as neededsetup.cfg
or if they should be optional likeopenpyxl
.env
file or be declared insettings.py