Summary
Several configuration values are read directly from environment variables outside the usual Pydantic validation path. This can allow invalid values (for example, non-numeric or out-of-range values) to bypass the field constraints enforced for the equivalent config-file settings.
This came up during review of the retry-timeout work in #829, where JMP_RETRY_TIMEOUT is resolved in python/packages/jumpstarter/jumpstarter/config/client.py. The same consistency concern likely applies to other env-derived configuration values as well, so this should be handled as a broader follow-up rather than a one-off fix in that PR.
Why this matters
- Environment variables should enforce the same constraints as the corresponding config model fields.
- Invalid env input should fail early with clear, user-facing configuration errors.
- Applying this uniformly avoids inconsistent behavior across different configuration sources.
Affected areas
Start with config/env resolution paths, especially:
python/packages/jumpstarter/jumpstarter/config/client.py
- Other modules that read
os.environ directly for client/runtime configuration
- Any CLI/config entry points where env values bypass Pydantic field validation
Proposed work
- Audit env-derived config values that are parsed outside model validation.
- Centralize or standardize validation/coercion for those values.
- Ensure numeric/range constraints match the corresponding Pydantic model fields.
- Return clear
ConfigurationError messages for invalid env values.
- Add or update tests for invalid, negative, and boundary values where applicable.
Acceptance criteria
- Env-derived config values follow the same validation rules as config-file/model values.
- Invalid env values are rejected with actionable errors instead of surfacing later or behaving inconsistently.
- Test coverage exists for at least the known affected cases, including
JMP_RETRY_TIMEOUT.
Backlinks
Summary
Several configuration values are read directly from environment variables outside the usual Pydantic validation path. This can allow invalid values (for example, non-numeric or out-of-range values) to bypass the field constraints enforced for the equivalent config-file settings.
This came up during review of the retry-timeout work in #829, where
JMP_RETRY_TIMEOUTis resolved inpython/packages/jumpstarter/jumpstarter/config/client.py. The same consistency concern likely applies to other env-derived configuration values as well, so this should be handled as a broader follow-up rather than a one-off fix in that PR.Why this matters
Affected areas
Start with config/env resolution paths, especially:
python/packages/jumpstarter/jumpstarter/config/client.pyos.environdirectly for client/runtime configurationProposed work
ConfigurationErrormessages for invalid env values.Acceptance criteria
JMP_RETRY_TIMEOUT.Backlinks