chore: update gitlab dependencies to reflect latest webhook payload#568
Conversation
|
Welcome @xNok! It looks like this is your first PR to knative-extensions/eventing-gitlab 🎉 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #568 +/- ##
==========================================
- Coverage 37.09% 36.96% -0.13%
==========================================
Files 19 20 +1
Lines 736 752 +16
==========================================
+ Hits 273 278 +5
- Misses 454 461 +7
- Partials 9 13 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Cali0707
left a comment
There was a problem hiding this comment.
Thanks for working on updating this @xNok !
Would you be able to fix the linter errors re: the license boilerplate in the new webhook.go file?
Overall, this PR looks good to me otherwise. Have you managed to test it in a k8s cluster and see if events show up from the webhook?
|
Thanks for having a look, I will get back to it on Friday for further testing and wrap this up |
|
@Cali0707 I have updated the license in the I am running the e2e test against the knative quickstart kind cluster, I didn't hook it to the `presubmit-tests.sh |
There was a problem hiding this comment.
Pull Request Overview
This PR modernizes GitLab webhook integration by migrating from the outdated go-playground/webhooks module to the officially maintained gitlab.com/gitlab-org/api/client-go module, ensuring support for all current GitLab webhook event types.
- Replaces
go-playground/webhooksdependency with the official GitLab Go client - Updates webhook parsing logic to use GitLab's official event types and payloads
- Adds comprehensive end-to-end tests with real webhook payload examples
Reviewed Changes
Copilot reviewed 19 out of 267 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| go.mod | Updates dependencies to use gitlab.com/gitlab-org/api/client-go v0.129.0 |
| pkg/adapter/webhook.go | New webhook handler implementation using official GitLab client |
| pkg/adapter/receive_adapter.go | Simplified adapter logic using new webhook handler |
| pkg/adapter/receive_adapter_test.go | Updated tests for new event types and error handling |
| pkg/client/gitlab/webhook_client.go | Updated GitLab client usage with new API patterns |
| pkg/reconciler/source/gitlabsource.go | Updated import to use official GitLab client |
| config/300-gitlabsource.yaml | Added support for new event types (feature_flag, job, release, resource_access_token) |
| test/ | New end-to-end integration tests with webhook payload examples |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
@Cali0707, it took me some time to get back to it, I rebased this MR on main |
Signed-off-by: Alexandre Couedelo <nokwebspace@gmail.com>
Signed-off-by: Alexandre Couedelo <nokwebspace@gmail.com>
Signed-off-by: Alexandre Couedelo <nokwebspace@gmail.com>
Signed-off-by: Alexandre Couedelo <nokwebspace@gmail.com>
Signed-off-by: Alexandre Couedelo <nokwebspace@gmail.com>
Signed-off-by: Alexandre Couedelo <nokwebspace@gmail.com>
Co-authored-by: Calum Murray <cmurray@redhat.com>
Co-authored-by: Calum Murray <cmurray@redhat.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
I rebased the PR |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Cali0707, xNok The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
🧽 Update or clean up current behavior
The issue mostly lies in using the
go-playground/webhooksmodule, as the event parsing is never up-to-date. In fact, I just realised that I last contributed to it, but I no longer intend to do so because it is much better to use the Gitlab-maintained go-gitlab module.The new approach should make the event Source compatible with all new event types (it was missing quite a few), and update the go-gitlab modules periodically is all you need to do to support the latest Gitlab development.
I didn't apply it, but it would be nice if the events contained an indication of what version of Gitlab or the go-gitlab module it is using as source, as only getting the benefit if they are up-to-date.
Proposed Changes
Release Note
Docs