move hardcoded API endpoints/tokens to env vars (closes #21)#23
Open
neha222222 wants to merge 1 commit into
Open
move hardcoded API endpoints/tokens to env vars (closes #21)#23neha222222 wants to merge 1 commit into
neha222222 wants to merge 1 commit into
Conversation
Closes chaoss#21. Centralize backend service URLs, tokens, and request timeout settings in backend/config.py with documented .env defaults. Add frontend API-base configuration for hosted deployments, fail fast when OSDG_TOKEN is missing, cover config behavior with unittest tests, and remove tracked generated artifacts now covered by .gitignore.
1e1a399 to
3ad1f83
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #21.
Centralizes external classifier endpoints (Aurora, OSDG) and the GitHub
API base URL in a new
backend/config.py, which reads values from envvars (loaded via python-dotenv when
backend/.envis present) and fallsback to the existing hardcoded defaults.
Changes
backend/config.py—AURORA_API_URL,OSDG_API_URL,GITHUB_API_URL,OSDG_TOKEN,GITHUB_TOKEN,HTTP_TIMEOUT_SECONDSbackend/.env.example— documents all variablesbackend/app.py,aurora_api.py,embedding_url.pyread fromconfiginstead of inline literals
backend/aurora_api.pygains a request timeout (was unset, would hangforever on stalled upstream); OSDG timeout reduced from 1000s to 30s
python-dotenvadded torequirements.txt.gitignorekeeps.env, venvs, build artifacts out of gitCompatibility
Defaults match previous hardcoded values, so existing local setups keep
working without an
.envfile. No paid services introduced.Test
py_compile).importlib.reloadtest.