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

Webhook Logs show proper HTTP Method, and allow change HTTP method in form #6953

Merged
merged 4 commits into from
May 15, 2019
Merged

Webhook Logs show proper HTTP Method, and allow change HTTP method in form #6953

merged 4 commits into from
May 15, 2019

Conversation

techknowlogick
Copy link
Member

Fix #6951

Note: this doesn't solve issues some users were having with webhooks not sending.

@techknowlogick techknowlogick added this to the 1.9.0 milestone May 14, 2019
@techknowlogick techknowlogick added the pr/wip This PR is not ready for review label May 14, 2019
@techknowlogick techknowlogick removed the pr/wip This PR is not ready for review label May 14, 2019
@@ -98,6 +98,7 @@ func addHook(ctx *context.APIContext, form *api.CreateHookOption, orgID, repoID
URL: form.Config["url"],
ContentType: models.ToHookContentType(form.Config["content_type"]),
Secret: form.Config["secret"],
HTTPMethod: "POST",
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: I've hardcoded this as POST for now. Currently there are several checks that essentially force POST to be the method, but I want to keep this PR as simple as possible. This of course will need to be changed in future.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 14, 2019
@@ -755,28 +755,23 @@ func prepareWebhooks(e Engine, repo *Repository, event HookEventType, p api.Payl

func (t *HookTask) deliver() {
t.IsDelivered = true
t.RequestInfo = &HookRequest{
Copy link
Member Author

Choose a reason for hiding this comment

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

I've moving these back to the original spot before the GET PR was merged.

@codecov-io
Copy link

codecov-io commented May 14, 2019

Codecov Report

Merging #6953 into master will increase coverage by <.01%.
The diff coverage is 52.94%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #6953      +/-   ##
=========================================
+ Coverage    41.4%   41.4%   +<.01%     
=========================================
  Files         441     441              
  Lines       59718   59724       +6     
=========================================
+ Hits        24728   24731       +3     
- Misses      31753   31756       +3     
  Partials     3237    3237
Impacted Files Coverage Δ
routers/repo/webhook.go 1.38% <0%> (-0.01%) ⬇️
routers/api/v1/utils/hook.go 0% <0%> (ø) ⬆️
models/webhook.go 59.75% <60%> (-0.09%) ⬇️
modules/log/colors_router.go 83.33% <0%> (-4.17%) ⬇️
models/repo_list.go 67.89% <0%> (+1.05%) ⬆️

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 710245e...11ec17b. Read the comment docs.

@techknowlogick techknowlogick changed the title Logs show proper HTTP Method, and allow change HTTP method in form Webhook Logs show proper HTTP Method, and allow change HTTP method in form May 15, 2019
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels May 15, 2019
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels May 15, 2019
@lunny lunny merged commit 5fb1ad7 into go-gitea:master May 15, 2019
@techknowlogick techknowlogick deleted the fix-webhooks branch May 15, 2019 13:40
jeffliu27 pushed a commit to jeffliu27/gitea that referenced this pull request Jul 18, 2019
… form (go-gitea#6953)

* Fix go-gitea#6951 - logs show proper HTTP Method, and allow change HTTP method
in form

* enforce POST method for webhook

* set default if method is empty
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Webhook GET bugs
6 participants