🦺 server: acknowledge panda dispute events#755
Conversation
🦋 Changeset detectedLatest commit: 520573b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughAdds recognition for Panda "dispute" webhook events: expands the Changes
Sequence Diagram(s)sequenceDiagram
participant Panda as Panda (Webhook Sender)
participant Server as Server Hook (server/hooks/panda.ts)
participant Processor as Internal Processor
Panda->>Server: POST /webhook (resource: "dispute", action, body, id)
Server->>Server: validate Payload (includes dispute variant)
alt resource == "dispute"
Server-->>Panda: 200 { code: "ok" }
else
Server->>Processor: forward validated payload for processing
Processor-->>Server: ack
Server-->>Panda: 200 { code: "ok" }
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 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. Comment |
Summary of ChangesHello @cruzdanilo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces the ability for the server to acknowledge dispute events originating from Panda. It includes modifications to the payload validation schema and adds a handler to immediately acknowledge dispute events with a Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #755 +/- ##
==========================================
+ Coverage 67.29% 68.13% +0.83%
==========================================
Files 206 206
Lines 7005 7082 +77
Branches 2189 2239 +50
==========================================
+ Hits 4714 4825 +111
+ Misses 2099 2063 -36
- Partials 192 194 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request adds support for acknowledging dispute events from Panda. The implementation is straightforward, adding a schema for the dispute event and returning an 'ok' response. My suggestions to make the schema for the dispute event body more specific and robust, aligning it with other event types for better consistency and validation, and to add a test case to verify this new validation logic, remain valid and are included.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@server/hooks/panda.ts`:
- Line 215: Before the early return for dispute events, add minimal Sentry
observability: call Sentry.setTag("panda.resource", "dispute") and set context
with Sentry.setContext("panda", await c.req.json()) (and optionally
Sentry.setUser if user info is available) immediately before the line checking
payload.resource === "dispute" so the handler still returns c.json({ code: "ok"
}) but leaves a Sentry trace; reference the existing payload.resource check and
the request context (c.req.json()) in server/hooks/panda.ts when making these
additions.
Summary by CodeRabbit
New Features
Tests
Chores