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

Ensure that all environment variable calls are properly handled #396

Closed
Silvyre opened this issue Dec 1, 2019 · 0 comments · Fixed by #550
Closed

Ensure that all environment variable calls are properly handled #396

Silvyre opened this issue Dec 1, 2019 · 0 comments · Fixed by #550
Assignees
Labels
area: back-end area: CI/CD Continuous integration / Continuous delivery help wanted Extra attention is needed

Comments

@Silvyre
Copy link
Contributor

Silvyre commented Dec 1, 2019

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.

@Silvyre Silvyre added area: back-end area: CI/CD Continuous integration / Continuous delivery labels Dec 1, 2019
@Silvyre Silvyre changed the title Ensure that all environment variables calls have a default value Ensure that all environment variable calls are properly handled Dec 1, 2019
@Silvyre Silvyre added the help wanted Extra attention is needed label Dec 2, 2019
Silvyre added a commit to Silvyre/telescope that referenced this issue Jan 19, 2020
Silvyre added a commit to Silvyre/telescope that referenced this issue Jan 23, 2020
Silvyre added a commit to Silvyre/telescope that referenced this issue Jan 23, 2020
Silvyre added a commit to Silvyre/telescope that referenced this issue Jan 24, 2020
manekenpix added a commit that referenced this issue Jan 24, 2020
Fixes #396: add default values to environment variables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: back-end area: CI/CD Continuous integration / Continuous delivery help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant