feat: ✨ Add request based logging and update dependencies#3
Closed
faizanazim11 wants to merge 1 commit intoexiorrealty:mainfrom
Closed
feat: ✨ Add request based logging and update dependencies#3faizanazim11 wants to merge 1 commit intoexiorrealty:mainfrom
faizanazim11 wants to merge 1 commit intoexiorrealty:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
Introduces comprehensive testing infrastructure, request-based logging with correlation IDs, enhanced response schemas, and updated dependencies for improved observability and developer experience.
- Adds correlation ID integration for request tracing throughout the system
- Introduces comprehensive test suite covering all modules with 100% coverage
- Updates response schemas with default factory functions for metadata consistency
Reviewed Changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_responses.py | Comprehensive test coverage for response schemas and RequestMeta with correlation ID testing |
| tests/test_log_config.py | Test suite for logging configuration with mocking and validation scenarios |
| tests/test_exception_handlers.py | Tests for FastAPI exception handlers and custom error handling |
| tests/test_errors.py | Complete test coverage for GenericErrors exception class functionality |
| tests/test_config.py | Configuration management tests with environment variable handling |
| tests/conftest.py | Shared pytest fixtures for environment isolation and temporary directories |
| src/jetpack/responses.py | Enhanced response schemas with correlation ID integration and factory functions |
| src/jetpack/log_config.py | Added correlation ID filter support to logging configuration |
| src/jetpack/errors/exception_handlers.py | Updated status code for validation errors to use correct HTTP standard |
| src/jetpack/config.py | Improved configuration merging with None value handling |
| pyproject.toml | Updated dependencies and coverage configuration for new testing infrastructure |
| README.md | Complete documentation rewrite with usage examples and API reference |
| CHANGELOG.md | Version history documentation following Keep a Changelog format |
| .pre-commit-config.yaml | Updated pre-commit hooks to latest versions |
| .github/workflows/tests.yaml | New GitHub Actions workflow for automated testing |
| .github/copilot-instructions.md | Development guidelines and patterns for contributors |
Comments suppressed due to low confidence (1)
tests/test_responses.py:1
- The comment is duplicated in both the parametrize decorator and inline comment. Remove the redundant inline comment.
"""
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Comment on lines
+134
to
+136
| # Should return None since the function doesn't return anything | ||
| # The function appears to have a bug - it builds handlers but doesn't return them | ||
| assert handlers is None |
There was a problem hiding this comment.
The get_exception_handlers function builds a handlers dictionary but doesn't return it, making it unusable. The function should return the handlers dictionary at the end.
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 improvements and new features to the Jetpack microservice utility library, focusing on developer experience, code quality, and observability. The most significant changes include enhanced documentation (including a new Copilot instructions file and a changelog), upgrades to logging and response metadata with correlation ID support, improved error handling, expanded testing infrastructure, and updates to dependencies and project configuration.
Documentation & Developer Guidance:
.github/copilot-instructions.mdfile detailing code style, architecture patterns, testing strategies, file organization, and best practices for contributors and Copilot usage.CHANGELOG.mdfollowing Keep a Changelog format, documenting all notable changes and features for version history.README.mdwith a detailed overview, installation and usage instructions, environment variables, API reference, FastAPI integration examples, and contribution guidelines.Logging & Observability:
asgi-correlation-idfor correlation ID propagation, adding aCorrelationIdFilterto log handlers, and updating log formats to include correlation IDs. [1] [2] [3] [4]asgi-correlation-idand ensured type hints and logging improvements are reflected in the configuration.Response & Error Handling:
RequestMetamodel with default factories for correlation ID and timestamp, ensuring every response includes traceable metadata.422 Unprocessable Content) and provide error details in a standardized format.Testing & CI/CD:
.github/workflows/tests.yaml) for automated testing and coverage on pull requests, usinguvfor environment management.tests/conftest.pywith reusable pytest fixtures for environment isolation, temporary directories, and sample configurations, supporting comprehensive and reliable test coverage.pytest-covand configured coverage to omit test and script files.Configuration & Dependency Management:
config.pyto handleNonevalues gracefully for base paths and module names.0.2.0to reflect these significant enhancements.These changes collectively improve Jetpack's reliability, maintainability, and developer experience, setting a strong foundation for future development.