Commit Graph

3521 Commits

Author SHA1 Message Date
f75a4abc5d build UI 2022-11-25 17:48:45 +08:00
482832da76 delete unused structs 2022-11-25 17:48:45 +08:00
1cba52376a feat: use run id and job id in page view 2022-11-25 17:48:45 +08:00
d320eb66f4 feat: fetch job data 2022-11-25 17:48:45 +08:00
027d748fe2 feat: api for fetch job state 2022-11-25 17:48:45 +08:00
e68295fb7c chore(dep): upgrade proto-go 2022-11-25 17:48:45 +08:00
7be1d90a5a fix: ack right index 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
5b989e2a11 feat(bots): update runner data in 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
699f5c5a06 chore(runner): add soft deleted field 2022-11-25 17:48:45 +08:00
dff0d4b907 feat(runner): update edit.html 2022-11-25 17:48:45 +08:00
206b2a104e feat(runner): begin runner view ui 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
ade88b3a7b chore(runner): register new runner
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-25 17:48:44 +08:00
0993c40c4f chore(runner): create runner token table
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
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
f355188e12 feat: parse workflows 2022-11-25 17:48:44 +08:00
905bce6cb6 feat: models for runner task 2022-11-25 17:48:44 +08:00
5f0cb6b9e5 fix merge 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
db02603882 Fix bug 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
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
92d15afd18 database-filesystem, demo log tailing in term 2022-11-25 17:48:43 +08:00
931d8c2c21 add runners management ui 2022-11-25 17:48:43 +08:00
a1bd3a8932 Fix build 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
702f4b521e Add index for access_token (#21908)
The `token_last_eight` field has been used in `GetAccessTokenBySHA `:
2022-11-23 20:49:41 -06:00
e483ec3a00 Fix vertical align of committer avatar rendered by email address (#21884)
Committer avatar rendered by `func AvatarByEmail` are not vertical align
as `func Avatar` does.

- Replace literals `ui avatar` and `ui avatar vm` with the constant
`DefaultAvatarClass`
2022-11-23 15:57:37 -06:00
787f6c3227 Ensure that Webhook tasks are not double delivered (#21558)
When re-retrieving hook tasks from the DB double check if they have not
been delivered in the meantime. Further ensure that tasks are marked as
delivered when they are being delivered.

In addition:
* Improve the error reporting and make sure that the webhook task
population script runs in a separate goroutine.
* Only get hook task IDs out of the DB instead of the whole task when
repopulating the queue
* When repopulating the queue make the DB request paged

Ref #17940 

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-11-23 22:10:04 +08:00
4c00d8f916 Move migration test fixtures to the correct directories (#21901)
Unfortunately #21549 changed the name of Testcases without changing
their associated fixture directories.

Fix #21854

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-11-23 18:24:55 +08:00
32db62515f Add package registry cleanup rules (#21658)
Fixes #20514
Fixes #20766
Fixes #20631

This PR adds Cleanup Rules for the package registry. This allows to
delete unneeded packages automatically. Cleanup rules can be set up from
the user or org settings.
Please have a look at the documentation because I'm not a native english
speaker.

Rule Form

![grafik](https://user-images.githubusercontent.com/1666336/199330792-c13918a6-e196-4e71-9f53-18554515edca.png)

Rule List

![grafik](https://user-images.githubusercontent.com/1666336/199331261-5f6878e8-a80c-4985-800d-ebb3524b1a8d.png)

Rule Preview

![grafik](https://user-images.githubusercontent.com/1666336/199330917-c95e4017-cf64-4142-a3e4-af18c4f127c3.png)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-11-20 16:08:38 +02: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
20385b52a3 Prevent dangling user redirects (#21856)
- It's possible that the `user_redirect` table contains a user id that
no longer exists.
- Delete a user redirect upon deleting the user.
- Add a check for these dangling user redirects to check-db-consistency.
2022-11-18 22:23:34 +08:00
88d5275614 Do not allow Ghost access to limited visible user/org (#21849)
The Ghost user should not be allowed to have access to a limited visible
user/org.

Co-authored-by: Lauris BH <lauris@nix.lv>
2022-11-17 14:29:33 -05:00
c772934ff6 Adjust gitea doctor --run storages to check all storage types (#21785)
The doctor check `storages` currently only checks the attachment
storage. This PR adds some basic garbage collection functionality for
the other types of storage.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-11-15 16:08:59 +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
92525ddffd Init git module before database migration (#21764)
Close #21761

Some database migrations depend on the git module.
2022-11-10 14:22:39 +00:00
385462d36c Fix dashboard ignored system setting cache (#21621)
This is a performance regression from #18058

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
2022-11-10 14:43:53 +08:00