Skip to content

Commit ffcf84e

Browse files
committed
Merge branch main into feature/CCM-12613_upload_resource_to_pdm
2 parents f3be2ac + f509cf4 commit ffcf84e

File tree

147 files changed

+5770
-2831
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+5770
-2831
lines changed

.coverage

0 Bytes
Binary file not shown.

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
*.code-workspace @NHSDigital/nhs-notify-digital-letters-admins
99
/infrastructure/terraform/ @NHSDigital/nhs-notify-platform
1010

11+
# Root level AGENTS.md owned by platform.
12+
AGENTS.md @NHSDigital/nhs-notify-platform
13+
1114
# Codeowners must be final check
1215
/.github/CODEOWNERS @NHSDigital/nhs-notify-code-owners
1316
/CODEOWNERS @NHSDigital/nhs-notify-code-owners

.github/actions/acceptance-tests/action.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ runs:
3030
run: |
3131
npm ci
3232
33+
- name: "Generate dependencies"
34+
shell: bash
35+
run: |
36+
npm run generate-dependencies
37+
3338
- name: Run test - ${{ inputs.testType }}
3439
shell: bash
3540
run: |

.github/workflows/stage-2-test.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
npm ci
5858
- name: "Generate dependencies"
5959
run: |
60-
npm run generate-dependencies --workspaces --if-present
60+
npm run generate-dependencies
6161
git diff --exit-code
6262
test-unit:
6363
name: "Unit tests"
@@ -71,7 +71,7 @@ jobs:
7171
npm ci
7272
- name: "Generate dependencies"
7373
run: |
74-
npm run generate-dependencies --workspaces --if-present
74+
npm run generate-dependencies
7575
- name: "Run unit test suite"
7676
run: |
7777
make test-unit
@@ -104,7 +104,7 @@ jobs:
104104
npm ci
105105
- name: "Generate dependencies"
106106
run: |
107-
npm run generate-dependencies --workspaces --if-present
107+
npm run generate-dependencies
108108
- name: "Run linting"
109109
run: |
110110
make test-lint
@@ -120,7 +120,7 @@ jobs:
120120
npm ci
121121
- name: "Generate dependencies"
122122
run: |
123-
npm run generate-dependencies --workspaces --if-present
123+
npm run generate-dependencies
124124
- name: "Run typecheck"
125125
run: |
126126
make test-typecheck

.github/workflows/stage-3-build.yaml

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -44,40 +44,3 @@ jobs:
4444
uses: ./.github/actions/build-docs
4545
with:
4646
version: "${{ inputs.version }}"
47-
48-
49-
50-
# artefact-1:
51-
# name: "Artefact 1"
52-
# runs-on: ubuntu-latest
53-
# timeout-minutes: 3
54-
# steps:
55-
# - name: "Checkout code"
56-
# uses: actions/checkout@v5
57-
# - name: "Build artefact 1"
58-
# run: |
59-
# echo "Building artefact 1 ..."
60-
# - name: "Check artefact 1"
61-
# run: |
62-
# echo "Checking artefact 1 ..."
63-
# - name: "Upload artefact 1"
64-
# run: |
65-
# echo "Uploading artefact 1 ..."
66-
# # Use either action/cache or action/upload-artifact
67-
# artefact-n:
68-
# name: "Artefact n"
69-
# runs-on: ubuntu-latest
70-
# timeout-minutes: 3
71-
# steps:
72-
# - name: "Checkout code"
73-
# uses: actions/checkout@v5
74-
# - name: "Build artefact n"
75-
# run: |
76-
# echo "Building artefact n ..."
77-
# - name: "Check artefact n"
78-
# run: |
79-
# echo "Checking artefact n ..."
80-
# - name: "Upload artefact n"
81-
# run: |
82-
# echo "Uploading artefact n ..."
83-
# # Use either action/cache or action/upload-artifact

