Skip to content

Maintenance: consolidate env variable helpers for booleans #3967

Closed
@dreamorosi

Description

@dreamorosi

Summary

In #3945 we added some environment variable helpers to the commons packages. A community member @benjymoses provided feedback that some of them were unclear and could be improved.

For example we had a base helper to retrieve and cast boolean values from the environment, but we also had more specific helpers like getTruthyBooleanFromEnv and getFalsyBooleanFromEnv.

These two specifically represented a state rather than an actual value so at minimum they should've been called isTruthyBooleanFromEnv and isFalsyBooleanFromEnv since they returned whether the value was truth-y or fals-y rather than the actual value.

On top of that, they were redundant in the sense that the original getBooleanFromEnv could've been extended to handle both regular false/true strings as well as additional values.

Why is this needed?

So that we can consolidate the implementations and disambiguate the meaning/behavior of these helpers.

Which area does this relate to?

No response

Solution

No response

Acknowledgment

Future readers

Please react with 👍 and your use case to help us understand customer demand.

Metadata

Metadata

Assignees

Labels

commonsThis item relates to the Commons UtilitycompletedThis item is complete and has been merged/shippedinternalPRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)

Type

No type

Projects

Status

Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions