gitea
gitea copied to clipboard
Delete workflow runs
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
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.
really would like to see this too :+1:
I am interested too, although the time I have to work on is very limited. @cassiozareck have you started working on some code?
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
Thank you for your work on this. ~I'll pick it up later once I have time.~ I don't have time to handle it right now.
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.
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.
I would love to see this feature too.
Is there currently some progress? I built our deploy pipeline and I had a lot of issues there.... Try and error... So I run the workflows e.t 60 times last week. But now I have 60 entries in my action section which have no benefit. It just worse the overview of the action page. I want to delete them but I found this issue here...
My database is getting really large after a couple of months of using Gitea. I would also like to delete some of my older workflow runs, preferably using the API.
💎 $50 bounty • Frank Villaro-Dixon
💎 $30 bounty • Sascha Simon
Steps to solve:
- Start working: Comment
/attempt #26219with your implementation plan - Submit work: Create a pull request including
/claim #26219in the PR body to claim the bounty - Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts
Thank you for contributing to go-gitea/gitea!
Add a bounty • Share on socials
| Attempt | Started (GMT+0) | Solution |
|---|---|---|
| 🟢 @Harihara04sudhan | Dec 22, 2024, 8:19:58 PM | WIP |
| 🟢 @zsbahtiar | Jan 7, 2025, 4:10:00 PM | #33138 |
| 🟢 @Mayank77maruti | Feb 14, 2025, 8:23:09 AM | WIP |
/attempt #26219
Implementation Plan:
-
Add a new function in actions/run.go to delete workflow runs and cascade deletion to associated jobs and logs using a database transaction.
-
Create a router endpoint (DELETE /actions/runs/{runID}) and API support for workflow run deletion.
-
Update the frontend to include a "Delete" button with a confirmation modal on the Actions page.
-
Add unit and integration tests to ensure proper functionality.
-
Optionally, implement a cron task for automatic cleanup of older runs based on retention settings.
I’ll begin with the backend functionality and progress to frontend and testing.
/attempt https://github.com/go-gitea/gitea/issues/26219
i'm add for solve this, please check the PR! https://github.com/go-gitea/gitea/pull/33138
i'm add for solve this, please check the PR! #33138
This is great, thank you! Though I was hoping we could also add a "select" button at the top which when clicked allows you to tick multiple runs and even a "select all" option if you just want to select all items? I'm not sure if that's quite complicated to achieve though.
i'm add for solve this, please check the PR! #33138
This is great, thank you! Though I was hoping we could also add a "select" button at the top which when clicked allows you to tick multiple runs and even a "select all" option if you just want to select all items? I'm not sure if that's quite complicated to achieve though.
hi @Retract1822 im add the multiple delete, can you the pr and give me the feedback again if u have, thanks a lot! :)
@zsbahtiar Awesome work! Hope to have this feature soon! My history is bloated with failed build attempts 😅
/attempt #26219
/attempt #26219
🎉 The pull request of @NorthRealm has been merged. The bounty can be rewarded here
cc @Frankkkkk, @
@NorthRealm: You've been awarded a $30 by Sascha Simon! 👉 Complete your Algora onboarding to collect the bounty.
@NorthRealm: You've been awarded a $50 by Frank! 👉 Complete your Algora onboarding to collect the bounty.