-
Notifications
You must be signed in to change notification settings - Fork 12
Labels
back endinfrastructureDevOps, deployments, hosting, site reliability, etc. What doesn't fit neatly into FE or BE.DevOps, deployments, hosting, site reliability, etc. What doesn't fit neatly into FE or BE.
Milestone
Description
Context
Our FastAPI backend uses a centralized Settings class (in backend/api/config.py) to manage environment variables loaded from the .env file. We also maintain a .env.example file that serves as a reference for required variables - useful for onboarding new developers and CI setup.
Currently, there’s no safeguard ensuring that new variables added to the Settings class are also reflected in .env.example. This often leads to inconsistencies where:
.env.examplemisses required variables;- CI/CD fails because expected environment variables are undefined;
We need a mechanism to enforce that every field defined in the Settings class exists in .env.example, even if with a dummy placeholder value.
Definition of Done
- Implement a validation script (e.g.,
scripts/check_env_sync.py) that:- Parses the
Settingsclass to extract all defined environment variable names. - Reads
.env.exampleand compares variable keys. - Reports any missing variables.
- Parses the
- Add this check to CI or the pre-commit hook.
Engineering Details
Settings.model_fields.keys() returns a view object containing the names of all the fields defined on a Pydantic settings model.
Metadata
Metadata
Labels
back endinfrastructureDevOps, deployments, hosting, site reliability, etc. What doesn't fit neatly into FE or BE.DevOps, deployments, hosting, site reliability, etc. What doesn't fit neatly into FE or BE.
Type
Projects
Status
Done