-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat(api): support configuration file loading #2983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request introduces support for configuring the API service via external YAML or JSON configuration files, complementing the existing environment variable approach. The implementation prioritizes environment variables over config file values, allowing flexible deployment configurations.
Key changes:
- Added a config map loader utility that parses YAML/JSON files and retrieves nested values using dot notation
- Refactored the configuration module to use helper functions that check environment variables first, then fall back to config map values
- Updated documentation to describe the new CONFIG_MAP_PATH feature and configuration precedence rules
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| apps/api/config-map.example.yaml | Example configuration demonstrating YAML structure for database, Redis, SMTP, S3, runner, logging, and quota settings |
| apps/api/src/config/config-map.loader.ts | New utility module implementing config file loading, nested value retrieval, and environment variable precedence logic |
| apps/api/src/config/configuration.ts | Refactored to use config map helper functions for all configuration values while maintaining environment variable precedence |
| apps/docs/src/content/docs/en/oss-deployment.mdx | Added documentation explaining CONFIG_MAP_PATH usage and configuration precedence behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Toma Puljak <[email protected]>
Signed-off-by: Toma Puljak <[email protected]>
Co-authored-by: Bruno Grbavac <[email protected]>
2bd3c25 to
99b7378
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request introduces support for configuring the API service using an external YAML or JSON config map file, in addition to environment variables. It adds an example configuration file, implements a loader utility for reading and merging config values, and updates documentation to describe the new configuration method.
Config map support for API service:
config-map.example.yaml) that demonstrates all supported configuration options, including database, Redis, SMTP, S3, runner, logging, and quota settings.config-map.loader.ts) to load configuration from a YAML or JSON file, retrieve nested values using dot notation, and resolve config values with environment variable precedence.Documentation updates:
CONFIG_MAP_PATH, and clarified that environment variables override config file values.