ProjectTech4DevAI / ProjectTech4DevAI/kaapi-guardrails

Remove redundant ways to load environment variables

Open
#60 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
5
Forks
3
Avg merge
9d 13h
Merged PRs (30d)
2

Description

Which feature or component needs enhancement?
The way we manage environment variables in the project

Describe the current behavior
We seem to have two redundant approaches to loading environment variables from the *.env files.

https://github.com/ProjectTech4DevAI/kaapi-guardrails/blob/1d62fc24821ca6e7b5c7d8aeb473fc9052787a4d/backend/app/core/config.py#L94
and
https://github.com/ProjectTech4DevAI/kaapi-guardrails/blob/1d62fc24821ca6e7b5c7d8aeb473fc9052787a4d/backend/app/load_env.py#L5

Describe the enhancement you'd like
The settings variable exposed in config.py seems to be the one we are relying heavily on throughout the codebase. So we can remove the load_env.py and all calling code referencing that file.

Why is this enhancement needed?
This will prevent confusing overrides of environment variables due to the two approaches interacting in unexpected manner.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing backend/app/core/config.py around the settings definition with backend/app/load_env.py, then search the repository for references to load_env.py. Remove the redundant loader and its calling code while retaining the config.py settings path. Done means no remaining references to load_env.py and environment variables use the single intended approach.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.