go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.1k stars 5.41k forks source link

Delete workflow runs #26219

Open sebthom opened 1 year ago

sebthom commented 1 year ago

Feature Description

GitHub Actions allows to delete single workflow runs. Would be nice to have this in Gitea Actions too.

My use case would be to delete some obsolete failed runs on branches where the corresponding commit was removed from a branch via a force push.

Screenshots

No response

cassiozareck commented 1 year ago

Is there anyone working on this? I'm interested in implement this functionality.

My steps would be create a new function in actions/run.go that can do almost the opposite of InsertRun, creating a transaction to erase tables associate with the Run as well its jobs. Also implement a higher-level function on view.go so that the router can use it and pass the parameter of the workflow run ID through the web.

steadfasterX commented 10 months ago

really would like to see this too :+1:

Enrico204 commented 1 month ago

I am interested too, although the time I have to work on is very limited. @cassiozareck have you started working on some code?

cassiozareck commented 1 month ago

Hi Enrico! I'm no longer working on this feature and gitea in general. Ive wrote some code you can check out here https://github.com/go-gitea/gitea/pull/26275 but its a bit outdated and It's a slight more complex feature than I thought. I think @wolfogre may help you in this case

wolfogre commented 1 month ago

Thank you for your work on this. I'll pick it up later once I have time.

tycho commented 1 month ago

I'd like to see this feature too. I'm specifically interested in some kind of cron task to delete runs older than a certain duration (e.g. 1 month or something). They take up tons of space in the database, so it'd be ideal to prune them when they're no longer needed.

And of course the GitHub-style "delete run" button would be nice.

Enrico204 commented 1 month ago

Unfortunately, I won't be able to contribute for the time being. It is not clear to me whether Gitea requires a CLA or not (by reading the "Contributing" page), and I don't want to be considered a "Gitea Author" also for the code I haven't written. I will probably continue to report typos and code that I am sure it won't create a "creative work" as defined by laws.