This document provides comprehensive guidelines for managing dependencies in transcript-create, including automated updates, security patching, and version policies.
- Overview
- Automated Dependency Updates
- Adding New Dependencies
- Updating Dependencies
- Security Patch Handling
- Version Policy
- Dependency Freshness Monitoring
- Testing Updates
- Breaking Changes
- Troubleshooting
transcript-create uses multiple dependency management systems:
- Python (pip): API and worker backend dependencies
- npm: Frontend, E2E tests, and SDK dependencies
- Docker: Base images for containerized deployments
- GitHub Actions: CI/CD workflow actions
All dependencies are managed with automated updates via Dependabot and manual security monitoring.
Dependabot is configured in .github/dependabot.yml to automatically create pull requests for dependency updates.
| Ecosystem | Frequency | Day | Time (UTC) | PR Limit |
|---|---|---|---|---|
| Python (pip) | Weekly | Monday | 09:00 | 10 |
| npm (all) | Weekly | Monday | 09:00 | 5-10 |
| Docker | Monthly | Monday | 09:00 | 3 |
| GitHub Actions | Monthly | Monday | 09:00 | 5 |
To reduce PR noise, Dependabot groups updates:
- Patch updates: All patch version updates (e.g., 1.2.3 → 1.2.4) are grouped
- Minor updates: All minor version updates (e.g., 1.2.0 → 1.3.0) are grouped
- Major updates: Each major version update gets a separate PR for careful review
All Dependabot PRs are automatically labeled for easy filtering:
dependencies: All dependency updatespython: Python packagesjavascript: npm packagesdocker: Docker imagesci: GitHub Actionsfrontend,testing,sdk,tooling: Specific subsystems
Maintainer @onnwee is automatically assigned as reviewer for Python, Docker, and frontend PRs.
- Creation: Dependabot scans for updates weekly/monthly and opens PRs
- CI Validation: All PRs automatically trigger CI workflows
- Security Scanning: Automated security scans run on all PRs
- Review: Maintainers review changelog and test results
- Merge: If tests pass and changes are acceptable, PR is merged
- Deployment: Changes are deployed with the next release
When reviewing a Dependabot PR:
- Check CI Status: Ensure all tests pass
- Review Changelog: Read the linked release notes for breaking changes
- Check Compatibility: Verify compatibility with other dependencies
- Test Locally: For major updates, test locally before merging
- Merge or Postpone: Merge if safe, or postpone with a comment explaining why
-
Choose the right package:
# Research alternatives pip search <package-name> # Check PyPI for package health: https://pypi.org/project/<package>
-
Check security status:
# Use the gh-advisory-database tool (run automatically in CI) # Or manually check: https://github.com/advisories
-
Install and pin exact version:
pip install <package>==<version>
-
Add to requirements.txt with pinned version:
# Add with a comment explaining purpose # Example: PDF generation reportlab==4.4.4
-
Update constraints.txt:
# In a clean virtual environment python3 -m venv /tmp/venv-deps source /tmp/venv-deps/bin/activate pip install --upgrade pip pip install -r requirements.txt pip freeze > constraints.txt deactivate
-
Test the change:
# Run tests pytest # Run security scans pip-audit -r requirements.txt bandit -r app/ worker/
-
Document why: If the dependency is not obvious, add a comment in requirements.txt
For testing, linting, or development-only tools:
- Add to
requirements-dev.txtwith pinned version - Follow the same security checking process
- No need to update constraints.txt (production only)
-
Navigate to frontend directory:
cd frontend -
Install with exact version:
# For production dependencies npm install --save-exact <package>@<version> # For dev dependencies npm install --save-exact --save-dev <package>@<version>
-
Verify package-lock.json is updated
-
Run tests:
npm run test npm run lint npm run build -
Commit both package.json and package-lock.json
Follow the same process in the respective directory.
Docker base images are defined in Dockerfiles:
Dockerfile(ROCm/AMD GPU)Dockerfile.cuda(CUDA/NVIDIA GPU)Dockerfile.cpu(CPU-only)
To update base image:
-
Choose specific tag (never use
latest):# Good: specific version FROM rocm/dev-ubuntu-22.04:6.0.2 # Bad: moving target FROM rocm/dev-ubuntu-22.04:latest
-
Test build:
docker compose build
-
Test runtime:
docker compose up -d docker compose logs -f worker
-
Update related dependencies (e.g., PyTorch ROCm wheels)
Actions are defined in .github/workflows/*.yml files.
To add new action:
-
Pin to major version with SHA for security:
# Recommended: major version + SHA - uses: actions/checkout@v4.2.0 # SHA: a1b2c3d... # Also acceptable: major version only (Dependabot will update) - uses: actions/checkout@v4
-
Test workflow:
- Push to a branch
- Verify workflow runs successfully in GitHub Actions
Dependabot handles most updates automatically. For manual updates:
# Update specific package
pip install --upgrade <package>==<new-version>
# Update requirements.txt
pip freeze | grep <package> >> requirements.txt
# Regenerate constraints.txt
python3 -m venv /tmp/venv-deps
source /tmp/venv-deps/bin/activate
pip install -r requirements.txt
pip freeze > constraints.txtcd frontend # or e2e, clients/javascript, etc.
# Update specific package
npm install <package>@<new-version>
# Update all packages (respecting semver ranges)
npm update
# Check for outdated packages
npm outdatedUpdate version in Dockerfile, then rebuild:
docker compose build --no-cache
docker compose up -d
docker compose logs -fBefore merging any dependency update:
-
Run all tests:
# Python tests pytest # Frontend tests cd frontend && npm run test # E2E tests cd e2e && npm run test # Integration tests docker compose up -d # Run integration test suite
-
Run security scans:
# Python pip-audit -r requirements.txt bandit -r app/ worker/ # npm (if vulnerabilities exist) npm audit
-
Build Docker images:
docker compose build
-
Manual smoke testing:
- Start the application
- Create a test job
- Verify transcription works
- Check logs for errors
| Severity | Response Time | Action Required |
|---|---|---|
| CRITICAL | 24 hours | Immediate patch, emergency release |
| HIGH | 7 days | Prioritized patch, expedited release |
| MEDIUM | 30 days | Regular update cycle |
| LOW | Next release | Include in next scheduled release |
-
Notification:
- GitHub Security Advisories (enabled)
- Dependabot alerts (enabled)
- Weekly security-audit.yml workflow runs
- Email notifications to maintainers
-
Assessment:
- Review advisory details
- Determine impact on transcript-create
- Check if vulnerability is exploitable in our usage
- Classify severity (may differ from upstream)
-
Patching:
- Create emergency branch:
security/CVE-YYYY-XXXXX - Update affected dependency
- Run security scans to verify fix
- Run full test suite
- Create PR with
securitylabel
- Create emergency branch:
-
Deployment:
- Merge to main after tests pass
- Trigger immediate deployment
- Create security release notes
- Notify users if action required
-
Documentation:
- Update CHANGELOG.md with security fix
- Document workarounds if any
- Update SECURITY.md if relevant
Run security scans locally:
# Python dependency vulnerabilities
pip-audit -r requirements.txt --desc
# Python code security issues
bandit -r app/ worker/ -ll
# Check for secrets
gitleaks detect --source . -v
# npm audit (in each npm directory)
cd frontend && npm audit
cd ../e2e && npm audit
cd ../clients/javascript && npm auditIf a security advisory doesn't apply:
- Document why in a comment
- Create an ignore rule if needed
- Monitor for future updates
- Re-evaluate on next dependency update
We follow Semantic Versioning (MAJOR.MINOR.PATCH):
- PATCH (1.2.3 → 1.2.4): Bug fixes, security patches (safe to auto-merge)
- MINOR (1.2.0 → 1.3.0): New features, backward compatible (review changelog)
- MAJOR (1.0.0 → 2.0.0): Breaking changes (test thoroughly, plan migration)
| Dependency Type | Strategy | Rationale |
|---|---|---|
| Python (requirements.txt) | Exact version (==) | Reproducible builds, security auditing |
| Python (requirements-dev.txt) | Exact version (==) | Consistent dev environments |
| npm (package.json) | Caret (^) or exact | Balance flexibility and stability |
| Docker base images | Specific tag | Immutable infrastructure |
| GitHub Actions | Major version (@v4) | Security + compatibility |
- Python: Minimum Python 3.12
- Node.js: Minimum Node.js 18 LTS
- Docker: Docker Compose v2
- Browsers (frontend): Last 2 versions of major browsers
When deprecating dependencies:
- Announce in release notes (MINOR version)
- Provide migration guide
- Mark as deprecated (MINOR version)
- Remove in next MAJOR version
- Keep documentation for 2 major versions
Monitor dependency health with these metrics:
- Version lag: How far behind latest versions
- Security lag: Time since last security patch
- Outdated count: Number of outdated dependencies
- Abandoned packages: Dependencies with no updates in >1 year
# List all outdated packages
pip list --outdated
# Check for newer versions
pip install pip-review
pip-review# Check outdated packages
npm outdated
# Or use npm-check-updates
npx npm-check-updates- Dependabot: Weekly scans and automatic PRs
- Security workflows: Weekly security-audit.yml runs
- Dependency dashboard: View in GitHub Insights → Dependency graph
- ✅ 90% of dependencies up-to-date (patch versions)
- ✅ Zero known HIGH/CRITICAL vulnerabilities
- ✅ <7 day response time to security updates
- ✅ All dependencies updated at least once per quarter
All Dependabot PRs automatically trigger:
-
Backend CI (
.github/workflows/backend-ci.yml):- Python linting (ruff, black, isort, mypy)
- Unit tests (pytest)
- Security scans (bandit, pip-audit)
-
Frontend CI (
.github/workflows/frontend-ci.yml):- TypeScript compilation
- ESLint
- Unit tests (vitest)
- Build verification
-
Integration Tests (
.github/workflows/integration-tests.yml):- Docker compose build
- API integration tests
- Worker pipeline tests
-
E2E Tests (
.github/workflows/e2e-tests.yml):- Playwright browser tests
- Full user workflows
For major updates or security patches, test manually:
- Application starts successfully
- API endpoints respond correctly
- Job creation works
- Worker processes videos
- Transcription completes
- Frontend loads and functions
- Authentication works
- Export features work
- No errors in logs
Test updates in staging before production:
- Deploy to staging environment
- Run smoke tests
- Monitor for 24 hours
- Check error rates and performance
- Deploy to production if stable
Review changelogs for these indicators:
- Major version bumps (1.x → 2.x)
- "BREAKING CHANGE" in release notes
- Removal of deprecated features
- API changes requiring code updates
- Configuration format changes
-
Plan Migration:
- Read migration guide from upstream
- Identify affected code
- Estimate effort and risk
-
Create Migration Branch:
git checkout -b feature/migrate-<package>-v<version>
-
Update Code:
- Make necessary changes
- Update tests
- Update documentation
-
Test Thoroughly:
- Run full test suite
- Manual testing of affected features
- Performance testing if relevant
-
Document Changes:
- Update CHANGELOG.md
- Update relevant documentation
- Add migration guide if needed
-
Communicate:
- Notify team in PR
- Update deployment runbook if needed
- Mention in release notes
Before deploying breaking changes:
- Document current state
- Tag release before changes
- Have rollback commands ready
- Monitor deployment closely
- Be prepared to roll back if issues arise
Symptom: pip install fails with conflict errors
Solution:
# Check for conflicts
pip check
# See dependency tree
pip install pipdeptree
pipdeptree
# Try resolving with constraints
pip install -r requirements.txt -c constraints.txtSymptom: Docker build fails after dependency update
Solution:
# Clear build cache
docker compose build --no-cache
# Check for breaking changes in changelog
# Revert if necessary
git revert <commit>
# Or pin to working version
# Edit requirements.txt or package.jsonSymptom: Tests pass locally but fail in CI
Solution:
# Ensure consistent environment
# Regenerate constraints.txt
pip freeze > constraints.txt
# Clear npm cache
npm ci # instead of npm install
# Check for timing issues in tests
pytest -v # verbose outputSymptom: Security scan flags vulnerability that doesn't apply
Solution:
- Document why it's a false positive
- Add suppression if appropriate:
# pip-audit pip-audit --ignore-vuln <VULN-ID> # bandit # Add # nosec comment in code
- Report false positive upstream
Symptom: No PRs from Dependabot for weeks
Solution:
- Check Dependabot logs in GitHub Insights → Dependency graph
- Verify
.github/dependabot.ymlsyntax - Check if PRs are blocked by existing PRs
- Ensure repository has Dependabot enabled in Settings
Symptom: Dependabot PR has conflicts
Solution:
# Dependabot can rebase automatically
# Comment on the PR:
# @dependabot rebase
# Or merge manually:
git checkout <dependabot-branch>
git rebase main
git push --force-with-leaseFor dependency-related issues:
- Check this guide first
- Review ../dependencies.md for technical details
- Search GitHub Issues for similar problems
- Check CI logs for detailed error messages
- Ask in Discussions for community help
- Open an Issue with:
- Dependency versions
- Error messages
- Steps to reproduce
- Environment details (Python version, Node version, OS)
- Technical Dependency Details - Deep dive into dependency structure
- Release Process - How releases are managed
- Security Guide - Security best practices
- Contributing Guidelines - How to contribute