-
-
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 |
Backport #35840 #35783 fixes an actions rerun bug. Due to this bug, some runs may be 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 ```
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [go-gitea/gitea](https://github.com/go-gitea/gitea) | patch | `1.25.0` -> `1.25.1` | --- ### Release Notes <details> <summary>go-gitea/gitea (go-gitea/gitea)</summary> ### [`v1.25.1`](https://github.com/go-gitea/gitea/releases/tag/v1.25.1) [Compare Source](go-gitea/gitea@v1.25.0...v1.25.1) - BUGFIXES - Make ACME email optional ([#​35849](go-gitea/gitea#35849)) [#​35857](go-gitea/gitea#35857) - Add a doctor command to fix inconsistent run status ([#​35840](go-gitea/gitea#35840)) ([#​35845](go-gitea/gitea#35845)) - Remove wrong code ([#​35846](go-gitea/gitea#35846)) - Fix viewed files number is not right if not all files loaded ([#​35821](go-gitea/gitea#35821)) ([#​35844](go-gitea/gitea#35844)) - Fix incorrect pull request counter ([#​35819](go-gitea/gitea#35819)) ([#​35841](go-gitea/gitea#35841)) - Upgrade go mail to 0.7.2 and fix the bug ([#​35833](go-gitea/gitea#35833)) ([#​35837](go-gitea/gitea#35837)) - Revert gomail to v0.7.0 to fix sending mail failed ([#​35816](go-gitea/gitea#35816)) ([#​35824](go-gitea/gitea#35824)) - Fix clone mixed bug ([#​35810](go-gitea/gitea#35810)) ([#​35822](go-gitea/gitea#35822)) - Fix cli "Before" handling ([#​35797](go-gitea/gitea#35797)) ([#​35808](go-gitea/gitea#35808)) - Improve and fix markup code preview rendering ([#​35777](go-gitea/gitea#35777)) ([#​35787](go-gitea/gitea#35787)) - Fix actions rerun bug ([#​35783](go-gitea/gitea#35783)) ([#​35784](go-gitea/gitea#35784)) - Fix actions schedule update issue ([#​35767](go-gitea/gitea#35767)) ([#​35774](go-gitea/gitea#35774)) - Fix circular spin animation direction ([#​35785](go-gitea/gitea#35785)) ([#​35823](go-gitea/gitea#35823)) - Fix file extension on gogs.png ([#​35793](go-gitea/gitea#35793)) ([#​35799](go-gitea/gitea#35799)) - Add pnpm to Snapcraft ([#​35778](go-gitea/gitea#35778)) Instances on **[Gitea Cloud](https://cloud.gitea.com)** will be automatically upgraded to this version during the specified maintenance window. </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xOC4xIiwidXBkYXRlZEluVmVyIjoiNDEuMTguMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsia2luZC9kZXBlbmRlbmN5Il19--> Reviewed-on: https://gitea.com/gitea/helm-gitea/pulls/981 Reviewed-by: Markus Pesch <volker.raschek@noreply.gitea.com> Co-authored-by: Renovate Bot <renovate-bot@gitea.com> Co-committed-by: Renovate Bot <renovate-bot@gitea.com>
* giteaofficial/main: Remove padding override on `.ui .sha.label` (go-gitea#35864) fix(api/repo/contents): set the dates to now when not specified by the caller (go-gitea#35861) Remove `fix` Make targets (go-gitea#35868) Refactor ls-tree and git path related problems (go-gitea#35858) Fix pull description code label background (go-gitea#35865) Make ACME email optional (go-gitea#35849) Remove wrong code (go-gitea#35846) Fix Arch repo pacman.conf snippet (go-gitea#35825) Port away from `flake-utils` (go-gitea#35675) Update golangci-lint to v2.6.0 (go-gitea#35801) Add a doctor command to fix inconsistent run status (go-gitea#35840) Fix viewed files number is not right if not all files loaded (go-gitea#35821) Fix incorrect pull request counter (go-gitea#35819) Fix a number of `strictNullChecks`-related issues (go-gitea#35795) ignore .worktrees as a "special folder" (go-gitea#35835) upgrade go mail to 0.7.2 and fix the bug (go-gitea#35833)
#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.