# CI/CD Pipeline Monitoring Guide ## ๐Ÿ” **Where to Monitor Pipeline Execution** ### **Primary Dashboard** **GitHub Actions**: https://github.com/sethmcknight/msse-ai-engineering/actions ### **Real-Time Monitoring Locations** #### **1. GitHub Actions Tab** - Navigate to your repository - Click the **"Actions"** tab - See all workflow runs with real-time status #### **2. Pull Request Checks** - Open any Pull Request - Scroll to bottom to see **"All checks have passed"** or **"Some checks were not successful"** - Click **"Details"** to see full logs #### **3. Commit Status** - Each commit shows โœ… or โŒ status - Click the status icon to see detailed results ## ๐Ÿ›ก๏ธ **Pipeline Safeguards - Tests MUST Pass Before Deployment** ```yaml Pipeline Flow: โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ SAFETY GATES โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ 1. ๐Ÿ” Code Quality Checks (ALL MUST PASS) โ”œโ”€โ”€ Black formatting validation โ”œโ”€โ”€ isort import ordering โ”œโ”€โ”€ flake8 linting โ””โ”€โ”€ Pre-commit hooks (PR only) 2. ๐Ÿงช Comprehensive Testing (ALL MUST PASS) โ”œโ”€โ”€ Python 3.10 & 3.11 matrix testing โ”œโ”€โ”€ 27+ unit tests with coverage โ”œโ”€โ”€ HF embedding service tests (12 tests) โ”œโ”€โ”€ Citation validation tests โ”œโ”€โ”€ LLM component tests โ””โ”€โ”€ End-to-end pipeline validation 3. ๐Ÿš€ Deployment (ONLY IF TESTS PASS) โ”œโ”€โ”€ needs: test-hybrid-architecture โ† CRITICAL DEPENDENCY โ”œโ”€โ”€ Deploy to Render โ”œโ”€โ”€ Deploy to HuggingFace Spaces โ””โ”€โ”€ Post-deployment validation 4. โœ… Final Validation โ””โ”€โ”€ Health checks across all platforms ``` ## ๐Ÿ”’ **Critical Safety Configuration** ### **Deployment Dependency Chain** ```yaml deploy-to-render: needs: test-hybrid-architecture # โ† BLOCKS deployment if tests fail deploy-to-huggingface: needs: test-hybrid-architecture # โ† BLOCKS deployment if tests fail post-deployment-validation: needs: [deploy-to-render, deploy-to-huggingface] # โ† Waits for both deployments ``` ### **Test Requirements** - **All 27+ tests** must pass - **Code formatting** must be compliant - **Citation validation** must succeed - **Service integration** must work ## ๐Ÿ“Š **How to Monitor a Pipeline Run** ### **Step 1: Trigger Pipeline** ```bash # Push to main or hf-main-local triggers pipeline git push origin main ``` ### **Step 2: Monitor in Real-Time** 1. **Go to Actions**: https://github.com/sethmcknight/msse-ai-engineering/actions 2. **Click latest workflow run** (shows "Enhanced CI/CD - HuggingFace + Hybrid Architecture") 3. **Watch job progress**: - ๐ŸŸก **Yellow**: Job running - โœ… **Green**: Job passed - โŒ **Red**: Job failed (BLOCKS deployment) ### **Step 3: Review Test Results** - Click **"test-hybrid-architecture"** job - Expand test steps to see detailed results - Check coverage reports - Verify all 27+ tests passed ### **Step 4: Deployment Monitoring** - **Only runs if tests pass** - Monitor Render deployment - Monitor HuggingFace deployment - Watch health check validation ## ๐Ÿšจ **What Happens if Tests Fail** ### **Immediate Blocking** ``` โŒ test-hybrid-architecture job fails โ†“ ๐Ÿ›‘ deploy-to-render: SKIPPED (dependency failed) ๐Ÿ›‘ deploy-to-huggingface: SKIPPED (dependency failed) ๐Ÿ›‘ post-deployment-validation: SKIPPED (dependencies failed) ``` ### **Deployment Prevention** - **No code reaches production** if any test fails - **Email notification** sent about failure - **GitHub status** shows โŒ on commit - **Must fix tests** before deployment can proceed ## ๐ŸŽฏ **Emergency Override** If you need to skip deployment for testing: ```bash git commit -m "Fix critical bug [skip-deploy]" ``` This will run tests but skip deployment. ## ๐Ÿ“ˆ **Pipeline Success Indicators** ### **All Green Status** - โœ… Pre-commit checks (PR only) - โœ… Code quality validation - โœ… 27+ comprehensive tests - โœ… Service integration tests - โœ… Citation validation - โœ… Render deployment + health check - โœ… HuggingFace deployment + health check - โœ… Post-deployment validation ### **Deployment URLs** (only available after successful deployment) - **Render**: Available in workflow logs - **HF Team**: https://huggingface.co/spaces/msse-team-3/ai-engineering-project - **HF Personal**: https://huggingface.co/spaces/sethmcknight/msse-ai-engineering ## ๐Ÿ”ง **Test Locally Before Push** ```bash # Run the same tests locally ./scripts/hf_test_runner.sh # Or run specific test categories pytest tests/ -v pytest -k "citation" -v python scripts/test_e2e_pipeline.py ``` --- **Bottom Line**: The pipeline is configured with **mandatory test gates** that PREVENT deployment if any tests fail. Monitor at: https://github.com/sethmcknight/msse-ai-engineering/actions