Skip to content

fix: trim the app environment and skip blank values - #55

Merged
catinspace-au merged 1 commit into
mainfrom
fix/app-env-trim
Sep 30, 2026
Merged

catinspace-au merged 1 commit into
mainfrom
fix/app-env-trim

Conversation

@catinspace-au

Copy link
Copy Markdown
Contributor

Brings get_app_env() in scalo-py to parity with scalo-rs, which already trims each candidate and treats a blank value as unset.

  • get_app_env() now strips whitespace from APP_ENV, ENVIRONMENT and ENV in turn, and falls through to the next variable when a value is empty or whitespace-only, before defaulting to "development".
  • The duplicated inline expression in get_standard_env_vars() now calls get_app_env() instead of repeating the resolution logic.
  • Added parity tests: leading/trailing whitespace is trimmed, a blank or whitespace-only value falls through, and all-blank still defaults to "development".
  • Updated the module docstring and docs/core-pillars/CONFIG.md to note the trimming and blank-as-unset behaviour.

Without this, APP_ENV=" production" (a padded value, e.g. from a shell export or a K8s manifest) resolves to production in scalo-rs but development in scalo-py.

@catinspace-au
catinspace-au merged commit ac0ee9b into main Sep 30, 2026
17 checks passed
@catinspace-au
catinspace-au deleted the fix/app-env-trim branch September 30, 2026 14:22
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.

1 participant