Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete workflow runs #26219

Open
sebthom opened this issue Jul 29, 2023 · 18 comments
Open

Delete workflow runs #26219

sebthom opened this issue Jul 29, 2023 · 18 comments
Labels
💎 Bounty topic/gitea-actions related to the actions of Gitea type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@sebthom
Copy link

sebthom commented Jul 29, 2023

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.

Details

@sebthom sebthom added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Jul 29, 2023
@wolfogre wolfogre added the topic/gitea-actions related to the actions of Gitea label Jul 31, 2023
@cassiozareck
Copy link
Contributor

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

This comment was marked as duplicate.

@Enrico204
Copy link
Contributor

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

@cassiozareck
Copy link
Contributor

cassiozareck commented Jul 20, 2024

Hi Enrico! I'm no longer working on this feature and gitea in general. Ive wrote some code you can check out here #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
Copy link
Member

wolfogre commented Jul 22, 2024

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.

@tycho
Copy link

tycho commented Aug 6, 2024

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
Copy link
Contributor

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.

@inxcts
Copy link

inxcts commented Oct 13, 2024

I would love to see this feature too.

@Tockra
Copy link

Tockra commented Nov 26, 2024

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

@inxcts
Copy link

inxcts commented Dec 11, 2024

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.

cclvi256 added a commit to cclvi256/gitea that referenced this issue Dec 19, 2024
As the Issue (go-gitea#26219) mentioned, this is a database-level support to
query the obsolete actions runs.

I'll temporarily add a draft for further work.
Copy link

algora-pbc bot commented Dec 21, 2024

💎 $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 bountyShare 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

@Harihara04sudhan
Copy link

Harihara04sudhan commented Dec 22, 2024

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

@zsbahtiar
Copy link

/attempt #26219

@zsbahtiar
Copy link

i'm add for solve this, please check the PR!
#33138

@Retract1822
Copy link

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.

@zsbahtiar
Copy link

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! :)

@Zammla
Copy link

Zammla commented Jan 29, 2025

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

@Mayank77maruti
Copy link

/attempt #26219

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💎 Bounty topic/gitea-actions related to the actions of Gitea type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests