Skip to content
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

Not trigger all jobs any more, when re-running the first job #29439

Merged
merged 4 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: when re-running first job, not trigger all jobs any more
  • Loading branch information
sillyguodong committed Feb 27, 2024
commit c70d1b6d92c870002d2135cd732ec0cc79eaf50a
4 changes: 2 additions & 2 deletions routers/web/repo/actions/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func ViewPost(ctx *context_module.Context) {
}

// Rerun will rerun jobs in the given run
// jobIndex = 0 means rerun all jobs
// jobIndex = -1 means rerun all jobs
func Rerun(ctx *context_module.Context) {
runIndex := ctx.ParamsInt64("run")
jobIndex := ctx.ParamsInt64("job")
Expand Down Expand Up @@ -297,7 +297,7 @@ func Rerun(ctx *context_module.Context) {
return
}

if jobIndex != 0 {
if jobIndex != -1 {
jobs = []*actions_model.ActionRunJob{job}
}

Expand Down
1 change: 0 additions & 1 deletion routers/web/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,6 @@ func registerRoutes(m *web.Route) {
m.Post("/artifacts", actions.ArtifactsView)
m.Get("/artifacts/{artifact_name}", actions.ArtifactsDownloadView)
m.Delete("/artifacts/{artifact_name}", actions.ArtifactsDeleteView)
m.Post("/rerun", reqRepoActionsWriter, actions.Rerun)
})
}, reqRepoActionsReader, actions.MustEnableActions)

Expand Down
2 changes: 1 addition & 1 deletion web_src/js/components/RepoActionView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ export function initRepositoryActionView() {
<button class="ui basic small compact button red" @click="cancelRun()" v-else-if="run.canCancel">
{{ locale.cancel }}
</button>
<button class="ui basic small compact button gt-mr-0 link-action" :data-url="`${run.link}/rerun`" v-else-if="run.canRerun">
<button class="ui basic small compact button gt-mr-0 link-action" :data-url="`${run.link}/jobs/-1/rerun`" v-else-if="run.canRerun">
{{ locale.rerun_all }}
</button>
</div>
Expand Down
Loading