178 Commits

Author SHA1 Message Date
Jason Song
7a34d37aad
fix: use ctx 2022-12-12 11:05:22 +08:00
Jason Song
dbef504584
fix: truncated title 2022-12-12 10:54:28 +08:00
Jason Song
22203eeb38
Update modules/notification/actions/helper.go
Co-authored-by: a1012112796 <1012112796@qq.com>
2022-12-12 10:48:32 +08:00
Jason Song
d378a78c79
Merge branch 'main' into feature/bots 2022-12-09 16:20:28 +08:00
KN4CK3R
3c59d31bc6
Add API management for issue/pull and comment attachments (#21783)
Close #14601
Fix #3690

Revive of #14601.
Updated to current code, cleanup and added more read/write checks.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andre Bruch <ab@andrebruch.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Norwin <git@nroo.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-12-09 14:35:56 +08:00
Jason Song
223782ca4c
refactor: rename to actions 2022-12-06 15:16:25 +08:00
Jason Song
56368f3963
refactor: use ctx in models 2022-12-06 14:15:48 +08:00
Jason Song
c07d0c1768
refactor: rename model 2022-12-06 13:48:09 +08:00
Jason Song
67c5c8868b
refactor: rename import alias 2022-12-05 15:57:45 +08:00
Jason Song
5f74b35377
refactor: rename files 2022-12-05 15:52:32 +08:00
Jason Song
704f72017d
refactor: rename packages 2022-12-05 15:45:38 +08:00
Jason Song
fdd3444c52
fix: add missing ctx 2022-12-05 14:46:34 +08:00
Jason Song
bd1af5b7f8
Merge branch 'main' into feature/bots 2022-12-05 14:31:00 +08:00
Lunny Xiao
0a7d3ff786
refactor some functions to support ctx as first parameter (#21878)
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: Lauris BH <lauris@nix.lv>
2022-12-03 10:48:26 +08:00
Jason Song
b0d6c7b86e
chore: use SPDX-License-Identifier 2022-12-02 22:25:31 +08:00
Jason Song
ab69fdc6fe
feat: more notifications 2022-12-01 14:13:22 +08:00
Jason Song
4487f04b14
feat: new way to notify 2022-11-30 18:24:47 +08:00
Jason Song
3793d55eca
fix: commit status 2022-11-29 18:48:00 +08:00
Jason Song
04d72d3500
refactor: rename tables to bot_* 2022-11-29 12:34:23 +08:00
Jason Song
6f5c3feb2d
fix: register bots notifier when enabled only 2022-11-28 18:24:09 +08:00
Jason Song
e37b3911d8
fix: use ref in options 2022-11-28 18:21:49 +08:00
Jason Song
66b558017f
Merge branch 'main' into feature/bots 2022-11-28 17:23:53 +08:00
flynnnnnnnnnn
e81ccc406b
Implement FSFE REUSE for golang files (#21840)
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>
2022-11-27 18:20:29 +00:00
Jason Song
ef4b3673dd
chore: golang lint 2022-11-26 22:12:52 +08:00
Jason Song
0bd9553219
chore: golang lint 2022-11-26 20:14:03 +08:00
Jason Song
1886156329 chore: remove outdated todos 2022-11-25 17:48:48 +08:00
Jason Song
fdd3c0434e feat: add IsForkPullRequest 2022-11-25 17:48:48 +08:00
Lunny Xiao
3e8de17db3 permission 2022-11-25 17:48:48 +08:00
Lunny Xiao
2ecb59c092 rename builds -> bots 2022-11-25 17:48:48 +08:00
Lunny Xiao
88b0ab89d0 Gitea bot will not fire the events otherwise it may causes a forever loop 2022-11-25 17:48:48 +08:00
Jason Song
9b021500b0 feat: ignore bots events of repo with disabled builds 2022-11-25 17:48:47 +08:00
Jason Song
5e7adf2004 chore: add extra fields to Run and RunJob 2022-11-25 17:48:47 +08:00
Lunny Xiao
0bc995889f Finish bots events notifications 2022-11-25 17:48:46 +08:00
Jason Song
dee4f2470b feat: inner build view UI 2022-11-25 17:48:46 +08:00
Jason Song
d6e100f6be fix: update run status 2022-11-25 17:48:46 +08:00
Jason Song
feab4b1601 feat: update task status 2022-11-25 17:48:45 +08:00
Lunny Xiao
f75a4abc5d build UI 2022-11-25 17:48:45 +08:00
Lunny Xiao
482832da76 delete unused structs 2022-11-25 17:48:45 +08:00
Jason Song
f355188e12 feat: parse workflows 2022-11-25 17:48:44 +08:00
Jason Song
5093d6b48e chore: fix mods 2022-11-25 17:48:44 +08:00
Bo-Yi.Wu
fb738c4192 chore(runner): support fetch detail stage data
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:44 +08:00
Bo-Yi.Wu
8255915350 chore: move core package to top folder.
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:44 +08:00
Bo-Yi.Wu
1148903d79 refactor: move build status to core package 2022-11-25 17:48:44 +08:00
Bo-Yi.Wu
eac6425b2f chore(gRPC): support update stage and step method.
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:44 +08:00
Lunny Xiao
2c4f6fd42f add most tables 2022-11-25 17:48:43 +08:00
Lunny Xiao
5a479bb034 Add builds UI 2022-11-25 17:48:43 +08:00
Lunny Xiao
7732392a96 Add bots 2022-11-25 17:48:33 +08:00
KN4CK3R
044c754ea5
Add context.Context to more methods (#21546)
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>
2022-11-19 16:12:33 +08:00
kolaente
085f717529
feat: notify doers of a merge when automerging (#21553)
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>
2022-11-03 23:49:00 +08:00
KN4CK3R
1887c95254
Decouple HookTask from Repository (#17940)
At the moment a repository reference is needed for webhooks. With the
upcoming package PR we need to send webhooks without a repository
reference. For example a package is uploaded to an organization. In
theory this enables the usage of webhooks for future user actions.

This PR removes the repository id from `HookTask` and changes how the
hooks are processed (see `services/webhook/deliver.go`). In a follow up
PR I want to remove the usage of the `UniqueQueue´ and replace it with a
normal queue because there is no reason to be unique.

Co-authored-by: 6543 <6543@obermui.de>
2022-10-21 18:21:56 +02:00