Webhooks: differences between UI and API #349
Labels
No Label
has/backport
has/pull
in progress
invalid
kind/breaking
kind/bug
kind/build
kind/deployment
kind/docs
kind/enhancement
kind/feature
kind/lint
kind/proposal
kind/question
kind/refactor
kind/security
kind/testing
kind/translation
kind/ui
need/backport
priority/critical
priority/low
priority/maybe
priority/medium
reviewed/duplicate
reviewed/invalid
reviewed/wontfix
skip-changelog
status/blocked
status/needs-feedback
status/needs-reviews
status/wip
upstream/gitea
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gitea/go-sdk#349
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I'm utilizing the API for a gitea terraform provider (non-official), and I notice some differences between repo web hooks created in the UI vs the API.
The http_method seem to be missing from the API, both in read and write operations:
Then the events field, only allows a simple list of events, it seems to ignore the trigger options available in the GUI to:
push_only (Push events),
send_everything (All events),
choose_events (Custom events...)
If push_only or send_everything are set in the GUI, the API GET returns an empty event list, and there is no way to set these triggers (that I can find) through the API.
Am I missing something, or are there plans to synchronise this functionality?
Update: one other thing to note, is that in the GUI it is possible to edit the secret without re-creating the webhook, but the API/SDK does not update the secret with the PATCH operation.
I'll have a look what can be done throu SDK and what has to be done upstream
Hello,
I have been able to successfully create Webhooks using the UI but I am not able to replicate the same using SDK.
Gitea version: v1.15.3
UI:
Under Site Administration:
a) Default webhooks,
b) System webhooks
And At Repo level in settings,
c) Repository level webhooks
Whereas the API has the following functions:
SDK:
Based on this, I have the following questions:
a) How should the
Webhook Target URL
,Trigger On
fields be set in the Struct?b) How can System/Default Webhooks be created using the SDK?
c) Is it possible to create Org Level Hooks from the UI?
I found the OrgWebhooks also in the UI and was able to create them using the UI
Tried looking into the gitea codebase to understand how the createOrgWebhook request should be submitted using the SDK, and I came up with the below approach
This however sets Custom Events section as the Webhook Trigger on Critera and marks "Push" events. I was not able to figure out how to set "Push Events" as the "Trigger On" criteria instead of "Custom -> Push"
However, I believe both are equivalent ; and hence this solution is good enough