Commit Graph

1099 Commits

Author SHA1 Message Date
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
b4b22e78ad feat: generate token for task 2022-11-25 17:48:46 +08:00
1e209973ee chore(runner): create new token
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:46 +08:00
82c6fc2217 Add commit status for push event 2022-11-25 17:48:46 +08:00
e28c95ea5c feat: load secrets in task response 2022-11-25 17:48:46 +08:00
04634b9143 feat: pick jobs of the runner only 2022-11-25 17:48:46 +08:00
dca2ca2f47 fix: remove usage of core 2022-11-25 17:48:46 +08:00
8dbe30dff9 feat: tranfer log to storage 2022-11-25 17:48:45 +08:00
d2f8d5ded1 fix: use file name for log 2022-11-25 17:48:45 +08:00
dd5b2c5dfd feat: optimize log indexes 2022-11-25 17:48:45 +08:00
d7b99e0028 feat: use dbfs to store log 2022-11-25 17:48:45 +08:00
482832da76 delete unused structs 2022-11-25 17:48:45 +08:00
4c2d976629 chore(runner): get runner by uuid from header
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:45 +08:00
eeaac2c9f7 chore(runner): remove url checker from register
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:45 +08:00
b7aaa3ba77 chore(runner): support update runner status. 2022-11-25 17:48:45 +08:00
fbb9f437a6 feat(runner): delete runner from admin html page 2022-11-25 17:48:45 +08:00
848a1ae309 feat: receive task logs 2022-11-25 17:48:45 +08:00
7497155d14 feat: update step state 2022-11-25 17:48:45 +08:00
6df53243aa feat: create task steps 2022-11-25 17:48:45 +08:00
9648482ed6 feat(bots): move runner status update function to context 2022-11-25 17:48:45 +08:00
1a78fd3494 feat(runner): update runner last_online and status when FetchTask 2022-11-25 17:48:44 +08:00