Starter patterns for using machine learning signals to improve CI/CD reliability, reduce wasted build time, and predict deployment risk before changes reach production.
This repository supports the Daily DevOps guide: https://www.daily-devops.com/ai-driven-cicd-pipeline-optimization-quality-prediction/
- Build failure prediction from change and pipeline metadata
- Intelligent test selection based on changed files and service ownership
- Deployment risk scoring with clear approval thresholds
- AWS CodeBuild and GitHub Actions integration examples
- Guardrails for keeping AI recommendations explainable and auditable
source control and CI events
-> feature extraction
-> build and quality risk scoring
-> test selection
-> deployment recommendation
-> approval or automation gate
-> outcome learning
Use the included Python module as a starting point for deterministic scoring before replacing individual rules with trained models.
python3 src/optimizer.pyThe example prints a risk assessment and selected test plan for a sample change set.
- Amazon SageMaker for custom build and quality prediction models
- AWS CodeGuru for code quality and performance findings
- AWS CodeBuild for build execution and metadata capture
- AWS CodePipeline for deployment gates and orchestration
- Amazon EventBridge for CI/CD event routing
- Amazon S3 or DynamoDB for feature and outcome history
Start in advisory mode. Show recommendations to developers and release managers before allowing automated gates. Promote only low-risk, high-confidence recommendations into automation.
Recommended controls:
- Require explanation fields for every recommendation
- Keep production deployment blocks reviewable
- Track false positives and false negatives
- Separate model confidence from business risk
- Store outcome data after every build and deployment
src/optimizer.py Risk scoring and test selection example
examples/github-actions.yml GitHub Actions integration pattern
templates/codebuild-buildspec.yml AWS CodeBuild integration pattern