Feature: Add button to re-run failed jobs in Actions#36924
Feature: Add button to re-run failed jobs in Actions#36924wxiaoguang merged 10 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? |
I will review it later. It's better if @Zettat123 could also review it. |
|
Is it possible to merge "RerunWorkflowRunJobs" functions? It seems that it only needs one general function:
|
should be - give me some minutes to check |
There was a problem hiding this comment.
Pull request overview
Adds “Re-run failed jobs” support for Actions workflow runs, including UI, web route, and API endpoint, so users can rerun only failed jobs plus downstream dependents (leaving successful jobs untouched).
Changes:
- Add failed-job rerun selection logic (
GetFailedRerunJobs) and refactor rerun service to accept an explicit job list. - Add web UI/handler for POST rerun-failed and expose
canRerunFailedin the run view model. - Add API endpoint + swagger documentation for rerunning failed jobs, and add new locale string.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| web_src/js/features/repo-actions.ts | Passes new rerun_failed locale string into the Actions run Vue app. |
| web_src/js/components/RepoActionView.vue | Adds split/dropdown UI for “Re-run failed jobs” vs “Re-run all jobs”. |
| templates/repo/actions/view_component.tmpl | Provides data-locale-rerun-failed for the frontend. |
| options/locale/locale_en-US.json | Adds English string for “Re-run failed jobs”. |
| services/actions/rerun.go | Implements GetFailedRerunJobs, refactors rerun logic into prepareRunRerun, updates job blocking rules. |
| services/actions/rerun_test.go | Adds unit tests for failed rerun job selection and validation behavior. |
| routers/web/repo/actions/view.go | Exposes CanRerunFailed, adds /rerun-failed handler, refactors rerun-allowed checks. |
| routers/web/web.go | Registers POST route /rerun-failed for run pages. |
| routers/web/devtest/mock_actions.go | Mocks CanRerunFailed in dev test data. |
| routers/api/v1/api.go | Registers API route /rerun-failed-jobs. |
| routers/api/v1/repo/action.go | Adds API handler RerunFailedWorkflowRun and updates rerun call sites to new service signature. |
| templates/swagger/v1_json.tmpl | Adds swagger path entry for /rerun-failed-jobs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@wxiaoguang @Zettat123 can we convert it to "ready for review" again? |
* giteaofficial/main: Add user badges (go-gitea#36752) Apply as maintainer (go-gitea#36947) Refactor storage content-type handling of ServeDirectURL (go-gitea#36804) Add summary to action runs view (go-gitea#36883) feat: Add configurable permissions for Actions automatic tokens (go-gitea#36173) Feature: Add button to re-run failed jobs in Actions (go-gitea#36924) Support dark/light theme images in markdown (go-gitea#36922) fix go-gitea#36463: preserve sort order of exclusive labels from template repo (go-gitea#36931) fix(upgrade.sh): use HTTPS for GPG key import and restore SELinux context after upgrade (go-gitea#36930) [skip ci] Updated translations via Crowdin Make container registry support Apple Container (basic auth) (go-gitea#36920) Fix various trivial problems (go-gitea#36921)
* origin/main: Update to eslint 10 (go-gitea#36925) Add user badges (go-gitea#36752) Apply as maintainer (go-gitea#36947) Refactor storage content-type handling of ServeDirectURL (go-gitea#36804) Add summary to action runs view (go-gitea#36883) feat: Add configurable permissions for Actions automatic tokens (go-gitea#36173) Feature: Add button to re-run failed jobs in Actions (go-gitea#36924) Support dark/light theme images in markdown (go-gitea#36922) fix go-gitea#36463: preserve sort order of exclusive labels from template repo (go-gitea#36931) fix(upgrade.sh): use HTTPS for GPG key import and restore SELinux context after upgrade (go-gitea#36930) [skip ci] Updated translations via Crowdin Make container registry support Apple Container (basic auth) (go-gitea#36920) Fix various trivial problems (go-gitea#36921) [skip ci] Updated translations via Crowdin # Conflicts: # package.json # pnpm-lock.yaml
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