Skip to content

🔊 server: fix multiline webhook log#919

Draft
nfmelendez wants to merge 2 commits intobasefrom
log
Draft

🔊 server: fix multiline webhook log#919
nfmelendez wants to merge 2 commits intobasefrom
log

Conversation

@nfmelendez
Copy link
Copy Markdown
Contributor

@nfmelendez nfmelendez commented Mar 26, 2026

Summary by CodeRabbit

  • Chores

    • Improved webhook debug logging format for clearer logged output.
    • Added a warmup process that runs before the main pipeline starts, affecting startup sequencing and log capture.
  • Tests

    • Updated webhook-related tests to match the new logging call pattern.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 26, 2026

⚠️ No Changeset found

Latest commit: 14c9522

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: edaa892c-e934-499b-b513-59b1396c97f1

📥 Commits

Reviewing files that changed from the base of the PR and between 3f75d94 and 14c9522.

📒 Files selected for processing (3)
  • server/hooks/panda.ts
  • server/test/database.ts
  • server/test/hooks/panda.test.ts

Walkthrough

Adds a firehose "warmup" step that starts a limited fireeth pipeline and waits for a merged-block DB artifact before launching the main pipeline; updates webhook debug logging to use the "%j" format string and adjusts corresponding tests.

Changes

Cohort / File(s) Summary
Webhook logging implementation
server/hooks/panda.ts
Changed debugWebhook calls to pass a format string "%j" as first arg and serialized object as second arg for success and error logging paths.
Webhook tests
server/test/hooks/panda.test.ts
Updated assertions to expect webhookLogger to be called with "%j" as first argument and an object (checked via expect.objectContaining(...)) as second.
Test DB / firehose startup
server/test/database.ts
Added a firehose warmup: starts fireeth start reader-node,merger under its own AbortController, watches warmup logs, waits (Promise.race) for first merged-block DB artifact or failure, captures warmup logs on error, and ensures proper cleanup before starting the main fireeth run.

Sequence Diagram(s)

sequenceDiagram
  participant TestSetup as Test Setup
  participant Warmup as fireeth (warmup: reader-node,merger)
  participant Postgres as Embedded Postgres
  participant ArtifactStore as DB Artifact (merged-block)
  participant Main as fireeth (main pipeline)
  TestSetup->>Warmup: spawn warmup (with AbortController)
  Warmup->>Postgres: initialize / write artifacts
  Warmup->>ArtifactStore: produce merged-block artifact
  Note over TestSetup,ArtifactStore: watchProcessOutput monitors warmup logs and artifact dir
  alt merged-block artifact appears
    ArtifactStore-->>TestSetup: notify artifact ready
    TestSetup->>Warmup: abort warmup
    TestSetup->>Main: start main fireeth pipeline
  else warmup fails or Postgres exits
    Postgres-->>TestSetup: exit/error
    TestSetup->>Warmup: abort warmup
    TestSetup->>TestSetup: collect warmup logs, throw error (cause includes warmup logs)
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers

  • cruzdanilo
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title refers to fixing multiline webhook logging by switching to JSON format logging ("%j"), which directly matches the primary changes in panda.ts and panda.test.ts files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch log

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the debugWebhook function calls in server/hooks/panda.ts to include a "%j" format string for JSON logging. Corresponding test cases in server/test/hooks/panda.test.ts have been updated to reflect this change in the function signature. I have no feedback to provide.

@sentry
Copy link
Copy Markdown

sentry bot commented Mar 26, 2026

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
486 2 484 1
View the top 2 failed test(s) by shortest run time
test/hooks/panda.test.ts > concurrency > handles concurrent authorizations
Stack Traces | 0.23s run time
AssertionError: expected 554 to be 200 // Object.is equality

- Expected
+ Received

- 200
+ 554

 ❯ test/hooks/panda.test.ts:1983:26
web::web
Stack Traces | 217s run time
Assertion is false: "Processing.*" is visible

To view more test analytics, go to the Prevent Tests Dashboard

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.

2 participants