AWS Lambda function for document processing (privacy, metadata stripping, etc.).
# From project root
./run-tests.shThis builds the test Docker image with all required system dependencies (including pdfcpu for PDF processing) and runs the complete test suite in the same environment used in CI/CD, ensuring consistency between local development and deployment.
You can test the Lambda locally using Docker:
script/serverwill start the server and
script/upload document_cleanser_lambda/test-event.json
will submit a valid Lambda event payload to your handler (see AWS docs for examples).
Output will be at the same filename with .output.json appended.
Install and run pre-commit hooks to ensure code quality:
pip install pre-commit
pre-commit install
pre-commit run --all-filesDependencies should be managed by renovate (see renovate.json).
If you need to update dependencies, run poetry update; see pyproject.toml
Ensure all tests pass locally before opening a PR via ./script/test
Follow repo and code style guidelines.
Document new environment variables or requirements in the README.
- Update the code
- Create a branch
release/v{major}.{minor}.{patch} - Update the version number in
document_cleanser_lambda/lambda_function.py - Update
CHANGELOG.mdfor the release - Commit and push
- Open a PR from that branch to main
- Get approval on the PR
- Create a branch
- Create a GitHub Release
- Create a new tag on main with the same version number.
- Generate release notes
- Publish the release
- Deploy to production
- Go to the docker-build-and-deploy action
- Run a workflow using the newly tagged released against production
- Get approval for the action
- Changes to the
mainbranch are deployed to staging. - Creating a new Github version and running a GitHub action is required for deploying to production.