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

Conversation

6 participants
@techknowlogick
Copy link
Member

commented May 14, 2019

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

@@ -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",

This comment has been minimized.

Copy link
@techknowlogick

techknowlogick May 14, 2019

Author Member

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.

@@ -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{

This comment has been minimized.

Copy link
@techknowlogick

techknowlogick May 14, 2019

Author Member

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

@codecov-io

This comment has been minimized.

Copy link

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 and removed lgtm/need 2 labels May 15, 2019

@GiteaBot GiteaBot added lgtm/done and removed lgtm/need 1 labels May 15, 2019

@lunny

lunny approved these changes May 15, 2019

@lunny lunny merged commit 5fb1ad7 into go-gitea:master May 15, 2019

2 checks passed

approvals/lgtm this commit looks good
continuous-integration/drone/pr Build is passing
Details

@techknowlogick techknowlogick deleted the techknowlogick:fix-webhooks branch May 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.