-
Couldn't load subscription status.
- Fork 3
ci: reduce disk usage in unit tests (free space + test-only deps) #412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🚀 Development Environment OptionsThis repository supports Dev Containers for a consistent development environment. Option 1: GitHub Codespaces (Recommended)Create a cloud-based development environment:
Option 2: VS Code Dev Containers (Local)Use Dev Containers on your local machine:
Option 3: Traditional Local SetupSet up the development environment manually: # Clone the repository
git clone https://github.com/manavgup/rag_modulo.git
cd rag_modulo
git checkout fix/ci-disk-space-411
# Initialize development environment
make dev-init
make dev-build
make dev-up
make dev-validateAvailable CommandsOnce in your development environment: make help # Show all available commands
make dev-validate # Validate environment setup
make test-atomic # Run atomic tests
make test-unit # Run unit tests
make lint # Run lintingServices AvailableWhen running
This automated message helps reviewers quickly set up the development environment. |
Claude Code ReviewSummaryThis PR optimizes the unit test workflow by reducing disk usage through parallel cleanup operations and installing only test dependencies. Overall approach is sound, but there is a CRITICAL ISSUE that will cause tests to fail. CRITICAL ISSUE - Missing Runtime Dependencies for TestsLine 94 uses: poetry install --only test --no-root --no-cache PROBLEM: Using --only test installs ONLY the test group dependencies (pytest, coverage tools) but EXCLUDES all main project dependencies that tests import from. Tests import from rag_solution and will fail with ModuleNotFoundError. SOLUTION: Use --with test instead to install main dependencies + test dependencies: poetry install --with test --without dev --no-root --no-cache This still achieves disk savings by skipping the heavy dev group (linters, type checkers, security scanners) while keeping the runtime dependencies tests need. What Works Well
Recommendations
Testing Checklist
Performance AnalysisExpected savings:
Disk space: ~10GB freed (from 14GB to 24GB available) VerdictSTATUS: REQUIRES CHANGES The optimization strategy is excellent and aligns with fast PR feedback goals. However, the critical dependency issue must be fixed before merging. Next steps:
Great work on identifying and addressing the disk usage issue! |
PR Review: CI Disk Space OptimizationOverviewThis PR addresses disk space issues in the unit test workflow by adding cleanup steps and optimizing dependency installation. Strengths
Key ConcernsCRITICAL: --no-root Flag May Break Tests Test Dependencies May Be Missing --no-cache May Slow Builds Hardcoded 5G Threshold Testing Recommendations
Performance Impact
Risk assessment: Medium - dependency changes could break tests SecurityNo security concerns. Follows GitHub Actions best practices. Final Verdict: Conditional ApprovalThe approach is sound but needs validation:
Once validated, this is a good optimization for CI disk pressure. Reviewed by: Claude Code |
PR Review: CI Disk Space OptimizationI have reviewed PR #412 which addresses CI disk space issues. Here is my detailed feedback: Strengths
Potential Issues and Concerns1. Critical: Missing Required Dependencies The change from --with dev,test to --with test --without dev may break the workflow. According to pyproject.toml:
Problem: The test command uses --cov=rag_solution which requires pytest-cov. While pytest-cov IS in the test group (line 68), the duplication suggests historical dependency issues. Recommendation: Monitor the first CI run carefully after merging. If coverage fails, we may need pytest-cov explicitly or revert to selective dev tool exclusion. 2. Variable Expansion Issue Line 97 has the step name with a variable that will not expand. GitHub Actions does not interpolate step names, so this is cosmetic but misleading. Fix: Use a literal value like Ensure sufficient free disk space or remove the threshold from the name. 3. Disk Space Check Logic The comparison uses -lt (integer comparison) but the value extracted from df -BG could theoretically be a decimal. While df -BG typically rounds to integers, this could fail on edge cases. Recommendation: Use integer arithmetic explicitly in the awk command with int(). 4. Inconsistency with Other Workflows I notice .github/workflows/01-lint.yml uses --only dev while 05-ci.yml uses --with dev,test. This PR creates a third pattern. While justified for disk constraints, it adds complexity. Recommendation: Document this decision in a comment within the workflow file explaining why unit tests skip dev tools. Performance Considerations
SecurityNo security concerns. The sudo rm -rf commands target well-known GitHub Actions directories and pose no risk. Test CoverageMissing: No validation that unit tests will still pass with the new dependency configuration. Recommendation:
Alternative Approach for Future ConsiderationInstead of manual cleanup, consider using GitHub free-disk-space action (jlumbroso/free-disk-space). This is more maintainable and battle-tested, though your custom script is fine for now. Action Items Before Merge
Final Verdict: Approve with Minor FixesThe core approach is solid and addresses a real problem. The suggested fixes are minor and could be addressed in a follow-up PR if needed. The disk space optimization is well-implemented and should resolve the CI failures. Estimated disk savings: approximately 5-8GB (cleanup) + 1-2GB (dependencies) = 7-10GB total Great work on identifying and fixing this bottleneck! |
PR Review: CI Disk Space OptimizationSummaryThis PR addresses disk space constraints in GitHub Actions runners by implementing cleanup steps and optimizing dependency installation. Strengths
Critical Issues1. Disk Check Math Error (Line 105)Problem: The integer truncation will cause false failures. Using Current code: FREE=$(df -BG / | awk 'NR==2 {gsub("G","",$4); print int($4)}')Fix: Use 2. Environment Variable Not DefinedMIN_FREE_GB is used but never set in the workflow. The default value of 5 will always be used. Fix: Add to top-level env section: env:
MIN_FREE_GB: 5 # Minimum free disk space in GBAdditional Recommendations
Testing Considerations
Security & Performance
Overall AssessmentRating: ⭐⭐⭐⭐ (4/5) Well-thought-out optimization with sound approach and clear documentation. However, the disk check math bug could cause flaky CI failures. Recommendation: Request changes for items 1-2, then approve. Once fixed, this will be a solid improvement to CI reliability. Great work on optimizing the CI pipeline! 🚀 |
PR Review: CI Disk Space OptimizationThis PR addresses disk space issues in the unit test CI workflow. The changes are well-structured but need some fixes before merging. Strengths
Critical Issues (Blocking)1. Potential Coverage Regression Action needed:
2. Wrong Issue Reference Action needed: Fix or remove the issue reference 3. Inconsistent Threshold Action needed: Change script default to match 7GB Non-Blocking Recommendations
Security and PerformanceNo security issues detected. Performance impact is positive (10-20s faster, smaller footprint). Final VerdictApprove with Changes - The approach is sound but the 3 blocking issues must be fixed before merge. Good work identifying and solving the disk space problem! cc: @manavgup - Please address the blocking issues and confirm pytest-cov works with the new dependency installation. |
linked to #411