-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Add a doctor command to fix inconsistent run status #35840
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
Add a doctor command to fix inconsistent run status #35840
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would want to let cancellation succeed if a user requested it in this case, proposal here: #35842 . Backport is bigger step, so this doctor command is good.
With my test data of #35842, this PR works
func TestActionsCancelStuckJobDoctor(t *testing.T) {
defer tests.PrepareTestEnv(t)()
for _, check := range doctor.Checks {
if check.Name != "fix-actions-unfinished-run-status" {
continue
}
check.Run(t.Context(), log.GetLogger(log.DEFAULT), true)
// check if the run is cancelled by id
run := unittest.AssertExistsAndLoadBean(t, &actions_model.ActionRun{
ID: 805,
})
assert.Equal(t, actions_model.StatusCancelled, run.Status)
}
}I think having tests for this doctor command is generally better.
Thank you for the test data. I added test in 9f100d1 |
|
Usually end users have no idea about the "doctor" commands. Is it possible to make the "runs" self-healing? For example: cancel it via UI? I believe adding more doctor commands is not a proper approach. |
incorrectly marked as `StatusWaiting` even though all the jobs are in done status. These runs cannot be run or cancelled. This PR adds a new doctor command to fix the inconsistent run status. ``` gitea doctor check --run fix-actions-unfinished-run-status --fix ``` Thanks to @ChristopherHX for the test.
Yes. This PR is used to help users quickly fix the incorrect run status. #35842 will allow users to cancel the run even if all jobs are done |
#35783 fixes an actions rerun bug. Due to this bug, some runs may be incorrectly marked as
StatusWaitingeven though all the jobs are in done status. These runs cannot be run or cancelled. This PR adds a new doctor command to fix the inconsistent run status.Thanks to @ChristopherHX for the test.