-
Notifications
You must be signed in to change notification settings - Fork 0
Chore/ci consolidation #105
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
- Refactor app/config.py to ONLY contain Settings class and get_settings() - Remove FastAPI app definition and lifespan (moved to main.py) - Remove router imports to break circular dependencies - Add pydantic extra='ignore' to handle extra env vars - Update app/utils/logging.py setup_logging() to accept ZERO arguments - Read LOG_LEVEL from environment internally - Fixes CodeQL error: 'Wrong number of arguments in call to setup_logging' - Refactor app/main.py as ONLY place for FastAPI app and lifespan - Define lifespan() with lazy settings import - Call setup_logging() with no arguments - Import routers directly (no circular dependencies) - Add timestamp to health check endpoint - Verify routers (operator, backoffice) don't import config or main Dependency flow: main.py -> config.py, routers (NEVER reverse) All tests pass (7/7 ✓) Black + isort formatting applied CodeQL circular import issues resolved
- Add pytest-env configuration in pytest.ini with required vars: - API_KEY, SECRET_KEY for authentication tests - CORS_ORIGINS as JSON array format for pydantic-settings - ENVIRONMENT=testing for test environment - Update .env.test with proper test values - Use JSON format for list values: CORS_ORIGINS=["*"] Fixes test failure in CI: - ValueError: API_KEY environment variable is required - Tests now pass with mocked environment variables All tests pass locally: 7/7 ✓
- Move env vars from pytest.ini (unsupported) to CI workflow - Add environment variables directly in ci.yml test step: - API_KEY, SECRET_KEY, CORS_ORIGINS, ENVIRONMENT, etc. - Create app/tests/conftest.py for local testing: - Automatically sets test env vars if not present - Ensures consistent behavior between local and CI - Remove invalid 'env' section from pytest.ini - pytest-env plugin not needed anymore Fixes CI error: - "ERROR: Unknown config option: env" - Tests now have proper environment in both local and CI All tests pass: 7/7 ✓
|
🎯 Solución Completa - Problemas Arquitectónicos y CI Resueltos
✅ Solo contiene Settings class y get_settings() ✅ setup_logging() acepta cero argumentos (fix CodeQL) ✅ Único lugar donde se define lifespan() Tests Locales (app/tests/conftest.py) Configura automáticamente variables de entorno para tests locales 🚀 Listo para Merge Commits relevantes: 9d36abf - Refactorización arquitectónica principal |
🚀 Pull Request: Complete Railway Deployment Optimization
📋 Descripción del Cambio
Este PR implementa la solución completa para el problema de crashes de Railway después de 2 minutos, junto con la funcionalidad completa del dashboard administrativo para el sistema bancario NeuroBank FastAPI.
🎯 Problema Solucionado
✅ Solución Implementada
🔧 Cambios Técnicos Implementados
🚂 Railway Deployment
railway.json] Configuración con health checks y restart policiesstart.sh] Script de inicio inteligente con validacionesDockerfile] Optimización single worker + uvloop📊 Admin Dashboard
admin_transactions.html] Panel transacciones completo con Chart.jsadmin_users.html] Gestión usuarios con búsqueda en tiempo realadmin_reports.html] Reportes avanzados con exportación CSV/Excelrouter.py] Conexiones específicas (no más templates genéricos)🔄 CI/CD Pipeline
.github/workflows/production-pipeline.yml] Pipeline de 8 etapas📚 Documentation Suite
HOTFIX_RAILWAY_CRASH.md] Análisis técnico del problema RailwayWORKFLOW.md] Procedimientos de desarrolloGIT_COMMANDS_HOTFIX.md] Comandos de despliegue🧪 Testing & Validation
✅ Funcionalidad Validada
/healthoperativo🔒 Security Checks
⚡ Performance Tests
🎯 Business Impact
🚀 Deployment Instructions
Pre-merge Checklist
RAILWAY_TOKENconfigurado en GitHub SecretsPost-merge Actions
main👥 Review Requirements
🔍 Areas de Focus para Review
railway.jsonystart.sh🎯 Expected Reviewers
📝 Additional Notes
🔄 Future Improvements
📚 Related Documentation
✅ Ready to Merge Criteria
🎉 Este PR convierte NeuroBank FastAPI en una aplicación bancaria de nivel empresarial con despliegue automático y funcionalidad completa!