Add dispatcher routing support for VulnerabilityEvent#385
Merged
Conversation
Co-authored-by: flc1125 <14297703+flc1125@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add dispatcher routing for VulnerabilityEvent
Add dispatcher routing support for VulnerabilityEvent
Mar 9, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 3.x #385 +/- ##
==========================================
+ Coverage 92.55% 93.07% +0.51%
==========================================
Files 1 1
Lines 215 231 +16
==========================================
+ Hits 199 215 +16
Misses 11 11
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Owner
|
@copilot fix lint |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds end-to-end dispatcher support for GitLab *gitlab.VulnerabilityEvent, so vulnerability webhooks parsed by client-go can be routed to registered listeners instead of returning ErrUnsupportedEvent.
Changes:
- Introduces
VulnerabilityListenerwithOnVulnerability(ctx, *gitlab.VulnerabilityEvent). - Extends
Dispatcherto register and dispatch vulnerability events (RegisterVulnerabilityListener,Dispatchcase,processVulnerabilityEvent). - Adds a vulnerability webhook fixture and corresponding dispatch test coverage.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
listeners.go |
Adds the VulnerabilityListener interface to the listener set. |
dispatcher.go |
Wires vulnerability listeners into registration and dispatch routing. |
testdata/webhooks/vulnerability.json |
Adds a vulnerability webhook payload fixture used by tests. |
dispatcher_test.go |
Exercises vulnerability dispatch through DispatchRequest and validates handler invocation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: flc1125 <14297703+flc1125@users.noreply.github.com>
Contributor
Author
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
VulnerabilityListenerinterface tolisteners.govulnerabilityListenersfield toDispatcherstructVulnerabilityListenertype check inRegisterListenersRegisterVulnerabilityListenermethodcase *gitlab.VulnerabilityEventtoDispatchswitchprocessVulnerabilityEventfunctiontestdata/webhooks/dispatcher_test.goOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.