chore: replace bunyan-middleware - #682
Merged
Merged
Conversation
bunyan-middleware has not had an update for four years in either its GitHub repo or its npm version. It is tiny and easy to replicate without dependencies, so let's do that.
Trott
requested review from
richardlau and
targos
and
a lite review from Copilot
August 5, 2026 00:56
There was a problem hiding this comment.
Pull request overview
This PR replaces the unmaintained bunyan-middleware dependency with an in-repo request logging middleware that attaches request-scoped Bunyan child loggers and obscures the GitHub webhook signature in serialized request headers.
Changes:
- Remove
bunyan-middlewarefrom dependencies and wire up a new localrequestLoggermiddleware inapp.js. - Add
lib/request-logger.jsto generate/propagate request IDs and emit a trace log on response finish with request/response serializers. - Add a unit test validating request logger attachment and header obscuring behavior.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| app.js | Replaces bunyan-middleware usage with the new local request logger middleware. |
| lib/request-logger.js | Implements request-scoped logging, request-id propagation, and header obscuring in serializers. |
| test/unit/request-logger.test.js | Adds unit coverage for request logger behavior (request id propagation and finish logging). |
| package.json | Removes the bunyan-middleware dependency. |
| package-lock.json | Removes bunyan-middleware and updates lockfile resolution metadata / transitive versions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| assert.equal(logger.logs[0][0].res, res) | ||
| assert.equal(typeof logger.logs[0][0].duration, 'number') | ||
| assert.equal(logger.logs[0][1], 'request finish') | ||
| }) |
joyeecheung
approved these changes
Aug 5, 2026
RafaelGSS
approved these changes
Aug 5, 2026
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.
bunyan-middleware has not had an update for four years in either its GitHub repo or its npm version. It is tiny and easy to replicate without dependencies, so let's do that.