Skip to content

feat(#338): env var coverage — UTEKE_LOG_LEVEL, SERVER_*, RECALL_* - #342

Merged
ajianaz merged 1 commit into
developfrom
feat/v020-338-env-vars
Jun 14, 2026
Merged

ajianaz merged 1 commit into
developfrom
feat/v020-338-env-vars

Conversation

@ajianaz

@ajianaz ajianaz commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Closes #338

Changes

Env var support in Config

  • apply_env_overrides() called after config file merge in Config::load()
  • Invalid values logged as warning (not silently ignored)

New env vars

Env Var Config Equivalent Default
UTEKE_LOG_LEVEL [logging] level warn
UTEKE_SERVER_HOST [server] host 127.0.0.1
UTEKE_SERVER_PORT [server] port 8767
UTEKE_RECALL_MIN_SCORE [recall] min_score 0.3
UTEKE_RECALL_MIN_SCORE_STRICT [recall] min_score_strict 0.5

Resolution order

  1. CLI flag (highest)
  2. Environment variable (UTEKE_*)
  3. Config file (uteke.toml)
  4. Built-in default

Tests

  • 5 new tests using serial_test crate (env var isolation)
  • cargo test --workspace ✅ (176 passed, 5 ignored) — 3x repeat
  • cargo clippy --workspace --all-targets -- -D warnings ✅
  • cargo fmt --all ✅

Defer to v0.2.1

match v.parse::<u16>() {
Ok(port) => self.server.port = port,
Err(_) => {
tracing::warn!("Invalid UTEKE_SERVER_PORT='{v}', ignoring (expected 0-65535)")
Comment thread docs/configuration.md
3. Config file (`uteke.toml`)
4. Built-in default

| Env Var | Config Equivalent | Default | Description |
@github-actions

github-actions Bot commented Jun 14, 2026 •

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-cli · BYOK · MIT

- Config::apply_env_overrides() reads UTEKE_* env vars after config file
- Env vars: UTEKE_LOG_LEVEL, UTEKE_SERVER_HOST/PORT, UTEKE_RECALL_MIN_SCORE/STRICT
- Resolution: CLI flag > env var > config file > default
- 5 new tests (serial_test for env var isolation)
- docs/configuration.md: complete env var table + Docker example

Closes #338
@ajianaz
ajianaz force-pushed the feat/v020-338-env-vars branch from 773f8e5 to 52f7ffd Compare June 14, 2026 13:00
@ajianaz
ajianaz merged commit 3d6a6e0 into develop Jun 14, 2026
8 checks passed
@ajianaz
ajianaz deleted the feat/v020-338-env-vars branch June 14, 2026 13:07
ajianaz added a commit that referenced this pull request Aug 13, 2026
)

- Config::apply_env_overrides() reads UTEKE_* env vars after config file
- Env vars: UTEKE_LOG_LEVEL, UTEKE_SERVER_HOST/PORT, UTEKE_RECALL_MIN_SCORE/STRICT
- Resolution: CLI flag > env var > config file > default
- 5 new tests (serial_test for env var isolation)
- docs/configuration.md: complete env var table + Docker example

Closes #338
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: env var coverage for all config (12-factor compliance)

2 participants