problem: Re-run all jobs button is visible, but clicking it leads to errors #12434

Open
opened 2026-05-06 15:29:56 +02:00 by aahlenst · 4 comments
aahlenst commented 2026-05-06 15:29:56 +02:00 (Migrated from codeberg.org)

Does your problem still exist on the latest Forgejo version?

Yes, the problem still exists (tested locally with the latest development version)

About your usage of Forgejo

Forgejo development

Problem description

After job one (see workflow below) has failed and while job two is still running, the button Re-run all jobs is visible because the failed job causes Forgejo to mark the workflow as failed. But clicking on Re-run all jobs leads to errors because one job is still running and the code that triggers the rerun tries to restart the running job, which isn't possible and leads to errors.

on:
  push:
  workflow_dispatch:

jobs:
  one:
    runs-on: debian
    steps:
      - run: |
          sleep 5
          exit 1
  two:
    runs-on: debian
    steps:
      - run: |
          sleep 5
          echo OK

Potential workarounds

No response

Forgejo Version

No response

Other details about your environment (software names and versions)

Fedora 44

Solutions

Accepted solutions to address this problem will go here

### Does your problem still exist on the latest Forgejo version? Yes, the problem still exists (tested locally with the latest development version) ### About your usage of Forgejo Forgejo development ### Problem description After job one (see workflow below) has failed and while job two is still running, the button _Re-run all jobs_ is visible because the failed job causes Forgejo to mark the workflow as failed. But clicking on _Re-run all jobs_ leads to errors because one job is still running and the code that triggers the rerun tries to restart the running job, which isn't possible and leads to errors. ```yaml on: push: workflow_dispatch: jobs: one: runs-on: debian steps: - run: | sleep 5 exit 1 two: runs-on: debian steps: - run: | sleep 5 echo OK ``` ### Potential workarounds _No response_ ### Forgejo Version _No response_ ### Other details about your environment (software names and versions) Fedora 44 ### Solutions *Accepted solutions to address this problem will go here*
aahlenst commented 2026-05-06 15:31:55 +02:00 (Migrated from codeberg.org)

I'm unsure what the correct behaviour should be. Should Re-run all jobs be hidden until all jobs have completed or should the running job be cancelled? I think cancelling the running job would make sense.

I'm unsure what the correct behaviour should be. Should _Re-run all jobs_ be hidden until all jobs have completed or should the running job be cancelled? I think cancelling the running job would make sense.
mfenniak commented 2026-05-06 20:58:46 +02:00 (Migrated from codeberg.org)

In the state where one job has failed, and other jobs are still running, the typical thing I'd like to do is "Re-run failed jobs" rather than "Re-run all jobs". 🤔 Leave the currently running jobs alone and just be the same as clicking the Rerun button on each individual failed job.

If the button remains "Re-run all jobs", having the button be hidden in this case would make more sense to me than cancelling the running job. I think that I'd click a "Re-run all jobs" button, which would throw out in-progress work, in pretty rare scenarios... like if the first job failed because of a permission problem, and I corrected the permission problem and wanted to restart the work. It's plausible, but pretty niche. More likely, I think, to be a mistake clicking that button if it cancels current work.

In the state where one job has failed, and other jobs are still running, the typical thing I'd like to do is "Re-run failed jobs" rather than "Re-run all jobs". 🤔 Leave the currently running jobs alone and just be the same as clicking the Rerun button on each individual failed job. If the button remains "Re-run all jobs", having the button be hidden in this case would make more sense to me than cancelling the running job. I think that I'd click a "Re-run all jobs" button, which would throw out in-progress work, in pretty rare scenarios... like if the first job failed because of a permission problem, and I corrected the permission problem and wanted to restart the work. It's plausible, but pretty niche. More likely, I think, to be a mistake clicking that button if it cancels current work.
aahlenst commented 2026-05-06 22:23:51 +02:00 (Migrated from codeberg.org)

@mfenniak wrote in https://codeberg.org/forgejo/forgejo/issues/12434#issuecomment-14394218:

In the state where one job has failed, and other jobs are still running, the typical thing I'd like to do is "Re-run failed jobs" rather than "Re-run all jobs".

Forgejo doesn't have a Re-run failed jobs button, does it? Do we want one?

Re-run all jobs is bound to the state of the run. It's visible as long the run is done, invisible otherwise. As soon as a job fails, the run is marked as failed, i.e., it's done. I'm not sure about that mechanic. I wouldn't be surprised if that would trigger notifications which is too early in my book. I think the correct behaviour would be to delay that decision until all jobs have completed. That by itself would make the issue disappear.

Otherwise, the button would have to be bound to an aggregated state that is built from the states of all jobs.

@mfenniak wrote in https://codeberg.org/forgejo/forgejo/issues/12434#issuecomment-14394218: > In the state where one job has failed, and other jobs are still running, the typical thing I'd like to do is "Re-run failed jobs" rather than "Re-run all jobs". Forgejo doesn't have a _Re-run failed jobs_ button, does it? Do we want one? _Re-run all jobs_ is bound to the state of the run. It's visible as long the run is done, invisible otherwise. As soon as a job fails, the run is marked as failed, i.e., it's done. I'm not sure about that mechanic. I wouldn't be surprised if that would trigger notifications which is too early in my book. I think the correct behaviour would be to delay that decision until all jobs have completed. That by itself would make the issue disappear. Otherwise, the button would have to be bound to an aggregated state that is built from the states of all jobs.
mfenniak commented 2026-05-06 22:33:14 +02:00 (Migrated from codeberg.org)

@aahlenst wrote in https://codeberg.org/forgejo/forgejo/issues/12434#issuecomment-14397635:

Forgejo doesn't have a Re-run failed jobs button, does it? Do we want one?

You're correct, it doesn't currently. I'd want one more than I want "Re-run all jobs"... 🤷 I like the idea. But I'm not sure if it's a situation where you'd have both, or dynamically choose one or the other.

I think the correct behaviour would be to delay that decision until all jobs have completed. That by itself would make the issue disappear.

Yes, for "Re-run all jobs", this logic makes sense to me.

@aahlenst wrote in https://codeberg.org/forgejo/forgejo/issues/12434#issuecomment-14397635: > Forgejo doesn't have a _Re-run failed jobs_ button, does it? Do we want one? You're correct, it doesn't currently. I'd want one more than I want "Re-run all jobs"... 🤷 I like the idea. But I'm not sure if it's a situation where you'd have both, or dynamically choose one or the other. > I think the correct behaviour would be to delay that decision until all jobs have completed. That by itself would make the issue disappear. Yes, for "Re-run all jobs", this logic makes sense to me.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sleepy/forgejo#12434
No description provided.