Commit Graph

3767 Commits

Author SHA1 Message Date
Jason Song
26b87561b6 fix: deal with empty repo 2022-12-06 18:32:26 +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
f2c7bbb0bc refactor: rename to actions-proto-go 2022-12-06 13:44:23 +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
bd1af5b7f8 Merge branch 'main' into feature/bots 2022-12-05 14:31:00 +08:00
Lunny Xiao
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
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
3dc5547775 Merge branch 'main' into feature/bots 2022-12-02 21:05:31 +08:00
silverwind
d64063277d Multiple improvements for comment edit diff (#21990)
- Use explicit avatar size so when JS copies the HTML, the size gets
copied with it
- Replace icon font use with SVG
- Improve styling and diff rendering
- Sort lists in `svg.js`

Fixes: https://github.com/go-gitea/gitea/issues/21924

<img width="933" alt="Screenshot 2022-11-30 at 17 52 17"
src="https://user-images.githubusercontent.com/115237/204859608-f322a8f8-7b91-45e4-87c0-82694e574115.png">

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2022-12-02 11:42:34 +02:00
Jason Song
b2745bff43 feat: support disable bots completely 2022-12-01 15:27:28 +08:00
Jason Song
847d65d724 Merge branch 'main' into feature/bots 2022-11-30 18:25:36 +08:00
花墨
7020c4afb7 Fix leaving organization bug on user settings -> orgs (#21983)
Fix #21772

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2022-11-30 17:00:00 +08:00
Jason Song
9808d084ba fix: remove useless codes 2022-11-30 16:07:00 +08:00
Jason Song
3793d55eca fix: commit status 2022-11-29 18:48:00 +08:00
Jason Song
564937a657 feat: bots_service.CreateCommitStatus 2022-11-29 18:21:27 +08:00
Jason Song
04d72d3500 refactor: rename tables to bot_* 2022-11-29 12:34:23 +08:00
Jason Song
797c21de1f Merge branch 'main' into feature/bots 2022-11-29 11:09:20 +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
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
dc48bf21c6 chore: add copyright 2022-11-26 21:33:05 +08:00
Jason Song
0bd9553219 chore: golang lint 2022-11-26 20:14:03 +08:00
zeripath
d7f12af805 Prevent NPE if trying to restore an already restored deleted branch (#21940)
If a deleted-branch has already been restored, a request to restore it
again will cause a NPE. This PR adds detection for this case, but also
disables buttons when they're clicked in order to help prevent
accidental repeat requests.

Fix #21930

Signed-off-by: Andrew Thornton <art27@cantab.net>
2022-11-25 20:58:20 +00:00
Jason Song
378e1f8d01 chore: fix problems caused by rebase 2022-11-25 17:58:34 +08:00
Jason Song
295a7f68c8 feat: update job info 2022-11-25 17:48:48 +08:00
Jason Song
1886156329 chore: remove outdated todos 2022-11-25 17:48:48 +08:00
Jason Song
4814a6ad1b fix: fill more contexts 2022-11-25 17:48:48 +08:00
Lunny Xiao
324d6711da permission check 2022-11-25 17:48:48 +08:00
Jason Song
e346581344 chore: update grpc router path 2022-11-25 17:48:48 +08:00
Lunny Xiao
3e8de17db3 permission 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
2ecb59c092 rename builds -> bots 2022-11-25 17:48:48 +08:00
Lunny Xiao
c61ac24c1c Fix bug 2022-11-25 17:48:48 +08:00
Bo-Yi.Wu
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
Jason Song
736275f0b1 feat: support cancel button 2022-11-25 17:48:48 +08:00
Bo-Yi Wu
797cdfbdb8 chore(runner): return task state. 2022-11-25 17:48:47 +08:00
Jason Song
0f5aab0c1a chore: remove Result from task and step 2022-11-25 17:48:47 +08:00
Jason Song
dd417a3270 chore: move job emitter to service 2022-11-25 17:48:47 +08:00
Lunny Xiao
f57e6999a2 Remove unused file 2022-11-25 17:48:47 +08:00
Lunny Xiao
110072a8d4 Fix log 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