• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

halostatue / enviable / eb27ddedbb9d367c24f4ecdc6a115b8f5afee56c-PR-153
100%
main: 100%

Build:
Build:
LAST BUILD BRANCH: dependabot/github_actions/KineticCafe/actions-dco-4.0.0
DEFAULT BRANCH: main
Ran 08 Nov 2026 06:35PM UTC
Jobs 1
Files 10
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

08 Nov 2026 06:33PM UTC coverage: 100.0%. Remained the same
eb27ddedbb9d367c24f4ecdc6a115b8f5afee56c-PR-153

Pull #153

github

halostatue
feat: Improve Codex Usability

Added multiple usability improvements, mostly focused around Codex and
carried to the classic interface where appropriate. These improvements
come out of converting runtime config.

- `or_raise`: This option replaces `get_env(name) || raise message` with
  a single call.

  ```elixir
  fetch_env!("PORT", or_raise: ~S("PORT" is a required variable))
  fetch_env_as_integer!("PORT", or_raise: ~S("PORT" is a required variable))
  get_env("PORT") |> as_integer(or_raise: ~S("PORT" is a required variable))
  get_env_as_integer("PORT", or_raise: ~S("PORT" is a required variable))
  ```

  When using Enviable.Codex, it can be used with `fetch_env!/2`,
  `fetch_env_once!/2`, `fetch_env_map!`, and any `as*` conversion
  function.

  When using Enviable classic, it can be used with `fetch_env!/2`,
  `fetch_env_as!/3`, `fetch_env_as_*!/2`, `get_env_as/3`, and
  `get_env_as_*/2` functions.

- `then/else` on boolean conversion replaces simple `if/else` clauses
  for setting values based on a boolean value:

  ```elixir
  # Without then/else
  ipv6_if_enabled = if get_env("ECTO_IPV6") |> as_boolean(), do: [:inet6], else: []

  # With then/else using Enviable.Codex
  ipv6_if_enabled = get_env("ECTO_IPV6") |> as_boolean(then: [:inet6], else: [])

  # With then/else using Enviable
  ipv6_if_enabled = get_env_as_boolean("ECTO_IPV6", then: [:inet6], else: [])
  ```

- Enviable.Codex had a minor usability regression because `get_env/1`
  always returns an `Enviable.Value`, meaning that `if get_env(name)` is
  always truthy. This could be worked around with `set?()`, but it's
  awkward. Adding presence tests `env_set?/1` and `env_unset?/1` makes
  this easy again:

  ```elixir
  # With Enviable
  if get_env("PHX_SERVER") do
    config :my_app, MyApp.Endpoint, server: true
  end

  # With Enviable.Codex
  if env_set?("PHX_SERVER") do
    config :my_app, MyApp.Endpoint, server: true
  end

  # More verbose Enviable.Codex
  if get_env("PHX_SERVER... (continued)
Pull Request #153: feat: Improve Codex Usability

103 of 103 new or added lines in 5 files covered. (100.0%)

786 of 786 relevant lines covered (100.0%)

72.89 hits per line

Jobs
ID Job ID Ran Files Coverage
1 eb27ddedbb9d367c24f4ecdc6a115b8f5afee56c-PR-153.1 08 Nov 2026 06:35PM UTC 10
100.0
GitHub Action Run
Source Files on build eb27ddedbb9d367c24f4ecdc6a115b8f5afee56c-PR-153
  • Tree
  • List 10
  • Changed 6
  • Source Changed 0
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #153
  • PR Base - main (#54B54CF4...)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc