Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve boolean environment variables reading #4632

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ruslandoga
Copy link
Contributor

@ruslandoga ruslandoga commented Sep 27, 2024

Changes

This PR improves reading of boolean environment variables. This change fixes cryptic error messages like in #4618 (comment) where 1 was used to mean true in SMTP_HOST_SSL_ENABLED=1.

Tests

  • Automated tests have been added
  • This PR does not require tests

Changelog

  • Entry has been added to changelog
  • This PR does not make a user-facing change

Documentation

  • Docs have been updated
  • This change does not need a documentation update

Dark mode

  • The UI has been tested both in dark and light mode
  • This PR does not change the UI

@ruslandoga ruslandoga force-pushed the improve-env-var-reading branch 2 times, most recently from 880f459 to 5e777ac Compare September 27, 2024 04:31
@ruslandoga ruslandoga changed the title Improve boolean env var reading Improve boolean env var reading in runtime config Sep 27, 2024
@ruslandoga ruslandoga changed the title Improve boolean env var reading in runtime config Improve boolean environment variables reading Sep 27, 2024

_ ->
raise ArgumentError,
"Invalid boolean value: #{inspect(var)}. Expected one of: 1, 0, t, f, true, false, y, n, on, off"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could extract those guard clauses and combine here, 'yes' and 'no' are missing

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.

2 participants