AGENTS.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# AGENTS.md
2+
<!-- vale off -->
3+
4+
## Scope
5+
6+
This file is for **AI agents** working within NHS Notify repositories.
7+
Humans should read `README.md` and the docs for how we actually work day to day.
8+
Keep anything language or tool-specific in nested `AGENTS.md` files (for example under `infrastructure/terraform` or `lambdas`).
9+
10+
## Repository Layout (high level)
11+
12+
At a glance, the main areas are:
13+
14+
- `infrastructure/terraform/` – Terraform components, and shared modules for AWS accounts and environments.
15+
- `lambdas/` – TypeScript lambda projects (each with their own `package.json`, Jest config, etc.). Root level packages.json defines workspaces and scripts. Tests for the lambda are stored in `lambdas/{name}/src/__test`.
16+
- `src/` and `utils/` – Shared code and utilities (for example `utils/logger`).
17+
- `docs/` – Documentation site, ADRs, RFCS, and other long‑form docs.
18+
- `.github/workflows/` and `.github/actions/` – GitHub Actions workflows and composite actions.
19+
- `scripts/` – Helper scripts and tooling used by humans and workflows.
20+
- `tests/` – Cross‑cutting tests and harnesses for the repo.
21+
22+
Agents should look for a nested `AGENTS.md` in or near these areas before making non‑trivial changes.
23+
24+
## Root package.json – role and usage
25+
26+
The root `package.json` is the orchestration manifestgit co for this repo. It does not ship application code; it wires up shared dev tooling and delegates to workspace-level projects.
27+
28+
- Workspaces: Declares the set of npm workspaces (e.g. under `lambdas/`, `utils/`, `tests/`, `scripts/`). Agents should add a new workspace path here when introducing a new npm project.
29+
- Scripts: Provides top-level commands that fan out across workspaces using `--workspaces` (lint, typecheck, unit tests) and project-specific runners (e.g. `lambda-build`).
30+
- Dev tool dependencies: Centralises Jest, TypeScript, ESLint configurations and plugins to keep versions consistent across workspaces. Workspace projects should rely on these unless a local override is strictly needed.
31+
- Overrides/resolutions: Pins transitive dependencies (e.g. Jest/react-is) to avoid ecosystem conflicts. Agents must not remove overrides without verifying tests across all workspaces.
32+
33+
Agent guidance:
34+
35+
- Before adding or removing a workspace, update the root `workspaces` array and ensure CI scripts still succeed with `npm run lint`, `npm run typecheck`, and `npm run test:unit` at the repo root.
36+
- When adding repo-wide scripts, keep names consistent with existing patterns (e.g. `lint`, `lint:fix`, `typecheck`, `test:unit`, `lambda-build`) and prefer `--workspaces` fan-out.
37+
- Do not publish from the root. If adding a new workspace intended for publication, mark that workspace package as `private: false` and keep the root as private.
38+
- Validate changes by running the repo pre-commit hooks: `make githooks-run`.
39+
40+
Success criteria for changes affecting the root `package.json`:
41+
42+
- `npm run lint`, `npm run typecheck`, and `npm run test:unit` pass at the repo root.
43+
- Workspace discovery is correct (new projects appear under `npm run typecheck --workspaces`).
44+
- No regression in lambda build tooling (`npm run lambda-build`).
45+
46+
## What Agents Can / Can’t Do
47+
48+
Agents **can**:
49+
50+
- Propose changes to code, tests, GitHub workflows, Terraform, and docs.
51+
- Suggest new scripts, Make targets, or composite actions by copying existing patterns.
52+
- Run tests to validate proposed solutions.
53+
54+
Agents **must not**:
55+
56+
- Create, push, or merge branches or PRs.
57+
- Introduce new technologies, providers, or big architectural patterns without clearly calling out that an ADR is needed.
58+
- Invent secrets or hard‑code real credentials anywhere.
59+
60+
## Working With This Repo
61+
62+
- All dependencies can be setup using the command `make config` from the repository root.
63+
- **Don’t guess commands.** Derive them from what’s already here or ask for guidance form the human user:
64+
- Prefer `Makefile` targets, `scripts/`, `.github/workflows/`, and `.github/actions/`.
65+
- For Terraform, follow `infrastructure/terraform/{components,modules}` and respect `versions.tf`.
66+
- Keep diffs small and focused. Avoid mixing refactors with behaviour changes unless you explain why.
67+
68+
## Quality Expectations
69+
70+
When proposing a change, agents should:
71+
72+
- Keep code formatted and idiomatic (Terraform, TypeScript, Bash, YAML).
73+
- Stick to existing patterns where available (for example `utils/logger`, composite actions under `.github/actions`).
74+
- Use available information on best practices within the specific area of the codebase.
75+
- **Always** run local pre-commit hooks from the repo root with:
76+
77+
```sh
78+
pre-commit run \
79+
--config scripts/config/pre-commit.yaml
80+
```
81+
82+
to catch formatting and basic lint issues. Domain specific checks will be defined in appropriate nested AGENTS.md files.
83+
84+
- Suggest at least one extra validation step (for example `npm test` in a lambda, or triggering a specific workflow).
85+
- Any required follow up activites which fall outside of the current task's scope should be clearly marked with a 'TODO: CCM-12345' comment. The human user should be prompted to create and provide a JIRA ticket ID to be added to the comment.
86+
87+
## Security & Safety
88+
89+
- All agent-generated changes **must** be reviewed and merged by a human.
90+
- Provide a concise, clear summary of the proposed changes to make human review easier (what changed, why (refer directly to the guidance in relevant Agents.MD files when applicable), and how it was validated). It should be directly pastable into the PR description and make it clear that AI assistance was used.
91+
- Never output real secrets or tokens. Use placeholders and rely on the GitHub/AWS secrets already wired into workflows.
92+
93+
## Escalation / Blockers
94+
95+
If you are blocked by an unavailable secret, unclear architectural constraint, missing upstream module, or failing tooling you cannot safely fix, stop and ask a single clear clarifying question rather than guessing.

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ quick-start: config clean build serve-docs # Quick start target to setup, build
1212
dependencies: # Install dependencies needed to build and test the project @Pipeline
1313
# TODO: Implement installation of your project dependencies
1414

