Commit Graph

1064 Commits

Author SHA1 Message Date
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
32a5797608 chore: debug runner log reporting 2022-11-25 17:48:44 +08:00
79966763c6 feat: distribute tasks to runner 2022-11-25 17:48:44 +08:00
6f18f76577 chore(runner): update runner status using proto define
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:44 +08:00
530faf7227 feat: assign task to runner 2022-11-25 17:48:44 +08:00
4233090738 chore(runner): get token from header
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:44 +08:00
f79bc4f605 chore(runner): vaildate the repo URL
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:44 +08:00
ade88b3a7b chore(runner): register new runner
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:44 +08:00
e21c07cc55 feat: parse runner from ctx 2022-11-25 17:48:44 +08:00
4dd135580f chore(runner): update to latest proto format.
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:44 +08:00
fb738c4192 chore(runner): support fetch detail stage data
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:44 +08:00
8255915350 chore: move core package to top folder.
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:44 +08:00
1148903d79 refactor: move build status to core package 2022-11-25 17:48:44 +08:00
ea0cf8515e chore(gRPC): handle requesut for stage data
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:44 +08:00
eac6425b2f chore(gRPC): support update stage and step method.
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:44 +08:00
68d416bd1b chore(gRPC): initial request method
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:44 +08:00
e07d416366 chore(model): create build, stage, step and logs table
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:44 +08:00
e05f224d19 chore(runner): support register
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:44 +08:00
c10414a018 test(ping): add testing for gRPC 2022-11-25 17:48:44 +08:00
e4e41a8065 chore(bots): re-structure grpc folder.
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:44 +08:00
2cba8fafd8 chore(grpc): add health check and grpc v1, alpha version
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:44 +08:00
257ba77e8d chore(proto): update import path
Signed-off-by: GiteaBot <teabot@gitea.io>
2022-11-25 17:48:44 +08:00
ef3a74a1ba chore(proto): Add ping service
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:44 +08:00
0e79fc556a chore(router): Add grpc and grep-web api
Using connect-go package

https://github.com/bufbuild/connect-go

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:44 +08:00
931d8c2c21 add runners management ui 2022-11-25 17:48:43 +08:00
2c4f6fd42f add most tables 2022-11-25 17:48:43 +08:00
5a479bb034 Add builds UI 2022-11-25 17:48:43 +08:00
7732392a96 Add bots 2022-11-25 17:48:33 +08:00
a1ae83f36e Workaround for container registry push/pull errors (#21862)
This PR addresses #19586

I added a mutex to the upload version creation which will prevent the
push errors when two requests try to create these database entries. I'm
not sure if this should be the final solution for this problem.

I added a workaround to allow a reupload of missing blobs. Normally a
reupload is skipped because the database knows the blob is already
present. The workaround checks if the blob exists on the file system.
This should not be needed anymore with the above fix so I marked this
code to be removed with Gitea v1.20.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-11-25 13:47:46 +08:00
fc7a2d5a95 Add support for HEAD requests in Maven registry (#21834)
Related #18543

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-11-24 16:25:13 +02:00
e4eaa68a2b Replace yaml.v2 with yaml.v3 (#21832)
I don't see why we have to use two versions of yaml. The difference
between the two versions has nothing to do with our usage.
2022-11-21 16:36:59 +08:00
044c754ea5 Add context.Context to more methods (#21546)
This PR adds a context parameter to a bunch of methods. Some helper
`xxxCtx()` methods got replaced with the normal name now.

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-11-19 16:12:33 +08:00
43ab9324c5 Fix setting HTTP headers after write (#21833)
The headers can't be modified after it was send to the client.
2022-11-18 01:55:15 +08:00
34283a74e8 Allow detect whether it's in a database transaction for a context.Context (#21756)
Fix #19513

This PR introduce a new db method `InTransaction(context.Context)`,
and also builtin check on `db.TxContext` and `db.WithTx`.
There is also a new method `db.AutoTx` has been introduced but could be used by other PRs.

`WithTx` will always open a new transaction, if a transaction exist in context, return an error.
`AutoTx` will try to open a new transaction if no transaction exist in context.
That means it will always enter a transaction if there is no error.

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: 6543 <6543@obermui.de>
2022-11-12 21:18:50 +01:00
a0a425a13b Add some documentation to packages (#21648)
In #21637 it was mentioned that the purpose of the API routes for the
packages is unclear. This PR adds some documentation.

Fix #21637

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2022-11-12 18:59:15 +00:00
bf2078640f Load GitRepo in API before deleting issue (#21720)
Fix #20921.

The `ctx.Repo.GitRepo` has been used in deleting issues when the issue
is a PR.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
2022-11-12 08:32:04 +08:00