Skip to content

Move settings from Bash scripts to YAML config files#305

Open
lfdebrux wants to merge 7 commits into
mainfrom
ldeb-aws-envvars
Open

Move settings from Bash scripts to YAML config files#305
lfdebrux wants to merge 7 commits into
mainfrom
ldeb-aws-envvars

Conversation

@lfdebrux

@lfdebrux lfdebrux commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

What problem does this pull request solve?

Add settings files for each environment in AWS with the configuration settings that are currently stored in the bin/load_env_vars.sh Bash script; this should hopefully make it easier to maintain the settings and make the configuration of these tests more like the other GOV.UK Forms repos.

The Bash script is still used to load secrets from AWS parameter store, but it is much shorter at least, and in future we could look at getting the parameters from parameter store directly from the Ruby code.

While we're at it we also stop using the legacy configuration environment variables (doing https://trello.com/c/tIYmMZ3e/3457-remove-backwards-compatibility-for-legacy-e2e-test-env-vars), and fix some snags about the bin scripts.

Note that apart from bin/dockerfile_test.sh, the bin scripts are not used in our deployment pipelines, and all configuration is provided via environment variables, so these changes hopefully shouldn't affect our automated tests.

Things to consider when reviewing

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Has all relevant documentation been updated?

lfdebrux added 7 commits July 13, 2026 15:39
Make it easier to understand what's happening if you run one of the bin
scripts that try to load environment variables from AWS parameter store
but forget to run with AWS credentials available.
`bin/dockerfile_test.sh` was saving environment variables needed to run
the end to end tests in a file to be able to pass them to Docker; this
is less than ideal because some of the values of the environment
variables should be kept secret.

We only need to pass the names of the environment variables to the
Docker CLI, it can retrieve the values itself; this commit updates the
Dockerfile test script to cut out the values before they are saved.
Add Active Support to our Gemfile so we can use some of the core
extensions in our code.
Renames the file for settings for running the tests against a local
development server to "local", to distinguish it from the "dev"
development environment in AWS. This matches what we call
`Settings.forms_env` for local development in forms-admin [[1]].

Note that we also update the default for the environment name so that
local development is the still the default environment, so this change
shouldn't affect people unless they are explicitly setting the
environment to `development` for some reason.

[1]: https://github.com/govuk-forms/forms-admin/blob/354f8053d60794a75ddae50941b4b87d738ac25c/config/settings.yml#L110
Add files with configuration for end to end tests for each environment
in AWS.

The files are named `aws_#{environment_name}`, with the environment name
retrieved from `SETTINGS__FORMS_ENV`, which is normally set by
forms-deploy or the scripts in the bin folder.
Now that most of the configuration settings needed to run the end to end
tests are in settings files (see previous commit), we can reduce the
amount of Bash needed in the bin scripts and focus on loading just
secrets from AWS parameter store.
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.

1 participant