aboutsummaryrefslogtreecommitdiffstats
path: root/modules/notification/action
Commit message (Collapse)AuthorAgeFilesLines
* Webhooks: for issue close/reopen action, add commit ID that caused it (#22583)Brecht Van Lommel2023-01-241-1/+1
| | | | | | | | The `commit_id` property name is the same as equivalent functionality in GitHub. If the action was not caused by a commit, an empty string is used. This can for example be used to automatically add a Resolved label to an issue fixed by a commit, or clear it when the issue is reopened.
* Implement FSFE REUSE for golang files (#21840)flynnnnnnnnnn2022-11-272-4/+2
| | | | | | | | | Change all license headers to comply with REUSE specification. Fix #16132 Co-authored-by: flynnnnnnnnnn <flynnnnnnnnnn@github> Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Add `context.Context` to more methods (#21546)KN4CK3R2022-11-192-62/+58
| | | | | | | This PR adds a context parameter to a bunch of methods. Some helper `xxxCtx()` methods got replaced with the normal name now. Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* feat: notify doers of a merge when automerging (#21553)kolaente2022-11-031-0/+14
| | | | | | | | | | | | | | | | | | | | | | I found myself wondering whether a PR I scheduled for automerge was actually merged. It was, but I didn't receive a mail notification for it - that makes sense considering I am the doer and usually don't want to receive such notifications. But ideally I want to receive a notification when a PR was merged because I scheduled it for automerge. This PR implements exactly that. The implementation works, but I wonder if there's a way to avoid passing the "This PR was automerged" state down so much. I tried solving this via the database (checking if there's an automerge scheduled for this PR when sending the notification) but that did not work reliably, probably because sending the notification happens async and the entry might have already been deleted. My implementation might be the most straightforward but maybe not the most elegant. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Move some files into models' sub packages (#20262)Lunny Xiao2022-08-252-57/+57
| | | | | | | | | | | | | | | | | | | | | | | | | * Move some files into models' sub packages * Move functions * merge main branch * Fix check * fix check * Fix some tests * Fix lint * Fix lint * Revert lint changes * Fix error comments * Fix lint Co-authored-by: 6543 <6543@obermui.de>
* Refactor AssertExistsAndLoadBean to use generics (#20797)Lunny Xiao2022-08-161-2/+2
| | | | | | | * Refactor AssertExistsAndLoadBean to use generics * Fix tests Co-authored-by: zeripath <art27@cantab.net>
* Move issues related files into models/issues (#19931)Lunny Xiao2022-06-131-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Move access and repo permission to models/perm/access * fix test * fix git test * Move functions sequence * Some improvements per @KN4CK3R and @delvh * Move issues related code to models/issues * Move some issues related sub package * Merge * Fix test * Fix test * Fix test * Fix test * Rename some files
* Use a struct as test options (#19393)Lunny Xiao2022-04-141-1/+3
| | | | | | | * Use a struct as test options * Fix name * Fix test
* Move milestone to models/issues/ (#19278)Lunny Xiao2022-04-081-2/+3
| | | | | | | | | | | * Move milestone to models/issues/ * Fix lint * Fix test * Fix lint * Fix lint
* Lock gofumpt to v0.3.0 and run it (#18866)silverwind2022-02-231-1/+2
| | | | | We can't depend on `latest` version of gofumpt because the output will not be stable across versions. Lock it down to the latest version released yesterday and run it again.
* format with gofumpt (#18184)65432022-01-201-4/+2
| | | | | | | | | | | * gofumpt -w -l . * gofumpt -w -l -extra . * Add linter * manual fix * change make fmt
* Propagate context and ensure git commands run in request context (#17868)zeripath2022-01-191-3/+8
| | | | | | | | | This PR continues the work in #17125 by progressively ensuring that git commands run within the request context. This now means that the if there is a git repo already open in the context it will be used instead of reopening it. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Simplify parameter types (#18006)Gusted2021-12-201-1/+1
| | | Remove repeated type declarations in function definitions.
* Fix rename notification bug (#18008)Lunny Xiao2021-12-171-2/+0
|
* Move repository model into models/repo (#17933)Lunny Xiao2021-12-102-12/+14
| | | | | | | | | | | | | | | * Some refactors related repository model * Move more methods out of repository * Move repository into models/repo * Fix test * Fix test * some improvements * Remove unnecessary function
* Fix a panic in NotifyCreateIssueComment (caused by string truncation) (#17928)wxiaoguang2021-12-091-7/+9
| | | | | | | | | | | * Fix a panic in NotifyCreateIssueComment (caused by string truncation) * more unit tests * refactor * fix some edge cases * use SplitStringAtByteN for comment content
* Move user related model into models/user (#17781)Lunny Xiao2021-11-242-19/+21
| | | | | | | | | | | | | * Move user related model into models/user * Fix lint for windows * Fix windows lint * Fix windows lint * Move some tests in models * Merge
* A better go code formatter, and now `make fmt` can run in Windows (#17684)wxiaoguang2021-11-171-0/+1
| | | | * go build / format tools * re-format imports
* Decouple unit test, remove intermediate `unittestbridge` package (#17662)wxiaoguang2021-11-161-6/+5
| | | Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Decouple unit test code from business code (#17623)wxiaoguang2021-11-121-2/+3
|
* Move db related basic functions to models/db (#17075)Lunny Xiao2021-09-191-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Add an abstract json layout to make it's easier to change json library (#16528)Lunny Xiao2021-07-241-3/+1
| | | | | | | | | | | * 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
* fix double 'push tag' action feed (#15078)a10121127962021-03-211-2/+4
| | | Signed-off-by: a1012112796 <1012112796@qq.com>
* Migrate to use jsoniter instead of encoding/json (#14841)zeripath2021-03-011-1/+3
| | | | | | | | | | * 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>
* Add dismiss review feature (#12674)a10121127962021-02-111-0/+20
| | | | | | | | | | | | | | | * Add dismiss review feature refs: https://github.blog/2016-10-12-dismissing-reviews-on-pull-requests/ https://developer.github.com/v3/pulls/reviews/#dismiss-a-review-for-a-pull-request * change modal ui and error message * Add unDismissReview api Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* 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"
* Refactor push update (#13381)Lunny Xiao2020-12-081-0/+69
| | | | | | | * Refactor Push update * Remove the push_test since the function has been removed. * Use default branch setting instead master
* Fix typo (#13380)Lunny Xiao2020-10-311-1/+1
|
* Refactor: Move PushUpdateOptions (#13363)Lunny Xiao2020-10-301-2/+2
| | | Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
* Fix panic when adding long comment (#12892)mrsdizzie2020-09-181-1/+1
| | | Previous PR #12881 causes out of bounds panic by working on wrong string.
* Add size limit for content of comment on action ui (#12881)赵智超2020-09-181-1/+10
| | | | | Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: mrsdizzie <info@mrsdizzie.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add action feed for new release (#12324)赵智超2020-07-291-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add action feed for new release Signed-off-by: a1012112796 <1012112796@qq.com> * fix lint * Apply suggestions from code review * Add ReleaseID to the action table * Remove error message * Fold the attachments download list * remove attchment download list * simplify code * fix create release from existing tag * simplify ui * translation change * fix test Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* [refactor] notify remove unused praram (#9804)65432020-01-161-2/+1
|
* Move push commits from models to modules/repository (#9370)Lunny Xiao2020-01-101-1/+2
| | | | | | | | | | | | | | | | * 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>
* Add ActionCommentPull action (#9456)mrsdizzie2019-12-221-3/+7
| | | | | | | | | | | * Add ActionCommentPull action Adds ActionCommentPull action to distinguish between a comment on an issue and on a pull request * Update modules/notification/action/action.go Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Refactor comment (#9330)Lunny Xiao2019-12-151-0/+54
| | | | | | | | * Refactor comment * fix test * improve code
* Move mirror sync actions to notification (#9022)Lunny Xiao2019-11-241-0/+50
| | | | | | * Move mirror sync actions to notification * fix lint
* Move merge actions to notification (#9024)Lunny Xiao2019-11-211-0/+15
| | | | | | * Move merge actions to notification * Add missing mail notification
* Move transfer repository and rename repository on a service package and ↵Lunny Xiao2019-11-151-5/+20
| | | | | | | | | | | | | | | | | | | | | | start action notification (#8573) * move transfer repository and rename repository on a service package and start action notification * remove unused codes * fix lint * fix bugs * fix test * fix test * fix test * fix lint * update go mod and sum
* Update dashboard context for PR reviews (#8995)John Olheiser2019-11-151-4/+14
| | | | | | | | | | | | | | | | | | * Update dashboard context for PR reviews Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update options/locale/locale_en-US.ini Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * Only append head action if it has content or is approval/rejection Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update options/locale/locale_en-US.ini Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Refactor pull request review (#8954)Lunny Xiao2019-11-141-0/+49
| | | | | | | | | | | | | | | | | | * refactor submit review * remove unnecessary code * remove unused comment * fix lint * remove duplicated actions * remove duplicated actions * fix typo * fix comment content
* Move notifywatchers from models to notification (#8907)Lunny Xiao2019-11-111-0/+26
|
* Move some actions to notification/action (#8779)Lunny Xiao2019-11-082-1/+64
| | | | | | | | * Move some actions to notification/action * Fix test * fix test
* Move actions to notification (#8785)Lunny Xiao2019-11-031-0/+77