Documentation Index
Fetch the complete documentation index at: https://mintlify.com/GingerlyData247/SOTeam4-P2/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Trustworthy Model Registry uses GitHub Actions for automated CI/CD workflows. The system includes continuous integration for pull requests, continuous deployment to AWS on merges to main, and automated dependency management.Architecture
The CI/CD pipeline consists of four main workflows:- CI - Automated testing and linting on pull requests
- Backend CD - Deploy FastAPI backend to AWS Lambda
- Frontend CD - Deploy static frontend to S3
- Dependabot - Automated dependency updates
Continuous Integration (CI)
Workflow: .github/workflows/ci.yml
The CI workflow runs automatically on every pull request targeting the main branch.
Workflow configuration:
CI Steps
- Checkout - Retrieves the code from the pull request
- Setup Python 3.11 - Installs Python runtime
- Install dependencies - Installs all required packages from
requirements.txt - Run tests - Executes the full pytest test suite with
PYTHONPATH=.for correct imports - Optional lint - Runs flake8 linting (non-blocking)
Pull Request Checks
The CI workflow must pass before a pull request can be merged. It validates:- All tests pass successfully
- No import errors or syntax issues
- Code follows basic style guidelines (optional linting)
Test Execution
Tests are run with minimal output using the-q (quiet) flag:
PYTHONPATH=. ensures imports from src/ work correctly during test execution.
Coverage Thresholds
While coverage reports can be generated locally usingpytest-cov, the CI workflow currently runs tests without explicit coverage enforcement. To add coverage reporting to CI:
Continuous Deployment (CD)
Backend Deployment to AWS Lambda
Workflow:.github/workflows/lambda_deploy.yml
Automatically deploys the FastAPI backend to AWS Lambda when backend source files or dependencies change on the main branch.
Triggers:
- Pushes to
mainaffecting:src/**requirements.txt.github/workflows/lambda_deploy.yml
- Manual execution via
workflow_dispatch
- OIDC Authentication - Uses GitHub Actions OIDC to securely assume an AWS IAM role (no long-lived credentials)
- Lambda-compatible Build - Installs dependencies into a build directory compatible with Lambda’s Python runtime
- ZIP Packaging - Packages application code and dependencies into a ZIP archive
- In-place Update - Updates the deployed Lambda function without recreating infrastructure
AWS_ROLE_ARN- IAM role ARN for OIDC authenticationLAMBDA_FUNCTION_NAME- Name of the Lambda function to update
Frontend Deployment to S3
Workflow:.github/workflows/frontend_deploy.yml
Automatically deploys static frontend assets to the S3 hosting bucket when frontend files change.
Triggers:
- Pushes to
mainaffecting:index.html*.html*.js*.cssassets/**.github/workflows/frontend_deploy.yml
- Manual execution via
workflow_dispatch
- Selective Sync - Excludes backend code, tests, and configuration files
- Delete Flag - Removes files from S3 that no longer exist in the repository
- OIDC Authentication - Secure authentication without static AWS credentials
Dependabot Configuration
Configuration:.github/workflows/dependabot.yml
Automatically checks for outdated dependencies and opens pull requests to keep the project up to date.
Configured Ecosystems
- Python (pip) - Updates dependencies in
requirements.txt - GitHub Actions - Updates action versions in workflow files
Update Policy
- Daily checks - Scans for updates every day
- Maximum 5 open PRs per ecosystem
- Version increase strategy - Prioritizes version bumps for Python packages
Handling Dependabot PRs
- Dependabot opens a pull request with dependency updates
- CI workflow runs automatically on the PR
- Review the changes and test results
- Merge if tests pass and changes are acceptable
Code Quality Tools
Linting with flake8
The CI workflow includes optional linting withflake8:
- Maximum line length: 120 characters
- Non-blocking (uses
|| trueto prevent failures)
Additional Tools
While not enforced in CI, the project supports additional quality tools:- pytest-cov - Code coverage analysis
- GitHub Copilot Auto-Review - Automated PR feedback
- Microsoft Accessibility Insights - ADA compliance testing
Manual Deployment
Both CD workflows support manual execution viaworkflow_dispatch.
Trigger Manual Deployment
- Navigate to Actions tab in GitHub
- Select the workflow (e.g., “CD - Deploy API to Lambda”)
- Click Run workflow
- Select the branch (usually
main) - Click Run workflow button
AWS Infrastructure Requirements
IAM Role for OIDC
Create an IAM role with trust policy for GitHub Actions OIDC:Required Permissions
Backend deployment:lambda:UpdateFunctionCodelambda:GetFunction
s3:PutObjects3:DeleteObjects3:ListBucket
Monitoring Deployments
GitHub Actions Logs
- Navigate to Actions tab
- Select the workflow run
- View logs for each step
AWS Lambda
Monitor backend deployments in AWS:S3 Bucket
Verify frontend deployment:Troubleshooting
CI Failures
Tests failing:- Check test logs in GitHub Actions
- Run tests locally:
PYTHONPATH=. pytest -v - Verify all dependencies are in
requirements.txt
- Ensure
PYTHONPATH=.is set in CI workflow - Check
pytest.iniconfiguration
Deployment Failures
AWS authentication errors:- Verify
AWS_ROLE_ARNsecret is correct - Check IAM role trust policy allows GitHub Actions OIDC
- Ensure role has required permissions
- Check Lambda function exists and name is correct
- Verify deployment package size is under Lambda limits (50MB zipped, 250MB unzipped)
- Review CloudWatch logs for runtime errors
- Verify bucket exists and name is correct
- Check bucket permissions and policies
- Ensure region matches (
us-east-2)
Best Practices
- Test locally before pushing - Run
pytestbefore creating PRs - Review Dependabot PRs - Don’t auto-merge dependency updates
- Monitor deployments - Check CloudWatch and application health after deployments
- Use workflow_dispatch - Manually trigger deployments when needed
- Keep workflows simple - Separate concerns (CI, backend CD, frontend CD)
- Secure secrets - Use OIDC instead of long-lived AWS credentials