Commit Graph

1119 Commits

Author SHA1 Message Date
dfa1b6168d Merge branch 'main' into feature/bots 2022-12-12 10:46:13 +08:00
68704532c2 Rename almost all Ctx functions (#22071) 2022-12-10 10:46:31 +08:00
d378a78c79 Merge branch 'main' into feature/bots 2022-12-09 16:20:28 +08:00
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
266a122ba2 Merge branch 'main' into feature/bots 2022-12-08 18:11:18 +08:00
0585ac3ac6 Update go dev dependencies (#22064)
`golangci-lint`
[deprecated](https://github.com/golangci/golangci-lint/issues/1841) a
bunch of linters, removed them.
2022-12-08 16:21:37 +08:00
223782ca4c refactor: rename to actions 2022-12-06 15:16:25 +08:00
56368f3963 refactor: use ctx in models 2022-12-06 14:15:48 +08:00
c07d0c1768 refactor: rename model 2022-12-06 13:48:09 +08:00
f2c7bbb0bc refactor: rename to actions-proto-go 2022-12-06 13:44:23 +08:00
67c5c8868b refactor: rename import alias 2022-12-05 15:57:45 +08:00
5f74b35377 refactor: rename files 2022-12-05 15:52:32 +08:00
704f72017d refactor: rename packages 2022-12-05 15:45:38 +08:00
bd1af5b7f8 Merge branch 'main' into feature/bots 2022-12-05 14:31:00 +08:00
36cbaec54c Fix ListBranches to handle empty case (#21921)
Fix #21910

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2022-12-04 08:57:17 +00:00
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
b0d6c7b86e chore: use SPDX-License-Identifier 2022-12-02 22:25:31 +08:00
9808d084ba fix: remove useless codes 2022-11-30 16:07:00 +08:00
3793d55eca fix: commit status 2022-11-29 18:48:00 +08:00
564937a657 feat: bots_service.CreateCommitStatus 2022-11-29 18:21:27 +08:00
04d72d3500 refactor: rename tables to bot_* 2022-11-29 12:34:23 +08:00
797c21de1f Merge branch 'main' into feature/bots 2022-11-29 11:09:20 +08:00
9607750b5e Replace fmt.Sprintf with hex.EncodeToString (#21960)
`hex.EncodeToString` has better performance than `fmt.Sprintf("%x",
[]byte)`, we should use it as much as possible.

I'm not an extreme fan of performance, so I think there are some
exceptions:

- `fmt.Sprintf("%x", func(...)[N]byte())`
- We can't slice the function return value directly, and it's not worth
adding lines.
    ```diff
    func A()[20]byte { ... }
    - a := fmt.Sprintf("%x", A())
    - a := hex.EncodeToString(A()[:]) // invalid
    + tmp := A()
    + a := hex.EncodeToString(tmp[:])
    ```
- `fmt.Sprintf("%X", []byte)`
- `strings.ToUpper(hex.EncodeToString(bytes))` has even worse
performance.
2022-11-28 11:19:18 +00:00
66b558017f Merge branch 'main' into feature/bots 2022-11-28 17:23:53 +08:00
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
0bd9553219 chore: golang lint 2022-11-26 20:14:03 +08:00
4814a6ad1b fix: fill more contexts 2022-11-25 17:48:48 +08:00
324d6711da permission check 2022-11-25 17:48:48 +08:00
e346581344 chore: update grpc router path 2022-11-25 17:48:48 +08:00
3e8de17db3 permission 2022-11-25 17:48:48 +08:00
ea1bc1b662 chore: replace with code.gitea.io/bots-proto-go 2022-11-25 17:48:48 +08:00
c61ac24c1c Fix bug 2022-11-25 17:48:48 +08:00
5d849cea33 chore(runner): remove update runner status
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:48 +08:00
797cdfbdb8 chore(runner): return task state. 2022-11-25 17:48:47 +08:00
0f5aab0c1a chore: remove Result from task and step 2022-11-25 17:48:47 +08:00
dd417a3270 chore: move job emitter to service 2022-11-25 17:48:47 +08:00
f57e6999a2 Remove unused file 2022-11-25 17:48:47 +08:00
110072a8d4 Fix log 2022-11-25 17:48:47 +08:00
7059cd7265 feat: update runner status 2022-11-25 17:48:47 +08:00
0682f0fcc5 chore: reduse log noise 2022-11-25 17:48:47 +08:00
140d57aecb feat: use runner token hash 2022-11-25 17:48:47 +08:00
94241daaaa feat: check runner token 2022-11-25 17:48:47 +08:00
9c6476754d chore: shouldn't import act_runner 2022-11-25 17:48:47 +08:00
fc2c70033a Add default bot url 2022-11-25 17:48:47 +08:00
5d83ffa658 chore: log updating task 2022-11-25 17:48:47 +08:00
ce39e45cc2 chore: reduce log noise 2022-11-25 17:48:47 +08:00
aa09eb63e1 Support bot user 2022-11-25 17:48:47 +08:00
381d06729b fix: repository in context 2022-11-25 17:48:47 +08:00
a20b8aa909 chore(runner): return cancel evnet after upload the log
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:47 +08:00
dc7e64041a feat: use job emitter 2022-11-25 17:48:47 +08:00