Commit Graph

3615 Commits

Author SHA1 Message Date
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
zeripath
ea86c2b56a
Use GhostUser if needed for TrackedTimes (#22021)
When getting tracked times out of the db and loading their attributes
handle not exist errors in a nicer way. (Also prevent an NPE.)

Fix #22006

Signed-off-by: Andrew Thornton <art27@cantab.net>
2022-12-04 17:48:18 +00: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
76869e4b76
Merge branch 'main' into feature/bots 2022-12-02 22:17:49 +08:00
Jason Song
f59a74852b
Update gitea-vet to check FSFE REUSE (#22004)
Related to:
- #21840
- https://gitea.com/gitea/gitea-vet/pulls/21

What it looks like when it's working:
https://drone.gitea.io/go-gitea/gitea/64040/1/5

All available SPDX license identifiers: [SPDX License
List](https://spdx.org/licenses/).

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-12-02 22:14:57 +08:00
Jason Song
b9ab9b21c6
Merge branch 'go-gitea:main' into feature/bots 2022-12-02 13:28:14 +08:00
Lunny Xiao
f7ade6de7c
Fix generate index failure possibility on postgres (#21998)
@wxiaoguang Please review

Co-authored-by: silverwind <me@silverwind.io>
2022-12-02 11:15:36 +08:00
Jason Song
c5c9b4ae57
Merge branch 'main' into feature/bots 2022-12-01 13:39:47 +08:00
Lunny Xiao
b2c4870481
Fix parallel creating commit status bug with tests (#21911)
This PR is a follow up of #21469

Co-authored-by: Lauris BH <lauris@nix.lv>
2022-12-01 00:41:49 +08:00
Jason Song
8f2efdaf60
chore: add dbfs to migration 2022-11-29 17:19:26 +08:00
Jason Song
c1fce2cf7d
feat: remove bots resources after deleting repo 2022-11-29 16:25:58 +08:00
Jason Song
e33d4d7700
fix: rename table name string 2022-11-29 13:47:09 +08:00
Jason Song
04d72d3500
refactor: rename tables to bot_* 2022-11-29 12:34:23 +08:00
Jason Song
3ac6bf3db4
fix: avoid hash uuid 2022-11-29 11:42:03 +08:00
Jason Song
797c21de1f
Merge branch 'main' into feature/bots 2022-11-29 11:09:20 +08:00
Jason Song
f047ee0a40
Use random bytes to generate access token (#21959) 2022-11-28 23:37:42 +08:00
Jason Song
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
Jason Song
66b558017f
Merge branch 'main' into feature/bots 2022-11-28 17:23:53 +08:00
Jason Song
dccddd045e
test: init bot storage path 2022-11-28 17:19:15 +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
ae018b6b48
fix: use PutVarint instead of AppendVarint 2022-11-26 22:41:03 +08:00
Jason Song
ef4b3673dd
chore: golang lint 2022-11-26 22:12:52 +08:00
Jason Song
7854178da4
chore: fix duplicate to satisfy 2022-11-26 20:51:45 +08:00
Jason Song
0bd9553219
chore: golang lint 2022-11-26 20:14:03 +08:00
Jason Song
378e1f8d01 chore: fix problems caused by rebase 2022-11-25 17:58:34 +08:00
Jason Song
fdd3c0434e feat: add IsForkPullRequest 2022-11-25 17:48:48 +08:00
Jason Song
6ad8bddabf feat: GetRunningTaskByToken 2022-11-25 17:48:48 +08:00
Jason Song
ea1bc1b662 chore: replace with code.gitea.io/bots-proto-go 2022-11-25 17:48:48 +08:00
Lunny Xiao
52b32c37ad Use a new name for bots 2022-11-25 17:48:48 +08:00
Lunny Xiao
2ecb59c092 rename builds -> bots 2022-11-25 17:48:48 +08:00
Jason Song
736275f0b1 feat: support cancel button 2022-11-25 17:48:48 +08:00
Jason Song
0f5aab0c1a chore: remove Result from task and step 2022-11-25 17:48:47 +08:00
Lunny Xiao
f4bbd534b9 Allow gitea bot as trigger user 2022-11-25 17:48:47 +08:00
Lunny Xiao
9a45572ce2 Support bot site 2022-11-25 17:48:47 +08:00
Jason Song
7059cd7265 feat: update runner status 2022-11-25 17:48:47 +08:00
Jason Song
717344007a chore: remove GetRunnerByToken 2022-11-25 17:48:47 +08:00
Jason Song
7b2f1f5a91 chore: fix token format 2022-11-25 17:48:47 +08:00
Jason Song
140d57aecb feat: use runner token hash 2022-11-25 17:48:47 +08:00
Jason Song
a1ddfb8200 feat: use new FullSteps 2022-11-25 17:48:47 +08:00
Lunny Xiao
aa09eb63e1 Support bot user 2022-11-25 17:48:47 +08:00
Lunny Xiao
d8b401ab06 Fix virutal user 2022-11-25 17:48:47 +08:00
Jason Song
e19f2c8c44 chore: add ids to task 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
Jason Song
cab3fc072a fix: use updated to check abandoned jobs 2022-11-25 17:48:47 +08:00
fuxiaohei
8c3ed11ed9 feat(runner-view): add task list in runnder details page, in admin 2022-11-25 17:48:47 +08:00
Jason Song
8a8214113b fix: use subtle compare 2022-11-25 17:48:47 +08:00
Jason Song
0e74431229 feat: get task by token 2022-11-25 17:48:47 +08:00