Add pre back into protected environments #716
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://eaflood.atlassian.net/browse/WATER-4351
The project comes with an inbuilt mechanism to configure routes to not be available in protected environments, for example, production.
You can see this in
app/routes/data.routes.js
. Both/data/seed
and/data/tear-down
are configured to beexcludeFromProd
.How this works is during startup our
app/plugins/router.plugin.js
callsapp/services/plugins/filter-routes.service.js
which handles filtering out those routes that should not be added when running in a protected environment.To be honest,
excludeFromProd
is a bad name because it could be any environment we add to thisWhen this was first implemented
pre
was included so we could confirm routes were not available before shipping to production. However, in Create endpoint to generate fake data we took it out so we could get this fake data generator to work. It needed to be inpre
because it generated data based on real bill runs.Clearly, we weren't on the ball because we didn't even bother to update the comments which still exist
Since that time the fake data generator is no more and we need to be able to test again that routes (and therefore pages) are not accessible in production. Hence, we need to add
pre
back into our list of protected environments.