Ensure that all environment variable calls are properly handled #396
Labels
area: back-end
area: CI/CD
Continuous integration / Continuous delivery
help wanted
Extra attention is needed
Since our CI testing does not define any of the environment variables that we set locally via our
.env
file, calls to any such variables (e.g.process.env.BLOG_INACTIVE_TIME
) will return undefined during CI testing. As such, environment variables should always be accompanied by a default value.For example, replacing
process.env.BLOG_INACTIVE_TIME
with(process.env.BLOG_INACTIVE_TIME || 365)
effectively provides a default value of 365 to that environment variable.Every instance of environment variables usage within our codebase should be reviewed to ensure that we are able to account for cases where those variables may be undefined.
In select cases, when an environment variable is undefined, it may be prudent to take further action (in addition to falling back on default value): logging a warning, throwing an error, etc.
The text was updated successfully, but these errors were encountered: