aboutsummaryrefslogtreecommitdiffstats
path: root/modules/notification/webhook
Commit message (Collapse)AuthorAgeFilesLines
* API pull's head/base have correct permission (#17214)pricly-yellow2021-10-071-12/+12
| | | | | | | | | | close #17181 * for all pull requests API return permissions of caller * for all webhook return empty permissions Signed-off-by: Danila Kryukov <pricly_yellow@dismail.de> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: 6543 <6543@obermui.de>
* Implemented head_commit for webhooks (#16282)KN4CK3R2021-06-291-2/+4
| | | | | | | * Removed Len field. * Added head_commit webhook field. * Added comment for returns.
* [refactor] Unify the export of user data via API (#15144)65432021-03-271-40/+40
| | | | | * [refactor] unify how user data is exported via API * test time via unix timestamp
* Send notifications for mentions in pulls, issues, (code-)comments (#14218)Jimmy Praet2021-01-021-4/+4
| | | | | Fixes #14187: mention handling extracted from email notification code Fixes #14013: add notification for mentions in pull request code comments Fixes #13450: Not receiving any emails with setting "Only Email on Mention"
* Cause NotifyMigrateRepository to emit a repo create webhook (#14004)zeripath2020-12-171-0/+12
| | | | | | | | | | | | * Cause NotifyMigrateRepository to emit a repo create webhook This PR simply makes NotifyMigrateRepository emit a Create Repo webhook. The reason for no new payload is that the information sent to NotifyMigrateRepository is only essentially the same as NotifyCreateRepository Fix #13996 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Move webhook type from int to string (#13664)Lunny Xiao2020-12-081-36/+36
| | | | | | | | | | | | | | * 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>
* Move Repo APIFormat to convert package (#13787)65432020-12-021-36/+36
| | | | | * Move Repo APIFormat to convert package * tweek
* Add missed sync branch/tag webhook (#13538)Lunny Xiao2020-11-131-0/+8
| | | | Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Refactor: Move PushUpdateOptions (#13363)Lunny Xiao2020-10-301-8/+8
| | | Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
* [Refactor] Move APIFormat functions into convert package (#12856)65432020-10-171-45/+45
| | | | | | | | | | | | | | | | | | | | | | | * USER APIFormat -> ToUser * Migrate more and mark APIFormat deprecated * models.Comment APIFormat() -> convert.ToComment * models.Release APIFormat() -> convert.ToRelease * models.Attachments APIFormat() -> convert.ToReleaseAttachments * models.CommitStatus APIFormat() -> convert.ToCommitStatus * finish migration to convert.ToUser * Move Test * Imprufe Test * fix test Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix repository create/delete event webhooks (#13008)James Lakin2020-10-021-18/+14
| | | | | | | | | | | This small PR changes the webhook trigger behaviour to be more in line with what's expected. (When 'repository' events are enabled, of course) In other words: For system-wide or default webhooks, repository events will now trigger said webhook. Previously it had to be under an organization for create events to be visible - a tad unexpected! Deleting a repository will now fire its own defined webhooks, not just organisational and system ones. In order to enable the latter the webhook has to now be triggered before the actual repo undergoes deletion. I'm willing to tweak this to try and 'grab' the webhook model beforehand and trigger the webhook notifier directly afterwards, but this may make the code more complex for little benefit. Closes #11766, #9180.
* Granular webhook events (#9626)John Olheiser2020-03-061-46/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* [Refactor] move APIFormat() of Issue and Label to convert package (#10423)65432020-02-281-11/+11
| | | | | | | | | | | | | | | | | | | * Label: delete .APIFormat() and use convert.ToLabel() * move issue APIFormat too * add missing one * move TEST too * handle error -> return empty APIIssue * Apply suggestions from code review Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Fix webhook bug (#10427)Lunny Xiao2020-02-231-2/+2
| | | | Co-authored-by: techknowlogick <matti@mdranta.net>
* [refactor] notify remove unused praram (#9804)65432020-01-161-1/+1
|
* Move push commits from models to modules/repository (#9370)Lunny Xiao2020-01-101-2/+3
| | | | | | | | | | | | | | | | * Move push commits from models to modules/repository * fix test * fix test * fix test * fix test * fix test Co-authored-by: zeripath <art27@cantab.net>
* Move pull request api convert to convert package (#9664)Lunny Xiao2020-01-101-12/+13
| | | | | | * Move pull request api convert to convert package * Rename ToPullRequest to ToAPIPullRequest
* Change target branch for pull request (#6488)Mario Lubenka2019-12-161-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Adds functionality to change target branch of created pull requests Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Use const instead of var in JavaScript additions Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Check if branches are equal and if PR already exists before changing target branch Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Make sure to check all commits Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Print error messages for user as error flash message Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Disallow changing target branch of closed or merged pull requests Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Resolve conflicts after merge of upstream/master Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Change order of branch select fields Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes duplicate check Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Use ctx.Tr for translations Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Recompile JS Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Use correct translation namespace Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Remove redundant if condition Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Moves most change branch logic into pull service Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Completes comment Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Add Ref to ChangesPayload for logging changed target branches instead of creating a new struct Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Revert changes to go.mod Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Directly use createComment method Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Return 404 if pull request is not found. Move written check up Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Remove variable declaration Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Return client errors on change pull request target errors Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Return error in commit.HasPreviousCommit Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adds blank line Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Test patch before persisting new target branch Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Update patch before testing (not working) Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes patch calls when changeing pull request target Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes unneeded check for base name Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Moves ChangeTargetBranch completely to pull service. Update patch status. Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Set webhook mode after errors were validated Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Update PR in one transaction Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Move logic for check if head is equal with branch to pull model Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adds missing comment and simplify return Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adjust CreateComment method call Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
* Refactor comment (#9330)Lunny Xiao2019-12-151-1/+1
| | | | | | | | * Refactor comment * fix test * improve code
* Move mirror sync actions to notification (#9022)Lunny Xiao2019-11-241-0/+22
| | | | | | * Move mirror sync actions to notification * fix lint
* Move merge actions to notification (#9024)Lunny Xiao2019-11-211-0/+38
| | | | | | * Move merge actions to notification * Add missing mail notification
* Add Close() method to gogitRepository (#8901)zeripath2019-11-131-0/+2
| | | | | | | | | In investigating #7947 it has become clear that the storage component of go-git repositories needs closing. This PR adds this Close function and adds the Close functions as necessary. In TransferOwnership the ctx.Repo.GitRepo is closed if it is open to help prevent the risk of multiple open files. Fixes #7947
* Fix Notify Create Ref Error on tag creation (#8936)zeripath2019-11-131-2/+2
| | | | | | * Fix Notify Create Ref Error on tag creation * Just use the provided full ref instead of BranchCommit
* Move release webhook to notification (#8817)Lunny Xiao2019-11-061-3/+31
| | | | | | | | | | * Move release webhook to notification * Extract release webhook method * fix bug * fix import
* Move repofiles webhooks to notification (#8807)Lunny Xiao2019-11-061-1/+46
|
* Move pull webhook to notification (#8805)Lunny Xiao2019-11-051-0/+62
| | | | | | * Move pull webhook to notification * fix fmt
* Move actions to notification (#8785)Lunny Xiao2019-11-031-0/+36
|
* Move push commits events to notification (#8783)Lunny Xiao2019-11-031-0/+23
| | | | | | | | * Move push commits events to notification * Update modules/notification/base/null.go Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Move issue milestone assign to issue service and move webhook to ↵Lunny Xiao2019-11-021-0/+42
| | | | notification (#8780)
* Rename HookQueue to hookQueue (#8778)Lunny Xiao2019-11-021-27/+0
| | | | | | * Rename HookQueue to hookQueue * fix lint
* Move labels webhooks to notification (#8749)Lunny Xiao2019-11-021-0/+47
| | | | | | * Move webhooks to notification * fix notification
* Move webhook to a standalone package under modules (#8747)Lunny Xiao2019-11-011-31/+32
| | | | | | | | * Move webhook to a standalone package under modules * fix test * fix comments
* Move webhook codes from service to webhook notification (#8712)Lunny Xiao2019-10-301-0/+83
| | | | | | | | * Move webhook codes from service to webhook notification * move deletecomment webhook to notifications * fix notification
* Move issue change content from models to service (#8711)Lunny Xiao2019-10-301-0/+38
| | | | | | * Move issue change content from models to service * fix lint
* Move issue notifications (#8713)Lunny Xiao2019-10-291-0/+15
|
* Move issue change status from models to service (#8691)Lunny Xiao2019-10-281-1/+42
|
* Move more issue assignee code from models to issue service (#8690)Lunny Xiao2019-10-281-0/+92
| | | | | | * Move more issue assignee code from models to issue service * fix test
* Move some repositories' operations to a standalone service package (#8557)Lunny Xiao2019-10-261-0/+64
| | | | | | | | | | | | * Move some repositories' operations to a standalone service package * improve code * remove unused codes * add rollback when fork failed * add repo when return
* Move clearlabels from models to issue service (#8326)Lunny Xiao2019-10-151-0/+67
* move clearlabels from models to issue service * improve code * Apply suggestions from code review Co-Authored-By: zeripath <art27@cantab.net>