Add env var uppercase validation - #6815
Conversation
Greptile SummaryAdds strict uppercase-name validation to
Confidence Score: 4/5The PR should not merge until the new validation provides a compatibility or deprecation path for existing users of non-uppercase EnvVar names. The constructor is reachable through importable Reflex modules and now turns previously valid inputs into immediate ValueError failures, while the tests explicitly establish this hard rejection as the intended behavior. Files Needing Attention: packages/reflex-base/src/reflex_base/environment.py
|
| Filename | Overview |
|---|---|
| packages/reflex-base/src/reflex_base/environment.py | Adds unconditional uppercase validation, introducing a compatibility break for previously accepted constructor inputs. |
| tests/units/test_environment.py | Adds focused parameterized tests covering the newly accepted and rejected name formats. |
Reviews (1): Last reviewed commit: "format" | Re-trigger Greptile
| if not name.isupper(): | ||
| msg = f"Environment variable name must be uppercase: {name!r}" | ||
| raise ValueError(msg) |
There was a problem hiding this comment.
When downstream code constructs EnvVar through reflex.config.EnvVar or reflex_base.environment.EnvVar with an existing lowercase or mixed-case name, this unconditional check raises ValueError, causing application initialization or startup to fail without the required deprecation and fallback period.
Context Used: CLAUDE.md (source)
Knowledge Base Used: Config and Environment System
Merging this PR will not alter performance
Comparing Footnotes
|
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
No description provided.