-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Support system hook API #14537
Support system hook API #14537
Conversation
1393a7a
to
4c7c494
Compare
please resolve conflicts :) |
Codecov Report
@@ Coverage Diff @@
## main #14537 +/- ##
=========================================
+ Coverage 0 47.87% +47.87%
=========================================
Files 0 1056 +1056
Lines 0 143662 +143662
=========================================
+ Hits 0 68778 +68778
- Misses 0 66626 +66626
- Partials 0 8258 +8258
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Co-authored-by: Jason Song <i@wolfogre.com>
@@ -0,0 +1,81 @@ | |||
// Copyright 2021 The Gitea Authors. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy new year × 2 🎉
// DeleteDefaultSystemWebhook deletes an admin-configured default or system webhook (where Org and Repo ID both 0) | ||
func DeleteDefaultSystemWebhook(ctx context.Context, id int64) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the Default
or the System
redundant?
// "$ref": "#/responses/Hook" | ||
|
||
hookID := ctx.ParamsInt64(":id") | ||
hook, err := webhook.GetSystemOrDefaultWebhook(ctx, hookID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, there is a difference between system
and default
hooks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System hooks are run on all repos; default hooks are only copied to new repos. So they can accomplish the same thing, but system hooks are more reliable in that everyone runs the same code, but default hooks are more reliable in that they won't change just because the admin flipped something around.
it seems like you weren't the only one misled by the ambiguity: #23139
This PR add system hook API.