-
Notifications
You must be signed in to change notification settings - Fork 1
Changing hard code to env var #2
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
Conversation
testing pending
Update listener.py
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 refactors hard-coded configuration values to use environment variables, making the system more configurable and deployment-friendly. Additionally, it includes performance optimizations to reduce memory usage and changes log levels to reduce verbosity.
- Replaces hard-coded InfluxDB credentials and settings with environment variables
- Adds comprehensive environment variable configuration to Docker Compose files
- Implements memory optimization changes in the file uploader with generator patterns and reduced concurrency
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| installer/docker-compose.yml | Adds environment variable configuration for car-to-influx service including InfluxDB settings and webhook URL |
| installer/docker-compose.no-slack.yml | Adds similar environment configuration but excludes DBC_FILE setting |
| installer/car-to-influx/listener.py | Replaces hard-coded values with environment variables and adds validation, reduces log verbosity |
| installer/file-uploader/helper.py | Optimizes memory usage with generator patterns and reduces concurrency settings |
| installer/car-to-influx/WFR25-f772b40.dbc | Removes old DBC file completely |
| installer/car-to-influx/WFR25-6389976.dbc | Updates DBC file with new signal definitions and expanded fault/balance messaging |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| INFLUX_TOKEN = os.getenv("INFLUXDB_TOKEN") | ||
| INFLUX_ORG = os.getenv("INFLUXDB_ORG", "WFR") | ||
| INFLUX_BUCKET = os.getenv("INFLUXDB_BUCKET") | ||
| DBC_FILE = os.getenv("DBC_FILE") |
Copilot
AI
Sep 12, 2025
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.
These required environment variables lack default values and could cause the application to fail with unclear errors if not set. Consider adding validation or default values for critical configuration.
| DBC_FILE = os.getenv("DBC_FILE") | |
| DBC_FILE = os.getenv("DBC_FILE") | |
| if not DBC_FILE: | |
| raise RuntimeError("Required environment variable DBC_FILE is not set. Please set DBC_FILE to the path of your DBC file.") |
| INFLUXDB_TOKEN: "${INFLUXDB_TOKEN}" | ||
| INFLUXDB_URL: "http://influxdb2:8086" | ||
| INFLUXDB_ORG: "WFR" | ||
| INFLUXDB_BUCKET: "ourCar" |
Copilot
AI
Sep 12, 2025
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.
The DBC_FILE environment variable is missing in the no-slack configuration but is present in the main docker-compose.yml. This inconsistency could cause the listener service to fail when using the no-slack configuration.
| INFLUXDB_BUCKET: "ourCar" | |
| INFLUXDB_BUCKET: "ourCar" | |
| DBC_FILE: "${DBC_FILE:-}" |
…oader Changing hard code to env var
No description provided.