Merged
Conversation
- switched to winston for logging - added morgan for access logging - made /health never 304 - uncaughtException handler - unhandledRejection handler - respawning crashed worker fix
There was a problem hiding this comment.
👍 Looks good to me! Reviewed everything up to 1ac9796 in 42 seconds
More details
- Looked at
327lines of code in6files - Skipped
1files when reviewing. - Skipped posting
4drafted comments based on config settings.
1. test/unit/ThumbnailApi.test.ts:54
- Draft comment:
Consider adding assertions to verify that the logger outputs the expected error messages. This ensures that logging is functioning correctly and that important information is not lost. - Reason this comment was not posted:
Confidence changes required:50%
The PR introduces structured logging using Winston, replacing console logs. This is a good practice for better log management and analysis. However, the test cases for logging are not comprehensive. ThesendErrormethod inThumbnailApiis tested, but the logger's output is not verified. This could lead to missing log entries if the logger configuration changes or if there are issues in the logging logic.
2. test/unit/ThumbnailApi.test.ts:326
- Draft comment:
Consider adding assertions to verify that the logger outputs the expected error messages. This ensures that logging is functioning correctly and that important information is not lost. This comment applies to other test cases where errors are logged, such asproxyItemFromContributor: bad bodyandupstream failed. - Reason this comment was not posted:
Confidence changes required:50%
The PR introduces a new logger using Winston, but the test cases do not verify the logger's output. This could lead to missing log entries if the logger configuration changes or if there are issues in the logging logic.
3. src/ThumbnailApi.ts:179
- Draft comment:
Consider adding tests to verify that the logger outputs the expected error messages. This ensures that logging is functioning correctly and that important information is not lost. - Reason this comment was not posted:
Confidence changes required:50%
The PR introduces structured logging using Winston, replacing console logs. This is a good practice for better log management and analysis. However, the test cases for logging are not comprehensive. ThesendErrormethod inThumbnailApiis tested, but the logger's output is not verified. This could lead to missing log entries if the logger configuration changes or if there are issues in the logging logic.
4. src/app.ts:85
- Draft comment:
Consider adding tests to verify that the logger outputs the expected error messages. This ensures that logging is functioning correctly and that important information is not lost. - Reason this comment was not posted:
Confidence changes required:50%
The PR introduces structured logging using Winston, replacing console logs. This is a good practice for better log management and analysis. However, the test cases for logging are not comprehensive. ThesendErrormethod inThumbnailApiis tested, but the logger's output is not verified. This could lead to missing log entries if the logger configuration changes or if there are issues in the logging logic.
Workflow ID: wflow_7iz5bjw9b1mwMA2a
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.
There was a problem hiding this comment.
👍 Looks good to me! Incremental review on 9512583 in 12 seconds
More details
- Looked at
688lines of code in6files - Skipped
0files when reviewing. - Skipped posting
1drafted comments based on config settings.
1. src/ExpressSetup.ts:38
- Draft comment:
Usingprocess.exitcan lead to abrupt shutdowns, which might not allow pending operations to complete. Consider using a more graceful shutdown approach, ensuring all pending operations are completed before exiting. - Reason this comment was not posted:
Confidence changes required:50%
The PR introduces structured logging using winston and morgan, replacing console statements. The changes seem well-implemented, but there's a minor issue with the use ofprocess.exitin thehandleExitmethod. Usingprocess.exitcan lead to abrupt shutdowns, which might not allow pending operations to complete. It's better to gracefully shut down the server and then exit the process.
Workflow ID: wflow_IicYUxd71YJMvUn2
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.
|
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.



Important
Introduce structured logging with
winstonandmorgan, replacingconsolestatements and updating tests accordingly.winstonfor structured logging inlogger.ts.consolewithloggerinResponseHelper.ts,ThumbnailApi.ts, andapp.ts.morganmiddleware for HTTP request logging inapp.ts.winstonandmorgantodependenciesinpackage.json.@types/morgantodevDependenciesinpackage.json.sendErrorinThumbnailApi.tsto uselogger.app.tsforuncaughtExceptionandunhandledRejectionto log errors and exit.ThumbnailApi.test.tsto silence logger during tests and verify error handling.This description was created by
for 9512583. It will automatically update as commits are pushed.