Add env variable for enabling / disabling of analytics on development environments #3648
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.
Trello card
None, this is an adhoc fix for an issue that has come up.
Context
Review apps and the development environment share a database, which means when a PR makes a change to the database but isn't merged yet, it blocks other PRs and all deployments because the dev build step fails as DfE Analytics complains that the database doesn't align to the config available in a given branch. This PR adds an env variable to allow the analytics to be temporarily disabled in the dev environment when needed, specifically when a PR with database changes is present, so as to not block other PRs and deployments.
Changes proposed in this pull request
Instead of defaulting to true for enabling analytics, introduce a control on the dev environment to allow it to be enabled and disabled as needed.
Guidance to review
Ensure review apps work as expected, and that CI build steps work and build despite the differences between the database and analytics config.