feat(config): derive env var names from dotted config paths#725
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files
🚀 New features to boost your workflow:
|
Make the dotted TOML path the single source of truth for env var names: MICASA_ + UPPER(key with "." replaced by "_"). Users can now look at any config key and immediately know its env var without consulting a table. Remove all `env:"..."` struct tags and derive names at runtime via EnvVarName(). Refactor migrateRenamedEnvVars as a table-driven function returning an overrides map (no os.Setenv mutation). Rename extraction.max_extract_pages to extraction.max_pages. Env vars that changed (old names accepted with deprecation warnings): - MICASA_CURRENCY -> MICASA_LOCALE_CURRENCY - MICASA_MAX_DOCUMENT_SIZE -> MICASA_DOCUMENTS_MAX_FILE_SIZE - MICASA_CACHE_TTL -> MICASA_DOCUMENTS_CACHE_TTL - MICASA_CACHE_TTL_DAYS -> MICASA_DOCUMENTS_CACHE_TTL_DAYS - MICASA_FILE_PICKER_DIR -> MICASA_DOCUMENTS_FILE_PICKER_DIR - MICASA_MAX_EXTRACT_PAGES -> MICASA_EXTRACTION_MAX_PAGES - MICASA_TEXT_TIMEOUT -> MICASA_EXTRACTION_TEXT_TIMEOUT - MICASA_EXTRACTION_MAX_EXTRACT_PAGES -> MICASA_EXTRACTION_MAX_PAGES Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3c35061 to
aed17bc
Compare
cpcloud
added a commit
that referenced
this pull request
Mar 19, 2026
## Summary - Make the dotted TOML config path the single source of truth for env var names: `MICASA_` + `UPPER(key with "." → "_")`. Users can look at any config key and immediately infer the env var. - Remove all `env:"..."` struct tags; derive names at runtime via `EnvVarName(key)`. - Refactor `migrateRenamedEnvVars` as a table-driven function returning an overrides map instead of mutating config fields directly. Handles multi-generation chains (e.g. `MICASA_MAX_OCR_PAGES` → `MICASA_MAX_EXTRACT_PAGES` → `MICASA_EXTRACTION_MAX_PAGES`). - Rename `extraction.max_extract_pages` → `extraction.max_pages` with TOML key and env var deprecation migrations. - All old env var names still accepted with deprecation warnings. - Update `show config` dump to derive fallback env var sources from the same rename table. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
MICASA_+UPPER(key with "." → "_"). Users can look at any config key and immediately infer the env var.env:"..."struct tags; derive names at runtime viaEnvVarName(key).migrateRenamedEnvVarsas a table-driven function returning an overrides map instead of mutating config fields directly. Handles multi-generation chains (e.g.MICASA_MAX_OCR_PAGES→MICASA_MAX_EXTRACT_PAGES→MICASA_EXTRACTION_MAX_PAGES).extraction.max_extract_pages→extraction.max_pageswith TOML key and env var deprecation migrations.show configdump to derive fallback env var sources from the same rename table.🤖 Generated with Claude Code