Open
Conversation
- Upgraded package configuration with more precise dependency versions - Introduced new core modules for request, response, and error handling - Added standardized routing and request validation mechanisms - Updated setup.py with improved package metadata and configuration - Added example .env files and requirements for Slack connector - Implemented enhanced error tracking and logging
- Update setup.py to use src directory layout - Adjust Python version requirement to 3.11 - Refactor router / app - Remove generated package metadata and build artifacts
- Implement singleton pattern for ModuleRouter - Simplify route URL generation - Improve automatic schema route discovery - Enhance route decorator with more flexible configuration - Add comprehensive error tracking and context capture - Refactor error handling to provide more detailed error information
- Remove Authlib dependency - Add Pydantic library - Lower Python version requirement to 3.10 - Simplify setup.py configuration
- Simplify ManagedError class with more flexible error tracking - Enhance error logging and Sentry integration - Improve error context capture and metadata handling - Update Response class to support more comprehensive error responses - Standardize error creation methods with consistent parameters - Remove TypedDict type definitions for more dynamic error handling
- Include PyYAML library with version 6.0.0 or higher - Expand project dependencies to support YAML configuration parsing
- Simplify logging format - Reduce verbosity of error logging - Improve Sentry logging messages - Streamline error context capture
- Implement FlaskFSRouter for automatic route discovery - Simplify ModuleRouter with more flexible route registration - Update core router to support dynamic route path generation - Remove complex route handling logic - Add support for automatic route path detection based on file structure
…ndling - Add support for app configuration loading from YAML - Implement advanced Sentry error tracking with context preservation - Configure CORS and logging with flexible settings - Add core routes for health checks and application info - Improve error response handling with environment-specific sanitization - Remove unused type definitions and legacy run script
- Remove unused imports and modules - Simplify import statements in core modules - Update `__init__.py` files to use wildcard imports - Remove deprecated router and test modules - Add centralized Sentry initialization module - Enhance error handling with more concise implementations
- Add centralized logging configuration in core module - Implement configurable routes directory from app settings - Remove verbose route registration print statements - Improve logging with informative startup messages - Simplify router initialization and configuration
- Implement a new `/routes` GET endpoint to expose available routes - Adjust route registration order to ensure core routes are registered last - Simplify route registration process in the Router class
- Remove explicit Sentry exception capturing in route handlers - Modify error logging to propagate exceptions to error handlers - Update Sentry initialization with more granular configuration - Remove logging configuration from core __init__.py - Add environment-based route registration logging - Simplify error handling and exception tracking
- Create new `validation.py` module with request validation functions - Add request validation to route handlers in `dynamic_routing.py` - Implement validation for required fields, JSON parsing, and data types - Enhance request processing with flexible validation methods
- Add `parse_str_to_json` utility function for consistent JSON parsing - Refactor `validate_array` and `validate_object` to handle string and non-string inputs - Update `__init__.py` to expose new validation functions - Improve error handling and type checking in validation methods
…ss responses - Simplify response structure by removing default status and message fields - Enhance error response with optional data and metadata support - Improve error handling to conditionally include stack traces based on environment - Add more flexible metadata and data handling in error responses - Remove redundant status fields and improve response consistency
- Add support for configurable port and debug mode from app settings - Update app run configuration to use dynamic port and debug settings - Default to port 2001 and enable debug mode if not specified - Improve logging to use dynamically configured port
… Response() initialization - Implement schema file discovery and loading for automatic route schema generation - Add methods to find and load schema.json files in route directories - Create dynamic schema route registration with flexible configuration - Update Router class to support automatic schema route generation - Enhance request validation to skip schema routes - Improve error handling and logging for schema file processing
Add /schema route discovery and registration to dynamic routing + Fix…
- Add detailed event processing in Sentry's before_send hook - Implement enrichment of error events with: * Exception type and value details * Request method and URL information * Query parameter extraction * Route and function context * External request error details - Improve error tracking with more contextual information - Add path parameter extraction for better error traceability - Enhance error logging and event metadata collection
…nt handling - Introduce `get_environment` function to determine the current environment dynamically. - Add `generate_module_metadata` function to create metadata for discovered modules based on their configuration. - Update `Router` class to store module metadata and include it in the response. - Refactor `is_production_environment` method to utilize the new environment handling. - Improve response structure by including a list of modules in the API response.
- Change the route from "/app_info" to "/app-config" for clarity and consistency. - Modify the response structure to include "app_settings" instead of individual app metadata fields. - Enhance the overall API response by consolidating app configuration details into a single object.
- Update `is_production_environment` to use `get_environment` for dynamic environment detection. - Rename `log_error` to `print_error` for clarity in error logging. - Enhance error logging with improved context handling and Sentry integration. - Introduce `_scan_routes_directory` and `_collect_route_information` methods for better route management. - Implement `_get_serializable_routes` to create a JSON-serializable version of the routes list. - Improve app configuration endpoints to handle errors gracefully and return structured data. - Add dynamic schema handler creation for improved schema route registration
- Introduce `_register_schema_route` method to streamline schema route registration and ensure re-discovery of existing routes. - Implement `_handle_dynamic_schema_request` to manage dynamic schema requests for paths not registered at startup, including error handling for missing or invalid schema files. - Add a catch-all route for dynamic schema discovery in the `init_app` method to handle requests for dynamically added schemas. - Improve code organization and readability by breaking down complex operations into smaller, well-defined methods.
…leaks Addresses memory accumulation in serverless environments by cleaning up modules after route discovery. Loads schema files and app configurations dynamically, preventing persistent caching. Uses explicit file handle management and clears accumulated data structures to ensure efficient resource utilization.
Optimizes dynamic routing for serverless environments and fix memory leaks
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.
No description provided.