Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements a comprehensive configuration management system using YAML files and environment variables to replace the previous ad-hoc configuration approach. The new system provides a hierarchical configuration priority (env > config.yaml > defaults) and improves security by separating secrets from non-secret configuration.
Key changes:
- Replaces hardcoded settings with a flexible Config class that merges environment variables, YAML files, and defaults
- Removes deprecated apps (analytics, recommendations) and their URL patterns
- Consolidates dependency management by removing unused packages (Celery, Pipeline, etc.)
Reviewed Changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| website/config.py | New configuration management class with deep merging and type casting |
| website/settings.py | Restructured to use new Config class with clear separation of managed vs framework settings |
| website/development.yaml | Removed - replaced by config.yaml.example |
| website/init.py | Removed Celery imports |
| website/urls.py | Removed analytics and recommendations URL patterns |
| apps/auth/views.py | Updated to use new AUTH settings structure |
| apps/auth/utils.py | Refactored survey utility functions to use new QUEST settings |
| .env.example | Updated format using PARENT__CHILD notation for nested settings |
| config.yaml.example | New YAML configuration template |
| docs/config.md | Comprehensive documentation for the new configuration system |
| pyproject.toml | Removed unused dependencies |
| lib/constants.py | Removed environment variable dependency |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
Config
Use YAML and environment variables for robust and secure configuration. All the customizable fields can be specified in
config.yamland environment variables (or.envfile at local dev).TL;DR
.env.examplefile to.env, fill in:SECRET_KEYTURNSTILE_SECRET_KEYQUEST__SIGNUP__API_KEYQUEST__LOGIN__API_KEYQUEST__RESET__API_KEYDATABASE__URLandREDIS__URLconfig.yaml.exampletoconfig.yaml, fill in:DEBUG:trueif at dev,falseif in productionURLandQUESTIONIDin all actions inQUESTALLOWED_HOSTS, frontend domains inCORS_ALLOWED_ORIGINSPriority
env >
config.yaml> default configEvery field (including nested ones) can be specified anywhere (i.e. env,
config.yaml, none/default), and config will be loaded with each field following the above priority order.Environment Variables
.envfile for local development. Directly export environment variables at production..env.examplefile to.envand fill in the secrets for local development..envshould NOT be committed (already git ignored).PARENT__CHILDformat to override nested settings.__means parental relationship.,as delimiter for lists.YAML
config.yamlis used to set custom but not secret configs (e.g. frontend and backend URLs, questionnaire ID)config.yaml.examplefile toconfig.yamland fill in the required fields.config.yamlshould NOT be committed (already git ignored).Default Config
settings.pyshould NOT be modified by non-developers.Noneare mandatory, either in env or inconfig.yaml.