Skip to content

Clear the data/log for jobs in Gitea Actions that are too old #24256

Open
@wolfogre

Description

@wolfogre

Feature Description

Jobs that have been done for too long no longer need to retain data/log, so it is necessary to regularly clean them up.

Details

#26275 (comment) : Some logic which could help:

  • What you want delete is a run, so you need to delete a row of ActionRun.
  • A run could include multiple jobs, so you need to delete multiple rows of ActionRunJob.
  • When a job has been picked up by a runner to execute, there will be a task, however, a job could be rerun many times, so you need to delete multiple rows of ActionTask.
  • Every task could include
    • multiple steps, so ActionTaskStep
    • multiple outputs, so ActionTaskOutput
  • The log of the task is stored as a file (in DBFS or storage), so you need to detele it according to ActionTask.LogFilename or ActionTask.LogInStorage.
  • In addition, there may be some artifacts uploaded to the run, so you need to delete multiple rows of ActionArtifact.
    • The files of artifacts are stored in storage, so you need to remove them.
  • Finally, update NumActionRuns and NumClosedActionRuns of Repository.

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic/gitea-actionsrelated to the actions of Giteatype/featureCompletely new functionality. Can only be merged if feature freeze is not active.type/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions