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

Don't fall back to fixture data in production #1152

Merged
merged 1 commit into from
Aug 2, 2023
Merged

Conversation

ChrisBAshton
Copy link
Contributor

The EmergencyContactDetails class relies on a EMERGENCY_CONTACT_DETAILS ENV variable to define sensitive information such as phone numbers and email addresses, which we then display in the Support app.

If the ENV variable is missing, then it falls back to the nonsense data in config/emergency_contact_details.json, potentially displaying incorrect information to publishers. It would be better for the application to crash.

The fallback behaviour has instead been moved to
config/environments, in development.rb and test.rb only. This is so that the app can be started up without having to define the ENV var (development.rb) and so that all of the unrelated tests continue to pass (test.rb).

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

Follow these steps if you are doing a Rails upgrade.

The `EmergencyContactDetails` class relies on a `EMERGENCY_CONTACT_DETAILS`
ENV variable to define sensitive information such as phone numbers
and email addresses, which we then display in the Support app.

If the ENV variable is missing, then it falls back to the nonsense
data in `config/emergency_contact_details.json`, potentially
displaying incorrect information to publishers. It would be better
for the application to crash.

The fallback behaviour has instead been moved to
`config/environments`, in `development.rb` and `test.rb` only.
This is so that the app can be started up without having to define
the ENV var (`development.rb`) and so that all of the unrelated
tests continue to pass (`test.rb`).
@ChrisBAshton ChrisBAshton merged commit b474139 into main Aug 2, 2023
9 checks passed
@ChrisBAshton ChrisBAshton deleted the refactor branch August 2, 2023 08:52
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