-
Notifications
You must be signed in to change notification settings - Fork 141
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
(Work-in-progress) Update config file reading and validation #1694
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1694 +/- ##
==========================================
+ Coverage 79.69% 84.32% +4.62%
==========================================
Files 31 40 +9
Lines 4324 4574 +250
Branches 780 800 +20
==========================================
+ Hits 3446 3857 +411
+ Misses 721 533 -188
- Partials 157 184 +27 ☔ View full report in Codecov by Sentry. |
e891a9a
to
1c833a2
Compare
This replaces the implementation for custom configparser option references in the diff-file option. Moves detection and handling for the custom syntax into a dedicated submodule. Uses a regular expression to preserve text before and after the reference.
Restore original behavior where a diff file is only written if the 'mirror.diff-file' config option is set to a non-empty value.
Change the Storage base class and the storage plugin loading functions to require a ConfigParser instance so the BandersnatchConfig singleton is not accessed. Change the BandersnatchMirror class to require a Storage instance instead of a storage backend name since the mirror subcommand already loads a storage plugin instance. The diff in the application code is relatively simple, but both changes caused cascading/rippling updates to the unit tests that will require a regrettable amount of tedious review. It would be nice to find a way to split up this commit.
Change the Filter base class and filter loader to require an external ConfigParser instance be passed in. Change the Mirror/BandersnatchMirror classes to require an external instance of LoadedFilters. op/ed: Remember all that nonsense you told yourself about removing a singleton making the tests simpler? Well so far that is not the case.
64112eb
to
9e6244f
Compare
...ran head-first into a good reason why
...these changes are getting large enough that I wonder if I need a rethink here. |
Goals
mirror
section into a type-annotated classSetConfigValues
named tuplevalidate_config_values
and some in themirror
subcommand itself, we can move these into a single placeIn Progress
MirrorConfig
attrs classConfigParser
instanceCompleted