15+
generate: # Generate any autogenerated output @Pipeline
16+
npm run generate-dependencies
17+
1518
build: # Build the project artefact @Pipeline
1619
$(MAKE) -C docs build
1720

@@ -30,12 +33,14 @@ clean:: # Clean-up project resources (main) @Operations
3033
$(MAKE) -C src/eventcatalogasyncapiimporter clean
3134
$(MAKE) -C src/eventcatalogasyncapiimporter clean-output
3235
rm -f .version
33-
# TODO: Implement project resources clean-up step
36+
npm run clean
3437

3538
config:: _install-dependencies version # Configure development environment (main) @Configuration
3639
$(MAKE) -C docs install
3740
$(MAKE) -C src/cloudevents install
3841
$(MAKE) -C src/eventcatalogasyncapiimporter install
42+
npm install
43+
$(MAKE) generate
3944

4045
serve-docs:
4146
$(MAKE) -C docs s
@@ -50,5 +55,5 @@ ${VERBOSE}.SILENT: \
5055
build \
5156
clean \
5257
config \
53-
dependencies \
58+
generate \
5459
deploy \

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Clone the repository
3333
```shell
3434
git clone https://github.com/NHSDigital/nhs-notify-digital-letters.git
3535
cd nhs-notify-digital-letters
36-
code protject.code-workspace
36+
code project.code-workspace
3737
```
3838

3939
Reopen with container
@@ -76,6 +76,10 @@ Installation and configuration of the toolchain dependencies
7676
make config
7777
```
7878
79+
Note that the `make config` command will also build the flattened event schemas and auto-generate a Typescript
80+
type and JS validator code for each event. See the [typescript-schema-generator](src/typescript-schema-generator/)
81+
package for more details.
82+
7983
## Usage
8084

8185
### Testing

docs/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ build: clean build-schemas copy-schema-docs copy-schema-yaml-docs copy-schemas b
4343

4444
build-ci: build-schemas-ci copy-schema-docs copy-schema-yaml-docs copy-schemas build-eventcatalog build-docs show-build-output
4545

46-
4746
build-eventcatalog:
4847
$(MAKE) build-eventcatalog-prereq
4948
make -C $(EVENT_CAT_ROOT_DIR) build BASE_URL=$(EVENT_CAT_URL)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
3+
title: MESH Acknowledger
4+
parent: MESH Services
5+
nav_order: 4
6+
has_children: true
7+
last_modified_date: 2024-10-28
8+
owner: Tom D'Roza
9+
author: Tom D'Roza
10+
diagrams: [c4code-mesh-acknowledger]
11+
events-raised: [mesh-inbox-message-acknowledged]
12+
events-consumed: [mesh-inbox-message-downloaded]
13+
c4type: code
14+
---

0 commit comments

Comments
 (0)