Open k-allagbe opened 1 year ago
How I envision it:
a declarative solution with an env.yml that:
contains the list of environment variables to be validated
I would be astonished if this functionality didn't already exist as an opensource python library somewhere so some research is in order.
The closest tool i could find is datamodel_code_generator. But it is a command line tool. I could try and create our own tool for this, based on Pydantic.
@k-allagbe please outline a bit more of how it would look like with Pydantic
@rngadam https://github.com/ai-cfia/membrane-backend/commit/adc44102ceb7c3017202c56b4185755f003611b4 A drawback is that the yaml file would follow Pydantic's constraints naming. It would not be language agnostic.
@k-allagbe best that you can a Draft PR so I can start commenting on it early.
are we also able to integrate text description for each field and links to references for the doc? and generate configuration documentation from the env.yaml?
@rngadam https://github.com/ai-cfia/membrane-backend/pull/78 There is a description field available for that indeed. It would look like this:
MEMBRANE_FRONTEND:
type: str
field_info:
default: http://localhost:3000
description: <desc>
ok, but my concern is we decided to both document 1) a description of the field and 2) a link to the dependency documentation. are we able to integrate both here with a single description field?
Description
The goal is to standardize the way we validate environment variables and configurations.
We need to implement a solution that performs this validation for all critical environment variables, checking aspects such as type, format (e.g., regex for URLs, email addresses), presence of required variables, etc.
Acceptance Criteria
Notes