Skip to content

Investigate a way to allow passing boolean values to the configuration #55

@avivace

Description

@avivace

Because of the current architecture around invenio.cfg and how we load user configuration form the environment, the current way to set a configuration boolean value to false is to set the correspondent environment variable to the python boolean literal "False". I.e., the only way to make a variable read from the environment evaluate to False is to assign it the False string.

This causes problems when such configuration is pushed from a proper serialized format (instead of a python file) such as yaml in helm charts which accept "false" and "False" as boolean falses (but do not cast them back and the lowercase version is more common).

See also: inveniosoftware/helm-invenio#53 inveniosoftware/helm-invenio#54 , where we implemented a workaround on the helm charts to set boolean values to environment and have them correctly parsed as python literals.

A further discussion is needed here to understand if we should:

  • switch to a more standard data format to serialize/de-serialize configuration values
  • make invenio-config fuzzy match boolean literals
  • ...

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