Commit Graph

3599 Commits

Author SHA1 Message Date
3ac6bf3db4 fix: avoid hash uuid 2022-11-29 11:42:03 +08:00
797c21de1f Merge branch 'main' into feature/bots 2022-11-29 11:09:20 +08:00
f047ee0a40 Use random bytes to generate access token (#21959) 2022-11-28 23:37:42 +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
dccddd045e test: init bot storage path 2022-11-28 17:19:15 +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
ae018b6b48 fix: use PutVarint instead of AppendVarint 2022-11-26 22:41:03 +08:00
ef4b3673dd chore: golang lint 2022-11-26 22:12:52 +08:00
7854178da4 chore: fix duplicate to satisfy 2022-11-26 20:51:45 +08:00
0bd9553219 chore: golang lint 2022-11-26 20:14:03 +08:00
378e1f8d01 chore: fix problems caused by rebase 2022-11-25 17:58:34 +08:00
fdd3c0434e feat: add IsForkPullRequest 2022-11-25 17:48:48 +08:00
6ad8bddabf feat: GetRunningTaskByToken 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
52b32c37ad Use a new name for bots 2022-11-25 17:48:48 +08:00
2ecb59c092 rename builds -> bots 2022-11-25 17:48:48 +08:00
736275f0b1 feat: support cancel button 2022-11-25 17:48:48 +08:00
0f5aab0c1a chore: remove Result from task and step 2022-11-25 17:48:47 +08:00
f4bbd534b9 Allow gitea bot as trigger user 2022-11-25 17:48:47 +08:00
9a45572ce2 Support bot site 2022-11-25 17:48:47 +08:00
7059cd7265 feat: update runner status 2022-11-25 17:48:47 +08:00
717344007a chore: remove GetRunnerByToken 2022-11-25 17:48:47 +08:00
7b2f1f5a91 chore: fix token format 2022-11-25 17:48:47 +08:00
140d57aecb feat: use runner token hash 2022-11-25 17:48:47 +08:00
a1ddfb8200 feat: use new FullSteps 2022-11-25 17:48:47 +08:00
aa09eb63e1 Support bot user 2022-11-25 17:48:47 +08:00
d8b401ab06 Fix virutal user 2022-11-25 17:48:47 +08:00
e19f2c8c44 chore: add ids to task 2022-11-25 17:48:47 +08:00
5e7adf2004 chore: add extra fields to Run and RunJob 2022-11-25 17:48:47 +08:00
cab3fc072a fix: use updated to check abandoned jobs 2022-11-25 17:48:47 +08:00
8c3ed11ed9 feat(runner-view): add task list in runnder details page, in admin 2022-11-25 17:48:47 +08:00
8a8214113b fix: use subtle compare 2022-11-25 17:48:47 +08:00
0e74431229 feat: get task by token 2022-11-25 17:48:47 +08:00
465c348922 fix: show blocked jobs 2022-11-25 17:48:47 +08:00
dc7e64041a feat: use job emitter 2022-11-25 17:48:47 +08:00
cf40dca0c4 feat: record job needs 2022-11-25 17:48:46 +08:00
234cdc67e1 fix: run's status should failure with canceled jobs 2022-11-25 17:48:46 +08:00
9da6b9f92d feat: cancel abandoned jobs 2022-11-25 17:48:46 +08:00
83bb244a2c fix: update step status when stoping 2022-11-25 17:48:46 +08:00
705aaf3eb2 feat: stop zombie and endless tasks 2022-11-25 17:48:46 +08:00
b1da53286d feat: show step duration 2022-11-25 17:48:46 +08:00
b4b22e78ad feat: generate token for task 2022-11-25 17:48:46 +08:00
339ddf4c5f Virtual user gitea-bots 2022-11-25 17:48:46 +08:00
3c7fce0d37 fix: distribute log files to folders 2022-11-25 17:48:46 +08:00
82c6fc2217 Add commit status for push event 2022-11-25 17:48:46 +08:00
964f67e189 chore: remove unique index of runner name 2022-11-25 17:48:46 +08:00
04634b9143 feat: pick jobs of the runner only 2022-11-25 17:48:46 +08:00
ec673c0e79 fix: avoid assigning job to multiple runners 2022-11-25 17:48:46 +08:00
b00cd8de90 Fix bug 2022-11-25 17:48:46 +08:00