Skip to content

Perun Config should perform validity checks for values #302

@JiriPavela

Description

@JiriPavela

Currently, the runtime, local and shared config performs no validity checks when setting or appending values. Instead, those checks are delegated to the code that uses Config, which scatters the validation code across the entire codebase.

We should make the config module a bit more robust:

  • It should explicitly list all the keys that are allowed and recognized within a configuration file.
  • Moreover, for each key, it should be explicitly specified whether that key supports scalar or list values.
  • It should also explicitly specify the validation logic for the value(s) of each key, e.g., a list of allowed values, validation callable, etc.

This will arguably lead to a less flexible usage of configuration, however, it will be easier to maintain and safer to use (reporting invalid keys, invalid types of values, invalid values).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions