[Patch 1] Fix repositories and logger#1
Open
vs0uz4 wants to merge 3 commits intodevfullcycle:masterfrom
Open
Conversation
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 includes several updates to improve consistency, logging, and filtering in the codebase. The most important changes include fixing environment variable syntax, adding output paths for the logger, updating filter keys for MongoDB queries, and ensuring proper escaping of regex patterns.
Environment variable syntax fix:
cmd/auction/.env: Corrected syntax for MongoDB environment variables by changing colons to equal signs.Logging improvements:
configuration/logger/logger.go: AddedOutputPathsandErrorOutputPathsto log configuration to ensure logs are output tostdoutandstderr.Filter key updates for MongoDB queries:
internal/infra/database/auction/find_auction.go: Updated the filter key fromproductNametoproduct_nameto match the database schema.internal/infra/database/bid/find_bid.go: Changed the filter key fromauctionIdtoauction_idfor consistency with the database schema.Regex pattern escaping:
internal/infra/database/auction/find_auction.go: Addedregexp.QuoteMetato escape special characters in theproductNamefilter to prevent regex injection.Logging message format fix:
internal/infra/database/user/find_user.go: Changed the user ID format specifier from%dto%sin log messages to correctly handle string user IDs.This pull request includes several changes to improve logging, fix regex handling, and standardize field names in the database queries. The most important changes include adding output paths to the logger configuration, escaping product names in regex queries, and updating field names for consistency.Improvements to logging:
configuration/logger/logger.go: AddedOutputPathsandErrorOutputPathsto the logger configuration to ensure logs are output tostdoutandstderr.Fixes to regex handling:
internal/infra/database/auction/find_auction.go: EscapedproductNameusingregexp.QuoteMetato prevent regex injection and updated the filter key toproduct_name.Standardization of field names:
internal/infra/database/bid/find_bid.go: Updated the filter key fromauctionIdtoauction_idfor consistency with other field names.internal/infra/database/user/find_user.go: Changed the format specifier in the error message from%dto%sforuserIdto handle string IDs correctly.