Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial stub for custom webhooks #18748

Closed
wants to merge 15 commits into from
Closed

Initial stub for custom webhooks #18748

wants to merge 15 commits into from

Conversation

deepio
Copy link

@deepio deepio commented Feb 13, 2022

I thought it would be best to start making a customizable webhook instead of creating an integration for everything under the sun. We can add more optional headers as they come up?

@lunny
Copy link
Member

lunny commented Feb 13, 2022

I expect there is a config file to add more than one custom webhook.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 13, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #18748 (672a4d2) into main (4d93984) will decrease coverage by 0.09%.
The diff coverage is 40.04%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #18748      +/-   ##
==========================================
- Coverage   46.64%   46.54%   -0.10%     
==========================================
  Files         846      853       +7     
  Lines      121331   122586    +1255     
==========================================
+ Hits        56595    57061     +466     
- Misses      57859    58637     +778     
- Partials     6877     6888      +11     
Impacted Files Coverage Δ
cmd/admin_auth_ldap.go 79.59% <ø> (ø)
models/webhook/hooktask.go 50.29% <ø> (ø)
models/webhook/webhook.go 70.84% <ø> (ø)
modules/git/pipeline/lfs_nogogit.go 0.00% <0.00%> (ø)
modules/git/pipeline/namerev.go 0.00% <0.00%> (ø)
modules/queue/manager.go 39.59% <0.00%> (-0.83%) ⬇️
modules/queue/queue_bytefifo.go 46.90% <0.00%> (-2.54%) ⬇️
routers/api/v1/repo/migrate.go 50.71% <0.00%> (ø)
routers/api/v1/repo/patch.go 0.00% <0.00%> (ø)
routers/private/hook_verification.go 0.00% <0.00%> (ø)
... and 69 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 27af864...672a4d2. Read the comment docs.

@deepio
Copy link
Author

deepio commented Feb 14, 2022

Something broke since I last built this, I will @ someone when its ready for review but until then this is broken.

@zeripath
Copy link
Contributor

So if I understand this code correctly - this custom hook is essentially:

  1. Provide one url
  2. Send all of the hook results to that url

?

@deepio
Copy link
Author

deepio commented Feb 15, 2022

One URL is required, everything else is optional. Optional headers, optional POST data, POST or GET option but right now this is to get the ball rolling.

@KN4CK3R
Copy link
Member

KN4CK3R commented Feb 17, 2022

Could replace #18224

@lunny
Copy link
Member

lunny commented Feb 18, 2022

That PR has been merged.

@@ -404,6 +404,12 @@ type NewPackagistHookForm struct {
WebhookForm
}

type NewCustomHookForm struct {
Copy link
Member

Choose a reason for hiding this comment

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

comment is needed.

services/webhook/custom.go Outdated Show resolved Hide resolved
templates/org/settings/hook_new.tmpl Outdated Show resolved Hide resolved
templates/repo/settings/webhook/base_list.tmpl Outdated Show resolved Hide resolved
@lunny lunny added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Feb 18, 2022
@lunny lunny added this to the 1.17.0 milestone Feb 18, 2022
@lunny lunny added the type/changelog Adds the changelog for a new Gitea version label Feb 18, 2022
@wxiaoguang wxiaoguang removed this from the 1.17.0 milestone Jun 12, 2022
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
@delvh delvh removed the type/changelog Adds the changelog for a new Gitea version label Oct 7, 2023
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants