Skip to content

chore: replace bunyan-middleware - #682

Merged
joyeecheung merged 1 commit into
mainfrom
bunyan-middleware
Aug 5, 2026
Merged

chore: replace bunyan-middleware#682
joyeecheung merged 1 commit into
mainfrom
bunyan-middleware

Conversation

@Trott

@Trott Trott commented Aug 5, 2026

Copy link
Copy Markdown
Member

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.

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
Trott requested a review from a team as a code owner August 5, 2026 00:55
@Trott
Trott requested review from richardlau and targos and a lite review from Copilot August 5, 2026 00:56

Copilot AI left a comment

Copy link
Copy Markdown

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 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-middleware from dependencies and wire up a new local requestLogger middleware in app.js.
  • Add lib/request-logger.js to 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
joyeecheung merged commit 8133381 into main Aug 5, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants