auto-archiver icon indicating copy to clipboard operation
auto-archiver copied to clipboard

improve config parsing to accommodate type casting and validation rules

Open msramalho opened this issue 1 year ago • 1 comments

As it stands the logic to handle the configs() method of each Step (like Archivers, Enrichers, ...) does not cast int/float/bool and uses only strings. Likewise it's proven quite useful to specify validation rules in the configs rather than relying on the init method of each Step to do so.

This issue is on adding both of those configuration parsing mechanisms and refactoring existing Steps that are doing internal casting/validation.

msramalho avatar Feb 14 '24 20:02 msramalho

this still remains a good coding challenge that would make developing new features smoother.

msramalho avatar Apr 16 '24 11:04 msramalho

This should be fixed by the latest changes to the auto-archiver architecture.

By setting the type for a config value in a module's __manifest__.py file, you can a) force validation and b) force casting to that type.

An example of this can be seen here

Currently, valid options are all python internal types (str, int, list etc) as well as any validators in the validators.py file

pjrobertson avatar Feb 04 '25 17:02 pjrobertson