-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add endpoint deleting workflow run #34337
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
base: main
Are you sure you want to change the base?
Conversation
FYI: there are some "Details" in Clear the data/log for jobs in Gitea Actions that are too old #24256 , if these are all addressed, then we could move on. |
You mean there's somewhere missing out in this pr? |
Just FYI, I haven't fully read this PR or that issue, I just recalled there are some "details". |
I referred a lot from
Do we have to touch these explicitly? |
IIRC there is a |
Then I think #24256 details are all addressed. I just updated the function deleting |
Since you delete potentially the only task an ephemeral act_runner has ever run, please delete the affected runners first. one of
|
Do you mean there's a chance where ephemeral doesn't get deleted from database because of missing task record? |
Yes exactly, the pickTask detection is only triggered when trying to exploit gitea. Calling this method before deletion is for me in scope of secure deletion gitea/services/actions/cleanup.go Line 136 in 2fbc8f9
|
So to say, under current ephemeral runner implementation that relies on existing task record deliberately throwing error killing remote runner daemon, "ephemeral" will be broken (fetching another task). |
@ChristopherHX |
Anyway let us keep focus on deletion in this pr. |
Yes also CleanupEphemeralRunners will no longer delete the runner after the task is away.
The Gitea code is more complex. You can set the task status to completed by
UpdateTask is skipped. IMHO a single CleanupEphemeralRunners call before deleting anything else and I am fine. |
Sure we can, if you think this is not related to your pr. I am silent now about this topic, no problem :) |
@ChristopherHX One more thing. Surely can have a more solid way to delete ephemeral runners. Basically for a ephemeral need to track whether it has taken a task or not. A solution I can come up with is adding another boolean field for ephemeral runner, which is set to true once it takes a task. |
@ChristopherHX I just tried adding |
Just a random idea: AFAIK Web and rest api can reference service, but I didn't think about where your deletion code is, relative to my cleanup function. Anything else about ephemeral runners might be better discussed in a new issue / proposal. The old code works, because tasks that are finished within 24h are never deleted yet. |
Just pushed new commits. Please check. |
Add endpoint deleting workflow run
Resolves #26219
/claim #26219