diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 1237b258..e87cdcb6 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -25,16 +25,16 @@ If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** -- OS: [e.g. iOS] -- Browser: [e.g. chrome, safari] -- Version: [e.g. 22] +- OS: [e.g. iOS] +- Browser: [e.g. chrome, safari] +- Version: [e.g. 22] **Smartphone (please complete the following information):** -- Device: [e.g. iPhone6] -- OS: [e.g. iOS8.1] -- Browser: [e.g. stock browser, safari] -- Version: [e.g. 22] +- Device: [e.g. iPhone6] +- OS: [e.g. iOS8.1] +- Browser: [e.g. stock browser, safari] +- Version: [e.g. 22] **Additional context** Add any other context about the problem here. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index dcab34a9..a9a79110 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -42,9 +42,9 @@ Stages to complete before opening the Pull Request: :information_source: This section is to be filled in by the **reviewer**. -- [ ] I have reviewed the changes in this PR and they fill all or part of the acceptance criteria of the ticket, and the code is in a mergeable state. -- [ ] If there were infrastructure, operational, or build changes, I have made sure there is sufficient evidence that the changes will work. -- [ ] I have ensured the changelog has been updated by the submitter, if necessary. +- [ ] I have reviewed the changes in this PR and they fill all or part of the acceptance criteria of the ticket, and the code is in a mergeable state. +- [ ] If there were infrastructure, operational, or build changes, I have made sure there is sufficient evidence that the changes will work. +- [ ] I have ensured the changelog has been updated by the submitter, if necessary. ## Post-merge diff --git a/.github/workflows/prettier-checks.yml b/.github/workflows/prettier-checks.yml new file mode 100644 index 00000000..06233d73 --- /dev/null +++ b/.github/workflows/prettier-checks.yml @@ -0,0 +1,28 @@ +name: Prettier Checks +on: + pull_request: + branches: [master] +permissions: + contents: read +jobs: + PrettierChecks: + name: Prettier Checks + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Install dependencies + shell: bash + run: npm install + + - name: Run Prettier + shell: bash + run: npx prettier --check . diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..4923eeb2 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +*.yaml +*.yml +postman/* +*.js diff --git a/.vscode/extensions.json b/.vscode/extensions.json index b28b8a14..38ed8ebf 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,6 +1,3 @@ { - "recommendations": [ - "mermade.openapi-lint", - "42Crunch.vscode-openapi" - ] + "recommendations": ["mermade.openapi-lint", "42Crunch.vscode-openapi"] } diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 07e36463..6be90ed5 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation. Examples of behaviour that contributes to creating a positive environment include: -- Using welcoming and inclusive language -- Being respectful of differing viewpoints and experiences -- Gracefully accepting constructive criticism -- Focusing on what is best for the community -- Showing empathy towards other community members +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members Examples of unacceptable behaviour by participants include: -- The use of sexualized language or imagery and unwelcome sexual attention or - advances -- Trolling, insulting/derogatory comments, and personal or political attacks -- Public or private harassment -- Publishing others' private information, such as a physical or electronic - address, without explicit permission -- Other conduct which could reasonably be considered inappropriate in a - professional setting +- The use of sexualized language or imagery and unwelcome sexual attention or + advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic + address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting ## Our Responsibilities diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 192c323e..93f0f2dc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,16 +3,16 @@ > [!WARNING] > Some of the documentation and links in this file are specific to the maintainers of this repository and are only available to NHS England staff. -- [Contribution Guidelines](#contribution-guidelines) - - [Raising an Issue](#raising-an-issue) - - [Contributing code](#contributing-code) - - [Merge responsibility](#merge-responsibility) - - [Branch naming](#branch-naming) - - [Developers within the NHS](#developers-within-the-nhs) - - [Developers outside of the NHS](#developers-outside-of-the-nhs) - - [Commit messages](#commit-messages) - - [Developers within the NHS](#developers-within-the-nhs-1) - - [Developers outside of the NHS](#developers-outside-of-the-nhs-1) +- [Contribution Guidelines](#contribution-guidelines) + - [Raising an Issue](#raising-an-issue) + - [Contributing code](#contributing-code) + - [Merge responsibility](#merge-responsibility) + - [Branch naming](#branch-naming) + - [Developers within the NHS](#developers-within-the-nhs) + - [Developers outside of the NHS](#developers-outside-of-the-nhs) + - [Commit messages](#commit-messages) + - [Developers within the NHS](#developers-within-the-nhs-1) + - [Developers outside of the NHS](#developers-outside-of-the-nhs-1) ## Raising an Issue @@ -29,9 +29,9 @@ so please explain why the changes need to be made (unless it is self-evident). ### Merge responsibility -- It is the responsibility of the reviewer to merge branches they have approved. -- It is the responsibility of the author of the merge to ensure their merge is in a mergeable state. -- It is the responsibility of the maintainers to ensure the merge process is unambiguous and automated where possible. +- It is the responsibility of the reviewer to merge branches they have approved. +- It is the responsibility of the author of the merge to ensure their merge is in a mergeable state. +- It is the responsibility of the maintainers to ensure the merge process is unambiguous and automated where possible. ### Branch naming diff --git a/DEVELOPMENT_GUIDE.md b/DEVELOPMENT_GUIDE.md index 21713fea..b5fd2cc7 100644 --- a/DEVELOPMENT_GUIDE.md +++ b/DEVELOPMENT_GUIDE.md @@ -7,27 +7,27 @@ This documentation is intended for developers to develop the schema, sandbox and ## Table of Contents -- [Development Guide](#development-guide) - - [Table of Contents](#table-of-contents) - - [Development](#development) - - [Requirements](#requirements) - - [Make commands](#make-commands) - - [Testing](#testing) - - [Platform setup](#platform-setup) - - [Detailed folder walk through](#detailed-folder-walk-through) - - [`/.github`:](#github) - - [`/azure`:](#azure) - - [`/proxies`:](#proxies) - - [`/scripts`:](#scripts) - - [`/specification`:](#specification) - - [`/tests`:](#tests) - - [`Makefile`:](#makefile) - - [`ecs-proxies-containers.yml ` and `ecs-proxies-deploy.yml`:](#ecs-proxies-containersyml--and-ecs-proxies-deployyml) - - [`manifest_template.yml`:](#manifest_templateyml) - - [Releasing a new schema version](#releasing-a-new-schema-version) - - [Caveats](#caveats) - - [Swagger UI](#swagger-ui) - - [Apigee Portal](#apigee-portal) +- [Development Guide](#development-guide) + - [Table of Contents](#table-of-contents) + - [Development](#development) + - [Requirements](#requirements) + - [Make commands](#make-commands) + - [Testing](#testing) + - [Platform setup](#platform-setup) + - [Detailed folder walk through](#detailed-folder-walk-through) + - [`/.github`:](#github) + - [`/azure`:](#azure) + - [`/proxies`:](#proxies) + - [`/scripts`:](#scripts) + - [`/specification`:](#specification) + - [`/tests`:](#tests) + - [`Makefile`:](#makefile) + - [`ecs-proxies-containers.yml ` and `ecs-proxies-deploy.yml`:](#ecs-proxies-containersyml--and-ecs-proxies-deployyml) + - [`manifest_template.yml`:](#manifest_templateyml) + - [Releasing a new schema version](#releasing-a-new-schema-version) + - [Caveats](#caveats) + - [Swagger UI](#swagger-ui) + - [Apigee Portal](#apigee-portal) ## Development @@ -36,12 +36,12 @@ This documentation is intended for developers to develop the schema, sandbox and ### Requirements -- GNU make -- nodejs 22+ - - npm 10.8+ -- Python 3.8 + - - [poetry](https://github.com/python-poetry/poetry) 1.8+ -- Java 8+ +- GNU make +- nodejs 22+ + - npm 10.8+ +- Python 3.8 + + - [poetry](https://github.com/python-poetry/poetry) 1.8+ +- Java 8+ ### Make commands @@ -49,9 +49,9 @@ To run the below make targets you will first need to run `make install-node` There are `make` commands that alias scripts in the `package.json` -- `lint` -- Lints the spec and code -- `publish` -- Outputs the specification as a **single file** into the `build/` directory -- `serve` -- Serves a preview of the specification in human-readable format +- `lint` -- Lints the spec and code +- `publish` -- Outputs the specification as a **single file** into the `build/` directory +- `serve` -- Serves a preview of the specification in human-readable format ### Testing @@ -77,19 +77,19 @@ For further information about Apigee and APIM see [API Producer Zone confluence] `/.github/workflows`: This folder contains GitHub workflows, these workflow are mainly used to check pull requests and publish releases. -- `pr-lint.yaml`: This workflow links Pull Request's to Jira tickets and runs when a pull request is opened/updated. -- `continuous-integration.yml`: This workflow publishes a Github release when pushing to master. -- `sandbox-checks.yaml`: This workflow checks the sandbox meets the formatting and linting rules (Black + Flake8). Also it runs the sandbox unit tests (Pytest) -- `dependency-review.yml`: This workflow checks for any vulnerabilities in dependencies to be added to the project. -- `codeql-analysis.yml`: This workflow checks for any code vulnerabilities in the project. +- `pr-lint.yaml`: This workflow links Pull Request's to Jira tickets and runs when a pull request is opened/updated. +- `continuous-integration.yml`: This workflow publishes a Github release when pushing to master. +- `sandbox-checks.yaml`: This workflow checks the sandbox meets the formatting and linting rules (Black + Flake8). Also it runs the sandbox unit tests (Pytest) +- `dependency-review.yml`: This workflow checks for any vulnerabilities in dependencies to be added to the project. +- `codeql-analysis.yml`: This workflow checks for any code vulnerabilities in the project. #### `/azure`: Contains Azure Devops pipelines for building and deploying to Apigee: -- `azure-build-pipeline.yml`: Assembles the contents of your repository into a single file ("artifact") on Azure Devops and pushes any containers to our Docker registry. This pipeline is enabled for all branches. -- `azure-pr-pipeline.yml`: Deploys ephemeral versions of your proxy/spec to Apigee (and docker containers on AWS) to internal environments. This will deploy a internal-dev environment and internal-dev-sandbox for each pull request. -- `azure-release-pipeline.yml`: Deploys the long-lived version of your pipeline to internal and external environments, when you merge to master. +- `azure-build-pipeline.yml`: Assembles the contents of your repository into a single file ("artifact") on Azure Devops and pushes any containers to our Docker registry. This pipeline is enabled for all branches. +- `azure-pr-pipeline.yml`: Deploys ephemeral versions of your proxy/spec to Apigee (and docker containers on AWS) to internal environments. This will deploy a internal-dev environment and internal-dev-sandbox for each pull request. +- `azure-release-pipeline.yml`: Deploys the long-lived version of your pipeline to internal and external environments, when you merge to master. `/azure/templates`: Here you can define reusable actions, such as running tests, and call these actions during Azure Devops pipelines. diff --git a/README.md b/README.md index 23078757..36064a71 100644 --- a/README.md +++ b/README.md @@ -8,21 +8,21 @@ This repository does _not_ include the Validated Relationship Service FHIR API b ## Table of Contents -- [Validated Relationship Service API](#validated-relationship-service-api) - - [Table of Contents](#table-of-contents) - - [Repository Structure](#repository-structure) - - [Contributing](#contributing) - - [Development \& Testing](#development--testing) - - [Licensing](#licensing) +- [Validated Relationship Service API](#validated-relationship-service-api) + - [Table of Contents](#table-of-contents) + - [Repository Structure](#repository-structure) + - [Contributing](#contributing) + - [Development \& Testing](#development--testing) + - [Licensing](#licensing) ## Repository Structure This repository includes: -- [specification/validated-relationships-service-api.yaml](./specification/validated-relationships-service-api.yaml) - The [Open API Specification](https://swagger.io/docs/specification/about/) describes the endpoints, methods and messages exchanged by the API. Used to generate interactive documentation for the NHS API Catalogue; the contract between the API and its consumers. -- `sandbox/` - A flask (Python) API that implements a mock implementation of the service. It's to be used as interactive documentation to illustrate interactions and concepts. It is not intended to provide an exhaustive/faithful environment suitable for full development and testing. -- `scripts/` - Utilities helpful to developers for the development and release of the specification. -- `proxies/` - Live and sandbox Apigee API Proxy definitions. +- [specification/validated-relationships-service-api.yaml](./specification/validated-relationships-service-api.yaml) - The [Open API Specification](https://swagger.io/docs/specification/about/) describes the endpoints, methods and messages exchanged by the API. Used to generate interactive documentation for the NHS API Catalogue; the contract between the API and its consumers. +- `sandbox/` - A flask (Python) API that implements a mock implementation of the service. It's to be used as interactive documentation to illustrate interactions and concepts. It is not intended to provide an exhaustive/faithful environment suitable for full development and testing. +- `scripts/` - Utilities helpful to developers for the development and release of the specification. +- `proxies/` - Live and sandbox Apigee API Proxy definitions. ## Contributing diff --git a/SECURITY.md b/SECURITY.md index 2d5561a4..7de9d497 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -19,8 +19,8 @@ reproduce it. You can reach us at: -- cybersecurity@nhs.net -- api.management@nhs.net +- cybersecurity@nhs.net +- api.management@nhs.net ### HackerOne diff --git a/sandbox/README.md b/sandbox/README.md index a87e223c..7f1cbfee 100644 --- a/sandbox/README.md +++ b/sandbox/README.md @@ -7,17 +7,17 @@ For more information about building sandbox APIs see the [API Producer Zone conf ## Table of Contents - [Sandbox](#sandbox) - - [Table of Contents](#table-of-contents) - - [Architecture](#architecture) - - [Prerequisites](#prerequisites) - - [Quick Start](#quick-start) - - [Installing dependencies](#installing-dependencies) - - [Starting the API](#starting-the-api) - - [Development](#development) - - [Starting the API with Hot Reloading](#starting-the-api-with-hot-reloading) - - [Testing](#testing) - - [Unit Tests](#unit-tests) - - [Useful commands](#useful-commands) + - [Table of Contents](#table-of-contents) + - [Architecture](#architecture) + - [Prerequisites](#prerequisites) + - [Quick Start](#quick-start) + - [Installing dependencies](#installing-dependencies) + - [Starting the API](#starting-the-api) + - [Development](#development) + - [Starting the API with Hot Reloading](#starting-the-api-with-hot-reloading) + - [Testing](#testing) + - [Unit Tests](#unit-tests) + - [Useful commands](#useful-commands) ## Architecture @@ -31,9 +31,9 @@ The [Postman Collection](./postman/Validate_Relationship_Service_Sandbox.postman ## Prerequisites -- Python 3.8 -- [Poetry](https://python-poetry.org/docs/) -- [Docker](https://docs.docker.com/get-docker/) +- Python 3.8 +- [Poetry](https://python-poetry.org/docs/) +- [Docker](https://docs.docker.com/get-docker/) ## Quick Start