forgejo/models/actions
sillyguodong f5c7d4cfdd
Reduce unnecessary DB queries for Actions tasks (#25199)
Close #24544

Changes:

- Create `action_tasks_version` table to store the latest version of
each scope (global, org and repo).
- When a job with the status of `waiting` is created, the tasks version
of the scopes it belongs to will increase.
- When the status of a job already in the database is updated to
`waiting`, the tasks version of the scopes it belongs to will increase.
- On Gitea side, in `FeatchTask()`, will try to query the
`action_tasks_version` record of the scope of the runner that call
`FetchTask()`. If the record does not exist, will insert a row. Then,
Gitea will compare the version passed from runner to Gitea with the
version in database, if inconsistent, try pick task. Gitea always
returns the latest version from database to the runner.

Related:

- Protocol: https://gitea.com/gitea/actions-proto-def/pulls/10
- Runner: https://gitea.com/gitea/act_runner/pulls/219
2023-07-24 06:11:27 +00:00
..
artifact.go Actions Artifacts support uploading multiple files and directories (#24874) 2023-07-21 10:42:01 +08:00
run.go Reduce unnecessary DB queries for Actions tasks (#25199) 2023-07-24 06:11:27 +00:00
run_job.go Reduce unnecessary DB queries for Actions tasks (#25199) 2023-07-24 06:11:27 +00:00
run_job_list.go Implement actions (#21937) 2023-01-31 09:45:19 +08:00
run_list.go Add actor and status dropdowns to run list (#25118) 2023-06-21 04:25:14 +00:00
runner.go Support changing labels of Actions runner without re-registration (#24806) 2023-06-13 22:28:31 +08:00
runner_list.go Implement actions (#21937) 2023-01-31 09:45:19 +08:00
runner_token.go Implement actions (#21937) 2023-01-31 09:45:19 +08:00
status.go Require approval to run actions for fork pull request (#22803) 2023-02-24 15:58:49 +08:00
task.go Reduce unnecessary DB queries for Actions tasks (#25199) 2023-07-24 06:11:27 +00:00
task_list.go Implement actions (#21937) 2023-01-31 09:45:19 +08:00
task_output.go Support upload outputs and use needs context on Actions (#24230) 2023-04-22 16:12:41 -04:00
task_step.go Implement actions (#21937) 2023-01-31 09:45:19 +08:00
tasks_version.go Reduce unnecessary DB queries for Actions tasks (#25199) 2023-07-24 06:11:27 +00:00
utils.go Implement actions (#21937) 2023-01-31 09:45:19 +08:00
utils_test.go Implement actions (#21937) 2023-01-31 09:45:19 +08:00
variable.go Support configuration variables on Gitea Actions (#24724) 2023-06-20 22:54:15 +00:00