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

Jobs in actions are restarted in an incomprehensible order #28093

Closed
vjarskee opened this issue Nov 16, 2023 · 2 comments · Fixed by #29955
Closed

Jobs in actions are restarted in an incomprehensible order #28093

vjarskee opened this issue Nov 16, 2023 · 2 comments · Fixed by #29955
Labels
topic/gitea-actions related to the actions of Gitea type/bug

Comments

@vjarskee
Copy link

vjarskee commented Nov 16, 2023

Description

I have a few workflows of roughly this type:

jobs:
  First test:
    runs-on: node-16.16.0
  Second test:
    runs-on: node-16.16.0
  Build:
    needs: [First test, Second test]
    runs-on: ubuntu-22.04
  Run:
    needs: Build
    runs-on: ubuntu-22.04

When automatically started, workflow runs as it should, but if you manually restart one job or all of them with a button in the interface, they may start in an unclear order, for example, Build or Run may start together with First test and Second test, although they need First test and Second test.

Gitea Version

1.21.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Ubuntu 20.04.4 LTS

How are you running Gitea?

Official docker image gitea/gitea:1.21.0

Database

PostgreSQL

@techknowlogick techknowlogick added the topic/gitea-actions related to the actions of Gitea label Nov 16, 2023
@lng2020
Copy link
Member

lng2020 commented Nov 17, 2023

same as #27884

@yp05327
Copy link
Contributor

yp05327 commented Mar 21, 2024

Close this one as duplicated #27884.
If it is not expected, feel free to reopen it.

@yp05327 yp05327 closed this as completed Mar 21, 2024
lunny pushed a commit that referenced this issue Mar 22, 2024
Fix #28761
Fix #27884
Fix #28093

## Changes

### Rerun all jobs
When rerun all jobs, status of the jobs with `needs` will be set to
`blocked` instead of `waiting`. Therefore, these jobs will not run until
the required jobs are completed.

### Rerun a single job
When a single job is rerun, its dependents should also be rerun, just
like GitHub does
(#28761 (comment)).
In this case, only the specified job will be set to `waiting`, its
dependents will be set to `blocked` to wait the job.

### Show warning if every job has `needs`
If every job in a workflow has `needs`, all jobs will be blocked and no
job can be run. So I add a warning message.

<img
src="https://github.com/go-gitea/gitea/assets/15528715/88f43511-2360-465d-be96-ee92b57ff67b"
width="480px" />
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Mar 22, 2024
Fix go-gitea#28761
Fix go-gitea#27884
Fix go-gitea#28093

## Changes

### Rerun all jobs
When rerun all jobs, status of the jobs with `needs` will be set to
`blocked` instead of `waiting`. Therefore, these jobs will not run until
the required jobs are completed.

### Rerun a single job
When a single job is rerun, its dependents should also be rerun, just
like GitHub does
(go-gitea#28761 (comment)).
In this case, only the specified job will be set to `waiting`, its
dependents will be set to `blocked` to wait the job.

### Show warning if every job has `needs`
If every job in a workflow has `needs`, all jobs will be blocked and no
job can be run. So I add a warning message.

<img
src="https://github.com/go-gitea/gitea/assets/15528715/88f43511-2360-465d-be96-ee92b57ff67b"
width="480px" />
lunny added a commit that referenced this issue Mar 22, 2024
Backport #29955 by @Zettat123

Fix #28761
Fix #27884
Fix #28093

## Changes

### Rerun all jobs
When rerun all jobs, status of the jobs with `needs` will be set to
`blocked` instead of `waiting`. Therefore, these jobs will not run until
the required jobs are completed.

### Rerun a single job
When a single job is rerun, its dependents should also be rerun, just
like GitHub does
(#28761 (comment)).
In this case, only the specified job will be set to `waiting`, its
dependents will be set to `blocked` to wait the job.

### Show warning if every job has `needs`
If every job in a workflow has `needs`, all jobs will be blocked and no
job can be run. So I add a warning message.

<img
src="https://github.com/go-gitea/gitea/assets/15528715/88f43511-2360-465d-be96-ee92b57ff67b"
width="480px" />

---------

Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
silverwind pushed a commit to silverwind/gitea that referenced this issue Mar 22, 2024
Fix go-gitea#28761
Fix go-gitea#27884
Fix go-gitea#28093

## Changes

### Rerun all jobs
When rerun all jobs, status of the jobs with `needs` will be set to
`blocked` instead of `waiting`. Therefore, these jobs will not run until
the required jobs are completed.

### Rerun a single job
When a single job is rerun, its dependents should also be rerun, just
like GitHub does
(go-gitea#28761 (comment)).
In this case, only the specified job will be set to `waiting`, its
dependents will be set to `blocked` to wait the job.

### Show warning if every job has `needs`
If every job in a workflow has `needs`, all jobs will be blocked and no
job can be run. So I add a warning message.

<img
src="https://github.com/go-gitea/gitea/assets/15528715/88f43511-2360-465d-be96-ee92b57ff67b"
width="480px" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/gitea-actions related to the actions of Gitea type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants