gitea icon indicating copy to clipboard operation
gitea copied to clipboard

Delete workflow runs

Open sebthom opened this issue 2 years ago • 10 comments

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

sebthom avatar Jul 29 '23 08:07 sebthom

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.

cassiozareck avatar Jul 31 '23 23:07 cassiozareck

really would like to see this too :+1:

steadfasterX avatar Oct 27 '23 09:10 steadfasterX

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

Enrico204 avatar Jul 20 '24 08:07 Enrico204

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

cassiozareck avatar Jul 20 '24 15:07 cassiozareck

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.

wolfogre avatar Jul 22 '24 06:07 wolfogre

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.

tycho avatar Aug 06 '24 11:08 tycho

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.

Enrico204 avatar Aug 06 '24 12:08 Enrico204

I would love to see this feature too.

ghost avatar Oct 13 '24 03:10 ghost

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...

Tockra avatar Nov 26 '24 11:11 Tockra

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.

ghost avatar Dec 11 '24 18:12 ghost

💎 $50 bounty • Frank Villaro-Dixon

💎 $30 bounty • Sascha Simon

Steps to solve:

  1. Start working: Comment /attempt #26219 with your implementation plan
  2. Submit work: Create a pull request including /claim #26219 in the PR body to claim the bounty
  3. 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

algora-pbc[bot] avatar Dec 21 '24 13:12 algora-pbc[bot]

/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.

Harihara04sudhan avatar Dec 22 '24 20:12 Harihara04sudhan

/attempt https://github.com/go-gitea/gitea/issues/26219

zsbahtiar avatar Jan 07 '25 16:01 zsbahtiar

i'm add for solve this, please check the PR! https://github.com/go-gitea/gitea/pull/33138

zsbahtiar avatar Jan 07 '25 18:01 zsbahtiar

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.

Retract1822 avatar Jan 07 '25 18:01 Retract1822

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 avatar Jan 08 '25 09:01 zsbahtiar

@zsbahtiar Awesome work! Hope to have this feature soon! My history is bloated with failed build attempts 😅

Zammla avatar Jan 29 '25 17:01 Zammla

/attempt #26219

Mayank77maruti avatar Feb 14 '25 08:02 Mayank77maruti

/attempt #26219

NorthRealm avatar May 04 '25 06:05 NorthRealm

🎉 The pull request of @NorthRealm has been merged. The bounty can be rewarded here

cc @Frankkkkk, @

algora-pbc[bot] avatar May 13 '25 19:05 algora-pbc[bot]

@NorthRealm: You've been awarded a $30 by Sascha Simon! 👉 Complete your Algora onboarding to collect the bounty.

algora-pbc[bot] avatar May 14 '25 02:05 algora-pbc[bot]

@NorthRealm: You've been awarded a $50 by Frank! 👉 Complete your Algora onboarding to collect the bounty.

algora-pbc[bot] avatar May 14 '25 12:05 algora-pbc[bot]