-
Notifications
You must be signed in to change notification settings - Fork 72
refactor: consolidate codebase structure and add testing infrastructure #194
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.
Pull Request Overview
This PR performs a comprehensive refactoring to improve code organization and testing infrastructure. The main focus is moving response traits from a_response_traits to response_traits, reorganizing types into logical subdirectories (notification, replication, serialization), and adding extensive test coverage.
Key Changes:
- Consolidates module structure by extracting types into focused subdirectories
- Renames and relocates response trait module from
a_response_traitstoresponse_traits - Adds comprehensive unit tests for
utils.rs,signer.rs, andhttp.rs - Updates all import paths across 50+ files to reflect new module structure
Reviewed Changes
Copilot reviewed 187 out of 195 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tests/start-server.sh |
Adds MinIO version logging |
tests/s3/*.rs |
Updates imports from a_response_traits to response_traits |
tests/s3/mod.rs |
New integration test module structure |
tests/s3/list_buckets.rs |
Contains debug code for bucket deletion |
tests/s3/bucket_notification.rs |
Updates SQS ARN format and adds type annotation |
tests/s3/listen_bucket_notification.rs |
Changes runtime from async-std to tokio |
tests/s3/bucket_exists.rs |
Corrects region assertion to use DEFAULT_REGION |
tests/run-tests-windows.ps1 |
Sets default region to us-east-1 |
src/s3/utils.rs |
Adds 400+ lines of comprehensive unit tests |
src/s3/signer.rs |
Adds 350+ lines of signature verification tests |
src/s3/http.rs |
Adds 600+ lines of URL/endpoint parsing tests |
src/s3/types/**/*.rs |
New organized type structure with subdirectories |
src/s3/response/*.rs |
Updates imports to use new response_traits path |
src/s3/response_traits.rs |
Relocated from a_response_traits with macro improvements |
src/s3/mod.rs |
Re-exports types module contents |
.gitignore |
Adds /nul entry |
Comments suppressed due to low confidence (5)
tests/s3/list_buckets.rs:51
- Debug/development code is present in the test. The
if falseblock containing bucket deletion logic should be removed before merging. This appears to be leftover debugging code that serves no purpose in the final test.
tests/s3/bucket_notification.rs:25 - The SQS ARN format has been updated to include the region
us-east-1. Ensure this matches the expected MinIO notification configuration format and that the test environment is configured accordingly.
tests/s3/listen_bucket_notification.rs:16 - The test imports
StreamExtfromfutures_utilbut the test infrastructure uses tokio. This creates an inconsistent dependency pattern. Consider usingtokio_stream::StreamExtfor consistency with the tokio runtime used throughout the test.
tests/s3/listen_bucket_notification.rs:95 - The result of the spawned task is intentionally ignored with
let _. Consider checking if the task completed successfully or add a comment explaining why the result can be safely ignored, especially since this is a critical notification listener task.
tests/s3/bucket_notification.rs:50 - [nitpick] The explicit type annotation
: NotificationConfigis redundant since the type can be inferred from the assignment and later comparison. This can be simplified tolet config2 = resp.config().unwrap();
6d9f0e3 to
deef32e
Compare
Reorganize project structure to improve maintainability and add comprehensive testing documentation and tooling support.
deef32e to
bfa2c2a
Compare
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.
Pull Request Overview
Copilot reviewed 185 out of 193 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (4)
tests/s3/list_buckets.rs:51
- Dead code block with
if falseshould be removed. If this cleanup logic is needed for debugging, consider using a feature flag or environment variable instead of leaving unreachable code in the codebase.
tests/s3/bucket_notification.rs:50 - [nitpick] The explicit type annotation
NotificationConfigis unnecessary here since the type can be inferred from the assignment. This is redundant and can be removed to simplify the code.
tests/s3/bucket_exists.rs:54 - This TODO comment indicates a potential bug or design issue where the region should be DEFAULT_REGION but is empty. This should either be fixed or converted to a tracked issue rather than leaving a TODO in the test code.
tests/s3/bucket_create_delete.rs:129 - Duplicate TODO comment indicating the same issue as in bucket_exists.rs. This should be addressed consistently across all tests - either fix the underlying issue or create a tracked issue and remove these TODOs.
Reorganize project structure to improve maintainability and add comprehensive
testing documentation and tooling support.
Structural Changes:
client.rs → client/mod.rs, response.rs → response/mod.rs)
Testing Infrastructure:
Developer Experience:
Code Organization:
This consolidation provides a cleaner foundation for continued API development
and establishes clear patterns for testing and documentation.