KN4CK3R
5a84558e7c
Display total commit count in hook message ( #21400 ) ( #21481 )
...
Backport of #21400
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago
6543
54e9ee37a7
format with gofumpt ( #18184 )
...
* gofumpt -w -l .
* gofumpt -w -l -extra .
* Add linter
* manual fix
* change make fmt
3 years ago
Gusted
ff2fd08228
Simplify parameter types ( #18006 )
...
Remove repeated type declarations in function definitions.
3 years ago
Lunny Xiao
33fca2b537
Move webhook into models/webhook/ ( #17579 )
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
KN4CK3R
4fcae3d06d
Add tests for all webhooks ( #16214 )
...
* Added tests for MS Teams.
* Added tests for Dingtalk.
* Added tests for Telegram.
* Added tests for Feishu.
* Added tests for Discord.
* Added tests for closed issue and pullrequest comment.
* Added tests for Matrix.
* Trim all spaces.
* Added tests for Slack.
* Added JSONPayload tests.
* Added general tests.
* Replaced duplicated code.
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 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
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
kolaente
64133126cd
Update golangci-lint to version 1.31.0 ( #13102 )
...
This PR updates golangci-lint to the latest version 1.31.0.
The upgrade introduced a new check for which I've fixed or disabled most cases.
Signed-off-by: kolaente <k@knt.li>
4 years ago
Lunny Xiao
b51bd7f1d6
Refactor webhook payload convertion ( #12310 )
...
* Refactor webhook payload convertion
* Fix lint
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years ago
Cornel
ebc35f2b2e
Fix comments webhook panic ( #12046 )
...
* Fix webhook comment handling type cast panic
* Handle HookIssueReviewed action in webhook
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 years ago
Sijmen Schoon
66a9ef9036
Fix ref links in issue overviews for tags ( #8742 )
...
* Properly generate ref URLs
Tags used to not generate correct URLs (src/branch/tags/1.0.0 instead of
src/tags/1.0.0).
Also cleans up some code around it with the created helper functions.
* Fix formatting and create migration
* Add copyright head to utils_test
* Use a raw query for the ref migration
* Remove semicolon
* Quote column and table names in migration SQL
* Change || to CONCAT, since MSSQL does not support ||
* Make migration engine aware
* Add missing import
* Move ref EndName and URL to the issue service
* Fix tests
* Add test for commit refs
* Update issue.go
* Use the right command for building JavaScript bundles
* Prepare for merge
* Check for refs/* before prepending in migration
* Update services/issue/issue_test.go
* Update modules/git/utils_test.go
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: techknowlogick <matti@mdranta.net>
5 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
John Olheiser
38a6b11015
Fix RocketChat ( #9908 )
...
* Fix RocketChat??
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Don't send attachment for repo create/delete
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Make fmt
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
5 years ago
John Olheiser
5b2d9333f1
Add HTML URL to API Issues ( #9654 )
...
* Add HTML URL to API Issues
Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Swagger
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
5 years ago
John Olheiser
fb3a6aba7d
Only show sender if it makes sense ( #9601 )
...
Signed-off-by: jolheiser <john.olheiser@gmail.com>
5 years ago
Cornel
81e63d0714
Refactor webhooks to reduce code duplication ( #9422 )
...
* Start webhook refactoring to reduce code duplication
* More webhook refactoring
* Unify webhook release messages
* Fix webhook release link
* Remove sql import
* More webhook refactoring
* More webhook refactoring
* Webhook tests extended
* Fixed issue opened webhook
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <matti@mdranta.net>
5 years ago
Cornel
04ab1138f6
Fix Slack webhook payload title generation to work with Mattermost ( #9378 )
...
* Fix Slack webhook payload title generation to work with Mattermost by using a markdown link instead of html
* Fix Slack webhook attachment title and title link handling
5 years ago
Lauris BH
8f8c250ddb
Make consistent links to repository in the Slack/Mattermost notificiations ( #9205 )
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
WGH
28c5ae27d6
Fix Slack webhook fork message ( #7774 )
...
The order of forkee and fork was mixed up.
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
Lunny Xiao
d578b71d61
move code.gitea.io/git to code.gitea.io/gitea/modules/git ( #6364 )
...
* move code.gitea.io/git to code.gitea.io/gitea/modules/git
* fix imports
* fix fmt
* fix misspell
* remove wrong tests data
* fix unit tests
* fix tests
* fix tests
* fix tests
* fix tests
* fix tests
* enable Debug to trace the failure tests
* fix tests
* fix tests
* fix tests
* fix tests
* fix tests
* comment commit count tests since git clone depth is 50
* fix tests
* update from code.gitea.io/git
* revert change to makefile
6 years ago
zeripath
11e316654e
Fix deadlock in webhook PullRequest ( #6102 )
...
Signed-off-by: Andrew Thornton <art27@cantab.net>
6 years ago
Lanre Adelowo
746cf22d8a
handle milestone events for issues and PR ( #5947 )
6 years ago
Lanre Adelowo
945804f800
Webhook for Pull Request approval/rejection ( #5027 )
6 years ago
Lunny Xiao
6bdc556b7f
Fix some webhooks bugs ( #3981 )
...
* fix some webhooks bugs
* update vendor
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* fix test
* fix clearlabels
* fix pullrequest webhook bug fix #3492
* update release webhook description
* remove unused code
* fix push webhook in pull request
* small changes
7 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
kolaente
95f2e2b57b
Multiple assignees ( #3705 )
7 years ago
Ethan Koenig
513375c429
Make URL scheme unambiguous ( #2408 )
...
* Make URL scheme unambiguous
Redirect old routes to new routes
* Fix redirects to new URL scheme, and update template
* Fix branches/_new endpoints, and update integration test
7 years ago
Ethan Koenig
b689bb6180
Webhooks for repo creation/deletion ( #1663 )
...
* Webhooks for repo creation/deletion
* add createHookTask
* Add handles for GetSlackPayload and GetDiscordPayload
7 years ago
Ethan Koenig
1207bda94b
Fix typos in models/ ( #576 )
8 years ago
Kim "BKC" Carlbäcker
42ec5ce740
Fix breakage from vendor-update
8 years ago
Lunny Xiao
94da472717
Golint fixed for modules/setting ( #262 )
...
* golint fixed for modules/setting
* typo fixed and renamed UNIXSOCKET to UnixSocket
8 years ago
Bwko
33a2ac3830
Lint models/update.go & webhook_slack.go
8 years ago
Sandro Santilli
a1c5f02444
Fix import path of go-sdk ( #141 )
...
From code.gitea.io/go-sdk/gitea
To code.gitea.io/sdk/gitea
8 years ago
Sandro Santilli
4247304f5a
Update import paths from github.com/go-gitea to code.gitea.io ( #135 )
...
- Update import paths from github.com/go-gitea to code.gitea.io
- Fix import path for travis
See https://docs.travis-ci.com/user/languages/go#Go-Import-Path
8 years ago
Sandro Santilli
80eea77953
Use MixedCase constant names
...
See https://github.com/golang/go/wiki/CodeReviewComments#mixed-caps
8 years ago
Thomas Boerger
4c6c16f358
Replaced go-gogs-client with go-sdk imports
8 years ago
Sandro Santilli
6e4252dad4
Replace gogits/git-module dependency with go-gitea/git ( #94 )
...
* Replace gogits/git-module dependency with go-gitea/git
Fixes #92
* Remove git alias for git module import (not needed)
8 years ago
Rémy Boulanouar
2d68bd1ef9
Change import reference to match gitea instead of gogs ( #37 )
8 years ago
Unknwon
dccb0c15b9
Replace convert.To with APIFormat calls
8 years ago
Unknwon
3f7f4852ef
#2246 fully support of webhooks for pull request
8 years ago
Unknwon
19423957b1
rename import path
9 years ago
Unknwon
9a2e43bff2
move out git module and #1573 send push hook
9 years ago
Unknwon
76d4b9288b
#2045 have fallback but empty value
9 years ago
Unknwon
05ba8622f0
#2045 move fallback to empty string
9 years ago
Unknwon
e0bae9547a
more fixes on #2045
9 years ago
Unknwon
834d38a8fb
#2045 add short version as fallback to Slack payload
9 years ago