You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* updated authenticator to cache in-memory and use dependency injection
* added locustfile with create/delete and search tests
* comments in PR
---------
Co-authored-by: Akshay Shetty <akshay.shetty1@nhs.net>
Copy file name to clipboardExpand all lines: README.md
+14-11Lines changed: 14 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,7 @@ See https://nhsd-confluence.digital.nhs.uk/display/APM/Glossary.
26
26
|`id_sync`|**Imms Cross-cutting** – Handles [MNS](https://digital.nhs.uk/developer/api-catalogue/multicast-notification-service) NHS Number Change events and applies updates to affected records. |
27
27
|`mesh_processor`|**Imms Batch** – Triggered when new files are received via MESH. Moves them into the Imms Batch processing system. |
28
28
|`mns_subscription`|**Imms Cross-cutting** – Simple helper Lambda which sets up our required MNS subscription. Used in pipelines in DEV. |
29
+
|`perf_tests`|**Imms API** – Locust performance tests for the Immunisation API. |
29
30
|`recordforwarder`|**Imms Batch** – Consumes from the stream and applies the processed batch file row operations (CUD) to IEDS. |
30
31
|`recordprocessor`|**Imms Batch** – ECS Task - **not** a Lambda function - responsible for processing batch file rows and forwarding to the stream. |
31
32
|`redis_sync`|**Imms Cross-cutting** – Handles config file updates. E.g. disease mapping or permission files. |
@@ -142,22 +143,12 @@ Steps:
142
143
pip install poetry
143
144
```
144
145
145
-
### Install Pre-Commit Hooks
146
-
147
-
[Husky](https://typicode.github.io/husky/) is used to perform automatic checks upon making a commit.
148
-
It is configured within `.husky/pre-commit` to run the checks defined in the root level `package.json` under `lint-staged`.
149
-
To set this up:
150
-
151
-
1. Ensure you have installed nodejs at the same version or later as per .tool-versions and
146
+
8. Install pre-commit hooks. Ensure you have installed nodejs at the same version or later as per .tool-versions and
152
147
then, from the repo root, run:
153
-
154
148
```
155
149
npm install
156
150
```
157
151
158
-
2. Run `cd quality_checks` then `poetry install --no-root`. This will make sure your version of ruff is the same as used in the GitHub pipeline.
159
-
You can check your version is correct by running `poetry run ruff --version` from within the `quality_checks` directory and comparing to the version in the poetry.lock file.
160
-
161
152
### Setting up a virtual environment with poetry
162
153
163
154
The steps below must be performed in each Lambda function folder and e2e_automation folder to ensure the environment is correctly configured.
@@ -216,6 +207,18 @@ Steps:
216
207
217
208
It is not necessary to activate the virtual environment (using `source .venv/bin/activate`) before running a unit test suite from the command line; `direnv` will pick up the correct configurations for us. Run `pip list` to verify that the expected packages are installed. You should for example see that `recordprocessor` is specifically running `moto` v4, regardless of which if any `.venv` is active.
218
209
210
+
### Setting up the root level environment
211
+
212
+
The root-level virtual environment is primarily used for linting, as we create separate virtual environments for each folder that contains Lambda functions.
213
+
Steps:
214
+
215
+
1. Follow instructions above to [install dependencies](#install-dependencies) & [set up a virtual environment](#setting-up-a-virtual-environment-with-poetry).
216
+
**Note: While this project uses Python 3.11 (e.g. for Lambdas), the NHSDigital/api-management-utils repository — which orchestrates setup and linting — defaults to Python 3.8.
217
+
The linting command is executed from within that repo but calls the Makefile in this project, so be aware of potential Python version mismatches when running or debugging locally or in the pipeline.**
218
+
2. Run `make lint`. This will:
219
+
- Check the linting of the API specification yaml.
220
+
- Run Flake8 on all Python files in the repository, excluding files inside .venv and .terraform directories.
221
+
219
222
## IDE setup
220
223
221
224
The current team uses VS Code mainly. So this setup is targeted towards VS code. If you use another IDE please add the documentation to set up workspaces here.
0 commit comments