Dependency Update Strategy for RING-5
π― Overview
This guide explains how to keep RING-5βs dependencies up-to-date automatically and safely.
π€ Automated Solutions Implemented
1. Dependabot (RECOMMENDED)
Location: .github/dependabot.yml
What it does:
- β Automatically checks for updates weekly (every Monday at 9 AM)
- β Creates individual PRs for security updates
- β Groups minor/patch updates together (reduces PR spam)
- β Separates dev dependencies from production dependencies
- β Automatically updates GitHub Actions versions
- β Runs your CI pipeline for each PR (auto-validates changes)
Configuration:
- Production deps (pandas, numpy, streamlit, plotly): Grouped together
- Dev deps (black, mypy, pytest): Grouped separately
- Major updates: Individual PRs (require manual review)
- PR limit: 10 open PRs max
How to use:
- Dependabot creates a PR β βdeps: Update pandas from 2.3.3 to 2.4.0β
- GitHub Actions runs automatically (tests, type checking, linting)
- If β green: Review and merge
- If β red: Review breaking changes, fix code, merge
Pros:
- π Free for public repos
- π Fully automated
- π§ͺ Auto-tested via CI
- π Security-focused
- π§ Email notifications
Cons:
- Can create many PRs (mitigated by grouping)
- Major version bumps need manual review
2. Dependency Check Workflow
Location: .github/workflows/dependency-check.yml
What it does:
- π Weekly report of outdated packages
- π Security vulnerability scanning via
pip-audit - π Creates GitHub issues when updates are needed
- π€ Uploads outdated package list as artifact
Trigger:
- Automatically: Every Monday at 9 AM UTC
- Manually: GitHub UI β Actions β βDependency Update Checkβ β Run workflow
Output:
- Summary in Actions tab
- GitHub issue with list of outdated packages
- Downloadable artifact with full details
3. Manual Commands (Makefile)
New commands added:
# Check what's outdated
make check-outdated
# Update all dependencies (careful!)
make update-deps
# Security audit
make security-audit
# View dependency tree
make show-deps
π Update Strategy Recommendations
For Production Dependencies (pandas, numpy, streamlit, plotly)
Conservative Approach (RECOMMENDED for RING-5):
# pyproject.toml
dependencies = [
"pandas>=2.3.3,<3.0", # Allow minor updates, block major
"numpy>=2.4.1,<3.0",
"streamlit>=1.53.1,<2.0",
"plotly>=6.5.2,<7.0",
]
Why?
- Major versions often have breaking changes
- Scientific computing tools (pandas/numpy) need stability
- Publication-quality plots must remain reproducible
For Dev Tools (black, mypy, flake8, pytest)
Aggressive Approach:
dev = [
"pytest>=9.0.2", # Always use latest
"black>=26.1.0",
"mypy>=1.13.0",
"flake8>=7.3.0",
]
Why?
- Dev tools rarely break your code
- Better type checking and linting over time
- New features improve DX
π Recommended Workflow
Weekly Routine (Automated via Dependabot)
- Monday morning: Dependabot creates PRs
- CI runs automatically: Tests, type checking, linting
- You review:
- β Green CI + patch/minor update β Merge immediately
- β οΈ Green CI + major update β Review changelog, test locally, merge
- β Red CI β Investigate breaking changes, fix code, merge
Monthly Routine (Manual Review)
# 1. Check what's outdated
make check-outdated
# 2. Security audit
make security-audit
# 3. If critical security issues, update immediately:
./python_venv/bin/pip install --upgrade <package>
# 4. Test everything
make test
mypy src/ --strict
black --check src/ tests/
π¨ When to Update Immediately
Security Vulnerabilities:
pip-auditreports CVE β Update ASAP- Dependabot Security Alert β Update ASAP
Critical Bugs:
- Blocker bug in your dependency β Update to patched version
New Python Version Support:
- Python 3.13 released β Update dependencies for compatibility
β οΈ Caution: Major Version Updates
Before updating to major versions (e.g., pandas 2.x β 3.x):
- Read changelog: Look for breaking changes
- Check deprecations: See what APIs changed
- Test locally:
./python_venv/bin/pip install pandas==3.0.0 make test mypy src/ --strict ./launch_webapp.sh # Manual testing - Create dedicated PR: Donβt mix with other changes
- Update documentation: If APIs changed
π Monitoring Dashboard
View dependency health:
- GitHub Security Tab: Shows vulnerability alerts
- Actions Tab β Dependency Check: Weekly reports
- Dependabot PRs: Shows pending updates
- Issues with
dependencieslabel: Update tracking
π§ Configuration Tuning
If too many PRs
Edit .github/dependabot.yml:
open-pull-requests-limit: 5 # Reduce from 10
schedule:
interval: "monthly" # Reduce frequency
If you want auto-merge for patches
Add to .github/workflows/:
name: Auto-merge Dependabot
on: pull_request
jobs:
auto-merge:
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- name: Auto-merge patch updates
if: contains(github.event.pull_request.title, 'deps: Update') && contains(github.event.pull_request.title, 'patch')
run: gh pr merge --auto --squash "$PR_URL"
π Resources
β Next Steps
- Enable Dependabot (already configured):
- GitHub repo β Settings β Code security β Enable Dependabot
- Or just push the
.github/dependabot.ymlfile
-
Test the workflows:
# Trigger dependency check manually gh workflow run dependency-check.yml -
Review current state:
make check-outdated make security-audit - Merge this PR and let automation handle future updates!