Upgrade gateway#2
Merged
Jenish-1235 merged 34 commits intogatewayfrom Dec 19, 2025
Merged
Conversation
- Split core/models.py into domain modules - Enhance user/auth models with production-grade features - Update dependencies: pydantic[email] for EmailStr validation - Update tests to match new model structure - All imports remain backward compatible - All 48 tests passing
…ling and OAuth provider requirements - Changed IP address fields in models to use IPvAnyAddress for better validation. - Made oauth_provider a required field in User and UserContext models. - Removed deprecated OAuthTokens model and updated related tests. - Enhanced tests to validate new model behaviors and requirements.
- Add docker-compose.infra.yml with PostgreSQL, Redis, Jaeger - Add scripts/init-db.sql with complete database schema - Add scripts/generate-keys.sh for JWT key generation - Add scripts/setup-keyvault.sh for Azure Key Vault setup
- Add PostgreSQL, Redis, JWT, OpenTelemetry settings - Add startup timeout and retry configuration - Add pool size configuration for future use - Create .env.example template - Update .gitignore for secrets
- Create core/config_loader.py with retry logic - Add environment validation (strict for prod/staging) - Add exponential backoff retry for Azure connections - Add azure-appconfiguration dependency
- Create core/app_state.py with AppState container - Define DatabasePool and RedisClient protocols - Create core/database.py with pool factory stub - Create core/redis.py with client factory stub - Add startup metadata tracking
- Add 7-phase startup sequence with logging - Add configuration loading from Azure - Add connection initialization and verification - Add graceful shutdown with cleanup - Add AppState dependency injection
- Add /health with detailed dependency checks - Add /ready for Kubernetes readiness probe - Add /live for Kubernetes liveness probe - Update Docker health check to use /ready - Add uptime and metadata to health response
- Add tests for environment validation - Add tests for AppState lifecycle - Add tests for health endpoints - Update README with infrastructure setup
- Move all core module tests to tests/core/ directory - Create tests/core/__init__.py - Keep API tests (test_health_endpoints.py) in tests/ root - Maintains test organization by module structure
…uirements - Introduce azure-appconfiguration version 1.7.2 with its dependencies - Update project dependencies to include azure-appconfiguration - Ensure compatibility with existing azure-core and other related packages
- Add redis_max_connections setting to configure maximum Redis connections. - Refactor main.py to initialize Redis client with new connection settings. - Update health check endpoints to verify Redis connection status. - Remove unused database and Redis client creation functions. - Introduce idempotent session keys for WebSocket connections to improve session management. - Implement batch operations in Redis client for efficient session handling. - Update tests to reflect changes in session management and Redis interactions. These enhancements improve the application's performance and reliability in managing Redis connections and user sessions.
…ultiple files - Simplified string formatting in config.py, main.py, and various model files for improved readability. - Refactored method signatures in auth.py, keyvault.py, and test files to enhance consistency and clarity. - Cleaned up exception representation in exceptions.py for better debugging output.
…, atomic pipelines, and improved connection tracking; fix test mocks
…eck for audio processor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several foundational improvements to the NeroSpatial Backend, focusing on environment configuration, health monitoring endpoints, and application state management. It adds a standardized
.env.examplefor environment variables, implements robust health/readiness/liveness endpoints for production deployments, introduces a centralized application state container, and improves configuration and core module structure for maintainability and scalability.Environment and Configuration Improvements:
.env.exampletemplate documenting all required and optional environment variables, including Azure, PostgreSQL, Redis, JWT, and telemetry settings. This helps standardize configuration and onboarding for new developers.config.pyto support hierarchical configuration loading (Azure App Configuration, Key Vault,.env), added validation for theenvironmentvariable, and provided properties for constructing PostgreSQL and Redis URLs.Health Monitoring Endpoints:
api/health.pywith/health,/ready, and/liveendpoints for detailed health checks, Kubernetes readiness, and liveness probes, including dependency checks and process health.README.mdto document new health endpoints, infrastructure setup (Docker Compose for dependencies), JWT key generation, Azure Key Vault setup, and clarified configuration hierarchy and requirements.Application State and Core Module Refactoring:
core/app_state.py, introducing anAppStatedataclass to centralize application resources (database pool, Redis, JWT, telemetry, Key Vault), startup status, and cleanup logic.core/__init__.pyto expose new core types (AppState, exceptions, enums, models, telemetry, etc.) for easier imports and better modularity. [1] [2] [3]Other Minor Changes:
api/__init__.pyfor clarity.These changes collectively improve the backend's reliability, maintainability, and readiness for production deployment.