Feature: Add button to re-run failed jobs in Actions#36924
Feature: Add button to re-run failed jobs in Actions#36924bircni wants to merge 2 commits intogo-gitea:mainfrom
Conversation
Adds a "Re-run failed jobs" button to the Actions run view that reruns only failed jobs and their downstream dependents, matching GitHub's behaviour described in issue go-gitea#35997. - Add `RerunFailedWorkflowRunJobs` service function - Add `GetFailedRerunJobs` helper with full test coverage - Add web route `POST /{run}/rerun-failed` and handler `RerunFailed` - Add API route `POST /runs/{run}/rerun-failed-jobs` - Show button only when the run is done and has at least one failed job - Extract `checkRunRerunAllowed` guard shared by both web handlers - Merge `validateRunForRerun` into `prepareRunRerun` (one function) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Added a drop down button --> see description |
|
@wxiaoguang is anything missing? |
|
I can review for the code-level. For feature&function level, it's better to ask Actions users to review (I don't use Actions) |
Would be great!! |
|
Just saw @lunny are you interested? |
| ctx.APIErrorInternal(err) | ||
| return | ||
| } | ||
| ctx.JSON(http.StatusCreated, convertedRun) |
| resp.State.Run.CanDeleteArtifact = run.Status.IsDone() && ctx.Repo.CanWrite(unit.TypeActions) | ||
| if resp.State.Run.CanRerun { | ||
| for _, job := range jobs { | ||
| if job.Status == actions_model.StatusFailure { | ||
| resp.State.Run.CanRerunFailed = true | ||
| break | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
IsDone(): s.In(StatusSuccess, StatusFailure, StatusCancelled, StatusSkipped)
What if job.Status is something like cancelled but not failure?
| var jobsToRerun []*actions_model.ActionRunJob | ||
|
|
||
| for _, job := range allJobs { | ||
| if job.Status == actions_model.StatusFailure { |
There was a problem hiding this comment.
Is it right? What's the status of "job b" if it depends on "job a" and "job a" fails?
| <button class="ui basic small compact button link-action" :data-url="`${run.link}/rerun-failed`"> | ||
| {{ locale.rerun_failed }} | ||
| </button> | ||
| <div class="ui basic small compact dropdown icon button rerun-dropdown" @click.stop="showRerunMenu = !showRerunMenu"> |
I will review it later. It's better if @Zettat123 could also review it. |


Fixes #35997
Summary
Adds a "Re-run failed jobs" button to the Actions run view, matching the behaviour available on GitHub. When clicked, only failed jobs and their downstream dependents are rerun — passing jobs are left untouched.
Screenshots
Open Questions
I tried to do my best to implement this and used Claude Code as assistance