mozilla-services / python-dockerflow

A Python package to implement tools and helpers for Mozilla Dockerflow
https://python-dockerflow.readthedocs.io
Mozilla Public License 2.0
38 stars 21 forks source link

Centralize check registration / running logic #85

Closed grahamalama closed 8 months ago

grahamalama commented 1 year ago

This PR adds to the dockerflow.checks package to provide the ability to register checks, run registered checks (both synchronously and asynchronously), and return the results of the checks in a standardized manner.

Since Django already has the concept of a check registry, we just run the checks there (but with our check runner). For other frameworks, we use the new registry in dockerflow.checks.registry.

Still todo is ~add tests for the check running functions~ (to make assertions about the shape of the data they return) and update documentation. But I'm open to review in this PR's current state.

codecov-commenter commented 1 year ago

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (a7cad34) 97.84% compared to head (880630f) 98.23%.

Files Patch % Lines
src/dockerflow/checks/registry.py 96.29% 1 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #85 +/- ## ========================================== + Coverage 97.84% 98.23% +0.39% ========================================== Files 18 19 +1 Lines 602 624 +22 Branches 88 85 -3 ========================================== + Hits 589 613 +24 + Misses 9 7 -2 Partials 4 4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

leplatrem commented 11 months ago

@grahamalama shall we resume this work?

leplatrem commented 8 months ago

@grahamalama r?

grahamalama commented 8 months ago

Nice @leplatrem, thanks for taking this over and finishing it 🙌🏻

But oh no, I can't actually approve this PR because I was an author on some of the commits 😱.

You could pull another reviewer in, or you can consider this my approval and bypass branch protections.