Dependabot Guide for datason¶
๐ค Overview¶
Dependabot is GitHub's automated dependency update service that helps keep datason's dependencies current and secure. It automatically scans for outdated dependencies and creates pull requests to update them.
๐ฏ datason's Dependency Strategy¶
datason follows a minimal core, modern tooling philosophy:
- Core Dependencies: Minimal to zero - datason works without any required dependencies
- Optional Dependencies: Updated conservatively (ML libraries need compatibility testing)
- Development Dependencies: Updated aggressively (latest tooling for best developer experience)
๐ Dependabot Configuration¶
Update Schedules¶
Category | Frequency | Target Branch | Rationale |
---|---|---|---|
Core/Optional Dependencies | Monthly | develop |
Conservative updates for stability |
Development Dependencies | Weekly | develop |
Latest tooling for productivity |
GitHub Actions | Weekly | develop |
Security and feature updates |
Documentation | Monthly | develop |
Stability for docs generation |
Special Handling¶
ML Libraries (Conservative)¶
ignore:
- dependency-name: "torch"
update-types: ["version-update:semver-major"]
- dependency-name: "tensorflow"
update-types: ["version-update:semver-major"]
- dependency-name: "jax"
update-types: ["version-update:semver-major"]
Why? ML libraries often have breaking changes between major versions and require extensive compatibility testing.
๐ Integration with CI/CD Pipelines¶
When Dependabot creates a PR, it automatically triggers our CI/CD pipelines:
graph TD
A[Dependabot Creates PR] --> B[๐ Quality Pipeline]
A --> C[๐งช Main CI Pipeline]
B --> B1[Ruff Linting]
B --> B2[Security Scanning]
B --> B3[Pre-commit Checks]
C --> C1[Multi-Python Testing]
C --> C2[Coverage Analysis]
C --> C3[Package Building]
C --> C4[Optional Dependency Tests]
B1 --> D{All Checks Pass?}
B2 --> D
B3 --> D
C1 --> D
C2 --> D
C3 --> D
C4 --> D
D -->|Yes| E[โ
Ready for Review]
D -->|No| F[โ Investigation Needed]
Pipeline Validation¶
- Quality Pipeline (~30-60s)
- Code formatting with Ruff
- Security scanning with Bandit
-
Linting and style checks
-
Main CI Pipeline (~2-3 min)
- Tests across Python 3.8-3.13
- Coverage analysis with Codecov
- Optional dependency compatibility
- Package building and validation
๐ Reviewing Dependabot PRs¶
Automatic Approval Criteria¶
Safe to merge automatically when: - โ All CI pipelines pass - โ Minor/patch version updates - โ Development dependencies (pytest, ruff, mypy, etc.) - โ GitHub Actions updates - โ Documentation dependencies
Manual Review Required¶
Requires investigation when: - โ CI pipeline failures - โ ๏ธ Major version updates - โ ๏ธ Core/optional dependency changes - โ ๏ธ Security advisories mentioned
Review Checklist¶
For Development Dependencies¶
# Quick verification
git checkout pr-branch
pip install -e ".[dev]"
pytest # Run tests
ruff check . # Verify linting
ruff format --check . # Verify formatting
For Optional Dependencies¶
# Extended testing
pip install -e ".[ml]" # Install with ML dependencies
pytest tests/test_optional_dependencies.py # ML integration tests
pytest tests/test_ml_serializers.py # ML serialization tests
For Core Dependencies¶
# Full regression testing
pip install -e . # Minimal install
pytest # All tests should pass
pytest --cov=datason --cov-fail-under=80 # Coverage check
๐ Common Dependabot Scenarios¶
Scenario 1: Weekly Dev Dependency Updates¶
Example PR: "Bump ruff from 0.1.6 to 0.1.8"
Action: 1. Verify CI passes โ 2. Auto-merge if no breaking changes 3. Monitor for any formatting conflicts
Scenario 2: Monthly ML Library Update¶
Example PR: "Bump torch from 2.0.0 to 2.1.0"
Action: 1. Review release notes for breaking changes 2. Run extended ML tests locally 3. Test with major ML frameworks 4. Manual merge after validation
Scenario 3: GitHub Actions Security Update¶
Example PR: "Bump actions/checkout from v3 to v4"
Action: 1. Verify no workflow syntax changes needed 2. Check CI pipeline compatibility 3. Auto-merge if tests pass
Scenario 4: Major Version Update¶
Example PR: "Bump pytest from 7.4.0 to 8.0.0"
Action: 1. Read migration guide 2. Check for pytest plugin compatibility 3. Run full test suite 4. Update configurations if needed 5. Manual merge after thorough testing
๐ง Managing Dependabot¶
Enabling/Disabling Updates¶
# Temporarily pause all updates
gh api repos/:owner/:repo/vulnerability-alerts -X DELETE
# Re-enable updates
gh api repos/:owner/:repo/vulnerability-alerts -X PUT
Customizing Update Frequency¶
Edit .github/dependabot.yml
:
schedule:
interval: "daily" # daily, weekly, monthly
day: "monday" # For weekly/monthly
time: "09:00" # UTC time
Ignoring Specific Updates¶
ignore:
- dependency-name: "problematic-package"
versions: ["2.0.0"] # Ignore specific version
- dependency-name: "another-package"
update-types: ["version-update:semver-major"] # Ignore major updates
๐ Monitoring and Metrics¶
Security Alerts¶
Dependabot automatically creates security advisories PRs for: - Known vulnerabilities - Outdated packages with security fixes - Dependencies with security patches
Update Statistics¶
Track update patterns: - Development deps: ~3-5 PRs/week (expected) - Optional deps: ~1-2 PRs/month (manageable) - GitHub Actions: ~1 PR/week (security-focused)
๐จ Troubleshooting¶
Common Issues¶
1. CI Failures After Update¶
Symptom: Tests fail after dependency update Solution:
# Check for breaking changes
git log --oneline dependency-name
# Review release notes
# Update code/tests as needed
2. Conflicting PRs¶
Symptom: Multiple Dependabot PRs conflict Solution:
# Merge compatible updates first
# Close conflicting PRs (Dependabot will recreate)
# Handle major updates separately
3. Pre-commit Conflicts¶
Symptom: Formatting issues after updates Solution:
๐ Benefits for datason¶
Security¶
- Automated vulnerability patching
- Security advisory notifications
- Dependency audit trail
Maintenance¶
- Reduced manual dependency management
- Consistent update cadence
- Breaking change notifications
Quality¶
- CI validation of all updates
- Regression testing automation
- Compatibility verification
Productivity¶
- Latest developer tooling
- Automated routine updates
- Focus on feature development
๐ Related Documentation¶
๐ก Tip: Enable GitHub notifications for Dependabot PRs to stay informed about important security updates and dependency changes.
โ๏ธ Configuration Overview¶
datason uses a unified Dependabot strategy with smart update rules:
๐ฆ Python Dependencies¶
- Schedule: Weekly updates every Monday
- Target:
main
branch (for faster integration) - Strategy: Unified configuration for all Python packages
- Conservative approach for ML/data science libraries
- Aggressive updates for development tools
๐ GitHub Actions¶
- Schedule: Weekly updates every Tuesday
- Target:
main
branch - Updates: All workflow actions and runners
๐ฏ Smart Update Strategy¶
Conservative Updates (Major Versions Blocked)¶
# ML Libraries - Careful version management
- torch, tensorflow, jax, scikit-learn
- pandas, numpy # Core data science