-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Add webhook payload size optimization options #35129
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
base: main
Are you sure you want to change the base?
Add webhook payload size optimization options #35129
Conversation
It should be more flexible to use "limit number" instead of "bool" |
f249f67
to
47c395d
Compare
47c395d
to
5472d66
Compare
|
5e828e9
to
258d8ee
Compare
models/migrations/v1_25/v322.go
Outdated
|
||
func AddWebhookPayloadOptimizationColumns(x *xorm.Engine) error { | ||
type Webhook struct { | ||
MetaSettings string `xorm:"meta_settings TEXT"` |
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.
XORM natively supports JSON type IIRC
} | ||
|
||
// getPayloadConfigLimit extracts the "limit" integer value from a payload config map | ||
func getPayloadConfigLimit(m map[string]any) int { |
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.
It seems fragile, I don't think we need these tricks to parse form input
"files": map[string]any{ | ||
"enable": true, | ||
"limit": 2, | ||
}, |
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.
What does "enable" mean?
If "enable=false", then "no files" or "no commits"? Or "enable=false" means "disable the limit"?
Co-authored-by: wxiaoguang <[email protected]> Signed-off-by: Kerwin Bryant <[email protected]>
…win612/gitea into kerwin612-feature/webhook-payload-optimization
This PR adds webhook payload size optimization options to help reduce payload size for large commits or pushes with many commits. This feature is particularly useful for target URLs that restrict payload size or have performance problems handling large JSON parsing.
