wxiaoguang
81926d61db
Decouple unit test, remove intermediate `unittestbridge` package ( #17662 )
...
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years ago
wxiaoguang
df64fa4865
Decouple unit test code from business code ( #17623 )
3 years ago
Lunny Xiao
33fca2b537
Move webhook into models/webhook/ ( #17579 )
3 years ago
Lunny Xiao
a4bfef265d
Move db related basic functions to models/db ( #17075 )
...
* Move db related basic functions to models/db
* Fix lint
* Fix lint
* Fix test
* Fix lint
* Fix lint
* revert unnecessary change
* Fix test
* Fix wrong replace string
* Use *Context
* Correct committer spelling and fix wrong replaced words
Co-authored-by: zeripath <art27@cantab.net>
3 years ago
6543
2289580bb7
[API] generalize list header ( #16551 )
...
* Add info about list endpoints to CONTRIBUTING.md
* Let all list endpoints return X-Total-Count header
* Add TODOs for GetCombinedCommitStatusByRef
* Fix models/issue_stopwatch.go
* Rrefactor models.ListDeployKeys
* Introduce helper func and use them for SetLinkHeader related func
3 years ago
Lunny Xiao
9f31f3aa8a
Add an abstract json layout to make it's easier to change json library ( #16528 )
...
* Add an abstract json layout to make it's easier to change json library
* Fix import
* Fix import sequence
* Fix blank lines
* Fix blank lines
3 years ago
KN4CK3R
9b1b4b5433
Refactor Webhook + Add X-Hub-Signature ( #16176 )
...
This PR removes multiple unneeded fields from the `HookTask` struct and adds the two headers `X-Hub-Signature` and `X-Hub-Signature-256`.
## ⚠️ BREAKING ⚠️
* The `Secret` field is no longer passed as part of the payload.
* "Breaking" change (or fix?): The webhook history shows the real called url and not the url registered in the webhook (`deliver.go`@129).
Close #16115
Fixes #7788
Fixes #11755
Co-authored-by: zeripath <art27@cantab.net>
3 years ago
Bo-Yi Wu
167b0f46ef
chore(models): rewrite code format. ( #14754 )
...
* chore: rewrite format.
* chore: update format
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* chore: update format
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* chore: Adjacent parameters with the same type should be grouped together
* chore: update format.
4 years ago
zeripath
f0e15250b9
Migrate to use jsoniter instead of encoding/json ( #14841 )
...
* Migrate to use jsoniter
* fix tests
* update gitea.com/go-chi/binding
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
4 years ago
Brad Albright
a598877fdf
Cron job to cleanup hook_task table ( #13080 )
...
Close **Prune hook_task Table (#10741 )**
Added a cron job to delete webhook deliveries in the hook_task table. It can be turned on/off and the schedule controlled globally via app.ini. The data can be deleted by either the age of the delivery which is the default or by deleting the all but the most recent deliveries _per webhook_.
Note: I had previously submitted pr #11416 but I closed it when I realized that I had deleted per repository instead of per webhook. Also, I decided allowing the settings to be overridden via the ui was overkill. Also this version allows the deletion by age which is probably what most people would want.
4 years ago
Lunny Xiao
42354dfe45
Move webhook type from int to string ( #13664 )
...
* Move webhook type from int to string
* rename webhook_services
* finish refactor
* Fix merge
* Ignore unnecessary ci
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
4 years ago
John Olheiser
3f1c0841cb
Granular webhook events ( #9626 )
...
* Initial work
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Add PR reviews and API coverage
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Split up events
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Add migration and locale
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Format
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Revert IsPull
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix comments
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix tests
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix PR reviews
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix issue_comment
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Make fmt
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Migrations
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Backwards compatible API
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix feishu
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Move session commit
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
5 years ago
SpaWn2KiLl
1f01f53c53
API add/generalize pagination ( #9452 )
...
* paginate results
* fixed deadlock
* prevented breaking change
* updated swagger
* go fmt
* fixed find topic
* go mod tidy
* go mod vendor with go1.13.5
* fixed repo find topics
* fixed unit test
* added Limit method to Engine struct; use engine variable when provided; fixed gitignore
* use ItemsPerPage for default pagesize; fix GetWatchers, getOrgUsersByOrgID and GetStargazers; fix GetAllCommits headers; reverted some changed behaviors
* set Page value on Home route
* improved memory allocations
* fixed response headers
* removed logfiles
* fixed import order
* import order
* improved swagger
* added function to get models.ListOptions from context
* removed pagesize diff on unit test
* fixed imports
* removed unnecessary struct field
* fixed go fmt
* scoped PR
* code improvements
* code improvements
* go mod tidy
* fixed import order
* fixed commit statuses session
* fixed files headers
* fixed headers; added pagination for notifications
* go mod tidy
* go fmt
* removed Private from user search options; added setting.UI.IssuePagingNum as default valeu on repo's issues list
* Apply suggestions from code review
Co-Authored-By: 6543 <6543@obermui.de>
Co-Authored-By: zeripath <art27@cantab.net>
* fixed build error
* CI.restart()
* fixed merge conflicts resolve
* fixed conflicts resolve
* improved FindTrackedTimesOptions.ToOptions() method
* added backwards compatibility on ListReleases request; fixed issue tracked time ToSession
* fixed build error; fixed swagger template
* fixed swagger template
* fixed ListReleases backwards compatibility
* added page to user search route
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
5 years ago
Lunny Xiao
a966a0298e
Move more webhook codes from models to webhook module ( #8802 )
...
* Move more webhook codes from models to webhook module
5 years ago
Lunny Xiao
0e7f7df3cf
Move webhook to a standalone package under modules ( #8747 )
...
* Move webhook to a standalone package under modules
* fix test
* fix comments
5 years ago
WGH
6ddd3b0b47
Implement webhook branch filter ( #7791 )
...
* Fix validate() function to handle errors in embedded anon structs
* Implement webhook branch filter
See #2025 , #3998 .
5 years ago
Lunny Xiao
34eee25bd4
Move sdk structs to modules/structs ( #6905 )
...
* move sdk structs to moduels/structs
* fix tests
* fix fmt
* fix swagger
* fix vendor
6 years ago
techknowlogick
56da256853
Telegram webhook ( #4227 )
6 years ago
Lunny Xiao
24941a1046
Add more webhooks support and refactor webhook templates directory ( #3929 )
...
* add more webhook support
* move hooks templates to standalone dir and add more webhooks ui
* fix tests
* update vendor checksum
* add more webhook support
* move hooks templates to standalone dir and add more webhooks ui
* fix tests
* update vendor checksum
* update vendor
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* load attributes when created release
* update comparsion doc
7 years ago
Morlinest
8e61823ec4
Fix tests code to prevent some runtime errors ( #2381 )
...
* Fix tests code to prevent some runtime errors
* Reduce nesting
7 years ago
Rémy Boulanouar
e0c6ab2d44
Add Gitea Webhook ( #1755 )
...
* Replace Gogs by Gitea
* Fix missing changes
* Create Gitea webhook and put Gogs webhook apart.
8 years ago
Ethan Koenig
0934d1b1ea
Bug fixes and unit tests for models/webhook ( #751 )
8 years ago