rerunning all jobs no longer respects what needs what #11946

Closed
opened 2025-11-02 09:52:36 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @gilesb2 on GitHub (Nov 2, 2023).

Description

when I re run all jobs in a workflow (from the ui) after one has failed the structure of what needs what is not respected - ie they all run at once.

The original run respects structure.

my workflow is as below fwiw

name: target
on:
  pull_request:

jobs:
  comment:
    runs-on: ubuntu-latest
    steps:
      - uses: RouxAntoine/checkout@v3.5.4
        with:
          fetch-depth: '1'
      - uses: actions/setup-node@v3
        with:
          node-version: '20'
      - uses: sigyl-actions/gitea-issue-comment@main
        with:
          token: ${{ secrets.BOT_TOKEN }}
          id: ${{ github.event.number }}
          description: 'formatting'
          body: |
            formatting xml code
  format:
    runs-on: ubuntu-latest
    needs: comment
    steps:
      - uses: RouxAntoine/checkout@v3.5.4
        with:
          token: ${{ secrets.BOT_TOKEN }}
          # fetch-depth: '1'
      - uses: actions/setup-node@v3
        with:
          node-version: '20'
      - run: git checkout -b ${{ github.head_ref }}
      - uses: sigyl-actions/xml-format@debug
        with:
          folder: '.'
          regex: ^.+\.(([aA][xX][mM][lL]))$
      - run: git status
      - uses: sigyl-actions/xml-format@debug
        with:
          folder: './recipes'
          regex: ^.+\.(([oO][xX][mM][lL])|([uU][xX][mM][lL])|([pP][xX][mM][lL]))$
      - run: git status
      - uses: sigyl-actions/check-for-changes@v1.0.0
        id: has-changes
      - run: git status
      - uses: ./.github/actions/git-prep
        if: steps.has-changes.outputs.changes == 'true'
      - run: git status
      - name: commit if changed
        if: steps.has-changes.outputs.changes == 'true'
        run: |
          git add -A
          git commit -a -m "formatted"
          git push origin HEAD
  schema:
    runs-on: ubuntu-latest
    needs: comment
    outputs:
      result: ${{ steps.schema.outputs.result }}
      error: ${{ steps.schema.outputs.error }}
      schema: ./.github/schemas/AreaModel.xsd
      
    steps:
      - uses: RouxAntoine/checkout@v3.5.4
        with:
          token: ${{ secrets.BOT_TOKEN }}
          fetch-depth: '1'
      - uses: actions/setup-node@v3
        with:
          node-version: '20'
      - id: pwd
        run: |
          echo -n pwd= >> $GITHUB_OUTPUT
          pwd >> $GITHUB_OUTPUT
      - uses: sigyl-actions/xml-schema@main
        id: schema
        # continue-on-error: true
        with:
          schema_path: ${{ steps.pwd.outputs.pwd}}
          folder: '.'
          regex: ^.+\.(([aA][xX][mM][lL]))$
          xsd: ./.github/schemas/AreaModel.xsd
      # master recipes isn't a valid schema!
      #- uses: sigyl-actions/xml-schema@main
      #  with:
      #    schema_path: ${{ steps.pwd.outputs.pwd}}
      #    folder: './recipes'
      #    regex: ^.+\.(([oO][xX][mM][lL])|([uU][xX][mM][lL])|([pP][xX][mM][lL]))$
      #    xsd: ./.github/schemas/MasterRecipe.xsd
  schema1:
    runs-on: ubuntu-latest
    needs: comment
    steps:
      - id: fail-step
        continue-on-error: true
        run: |
          echo "oh=hahaah" >> $GITHUB_OUTPUT
          exit 1
      - run: echo ${{ steps.fail-step.outcome }}
      - name: json
        run: echo $JSON
        env:
          JSON: ${{ toJSON(steps) }}
      

  review:
    runs-on: ubuntu-latest
    needs:
      - format
      - schema
    steps:
      - name: json
        run: echo $JSON
        env:
          JSON: ${{ toJSON(needs) }}
      - uses: RouxAntoine/checkout@v3.5.4
        with:
          fetch-depth: '1'
      - uses: actions/setup-node@v3
        with:
          node-version: '20'
      - run: echo ${{ needs.schema.outputs.error }}
      - uses: sigyl-actions/gitea-pr-review@main
        if: ${{ needs.schema.outputs.error != 'true' }}
        with:
          token: ${{ secrets.BOT_TOKEN }}
          id: ${{ github.event.number }}
          description: 'Schema checks pass'
          body: |
            pull changes
          event: APPROVED
      - uses: sigyl-actions/gitea-pr-review-xml-schema@main
        if: ${{ needs.schema.outputs.error == 'true' }}
        with:
          token: ${{ secrets.BOT_TOKEN }}
          id: ${{ github.event.number }}
          errors: ${{ needs.schema.outputs.result }}
          body: |
            # schema checks failed
          event: REQUEST_CHANGES

  request-review:
    needs:
      - review
      - format
      - schema
    runs-on: ubuntu-latest
    if: needs.schema.outputs.error != 'true'
    steps:
      - uses: RouxAntoine/checkout@v3.5.4
        with:
          fetch-depth: '1'
      - uses: actions/setup-node@v3
        with:
          node-version: '20'
      - uses: sigyl-actions/gitea-request-review@main
        with:
          token: ${{ secrets.BOT_TOKEN }}
          pr: ${{ github.event.number }}
          teams: reviewers,reviewers-2

Gitea Version

1.21.0-rc2

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

ubuntu

How are you running Gitea?

container from docker hub on linux

Database

SQLite

Originally created by @gilesb2 on GitHub (Nov 2, 2023). ### Description when I re run all jobs in a workflow (from the ui) after one has failed the structure of what needs what is not respected - ie they all run at once. The original run respects structure. my workflow is as below fwiw ```yml name: target on: pull_request: jobs: comment: runs-on: ubuntu-latest steps: - uses: RouxAntoine/checkout@v3.5.4 with: fetch-depth: '1' - uses: actions/setup-node@v3 with: node-version: '20' - uses: sigyl-actions/gitea-issue-comment@main with: token: ${{ secrets.BOT_TOKEN }} id: ${{ github.event.number }} description: 'formatting' body: | formatting xml code format: runs-on: ubuntu-latest needs: comment steps: - uses: RouxAntoine/checkout@v3.5.4 with: token: ${{ secrets.BOT_TOKEN }} # fetch-depth: '1' - uses: actions/setup-node@v3 with: node-version: '20' - run: git checkout -b ${{ github.head_ref }} - uses: sigyl-actions/xml-format@debug with: folder: '.' regex: ^.+\.(([aA][xX][mM][lL]))$ - run: git status - uses: sigyl-actions/xml-format@debug with: folder: './recipes' regex: ^.+\.(([oO][xX][mM][lL])|([uU][xX][mM][lL])|([pP][xX][mM][lL]))$ - run: git status - uses: sigyl-actions/check-for-changes@v1.0.0 id: has-changes - run: git status - uses: ./.github/actions/git-prep if: steps.has-changes.outputs.changes == 'true' - run: git status - name: commit if changed if: steps.has-changes.outputs.changes == 'true' run: | git add -A git commit -a -m "formatted" git push origin HEAD schema: runs-on: ubuntu-latest needs: comment outputs: result: ${{ steps.schema.outputs.result }} error: ${{ steps.schema.outputs.error }} schema: ./.github/schemas/AreaModel.xsd steps: - uses: RouxAntoine/checkout@v3.5.4 with: token: ${{ secrets.BOT_TOKEN }} fetch-depth: '1' - uses: actions/setup-node@v3 with: node-version: '20' - id: pwd run: | echo -n pwd= >> $GITHUB_OUTPUT pwd >> $GITHUB_OUTPUT - uses: sigyl-actions/xml-schema@main id: schema # continue-on-error: true with: schema_path: ${{ steps.pwd.outputs.pwd}} folder: '.' regex: ^.+\.(([aA][xX][mM][lL]))$ xsd: ./.github/schemas/AreaModel.xsd # master recipes isn't a valid schema! #- uses: sigyl-actions/xml-schema@main # with: # schema_path: ${{ steps.pwd.outputs.pwd}} # folder: './recipes' # regex: ^.+\.(([oO][xX][mM][lL])|([uU][xX][mM][lL])|([pP][xX][mM][lL]))$ # xsd: ./.github/schemas/MasterRecipe.xsd schema1: runs-on: ubuntu-latest needs: comment steps: - id: fail-step continue-on-error: true run: | echo "oh=hahaah" >> $GITHUB_OUTPUT exit 1 - run: echo ${{ steps.fail-step.outcome }} - name: json run: echo $JSON env: JSON: ${{ toJSON(steps) }} review: runs-on: ubuntu-latest needs: - format - schema steps: - name: json run: echo $JSON env: JSON: ${{ toJSON(needs) }} - uses: RouxAntoine/checkout@v3.5.4 with: fetch-depth: '1' - uses: actions/setup-node@v3 with: node-version: '20' - run: echo ${{ needs.schema.outputs.error }} - uses: sigyl-actions/gitea-pr-review@main if: ${{ needs.schema.outputs.error != 'true' }} with: token: ${{ secrets.BOT_TOKEN }} id: ${{ github.event.number }} description: 'Schema checks pass' body: | pull changes event: APPROVED - uses: sigyl-actions/gitea-pr-review-xml-schema@main if: ${{ needs.schema.outputs.error == 'true' }} with: token: ${{ secrets.BOT_TOKEN }} id: ${{ github.event.number }} errors: ${{ needs.schema.outputs.result }} body: | # schema checks failed event: REQUEST_CHANGES request-review: needs: - review - format - schema runs-on: ubuntu-latest if: needs.schema.outputs.error != 'true' steps: - uses: RouxAntoine/checkout@v3.5.4 with: fetch-depth: '1' - uses: actions/setup-node@v3 with: node-version: '20' - uses: sigyl-actions/gitea-request-review@main with: token: ${{ secrets.BOT_TOKEN }} pr: ${{ github.event.number }} teams: reviewers,reviewers-2 ``` ### Gitea Version 1.21.0-rc2 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System ubuntu ### How are you running Gitea? container from docker hub on linux ### Database SQLite
GiteaMirror added the topic/gitea-actionstype/bug labels 2025-11-02 09:52:36 -06:00
Author
Owner

@gilesbradshaw commented on GitHub (Nov 2, 2023):

here is the first run

image

here is the second with re run all jobs

image

@gilesbradshaw commented on GitHub (Nov 2, 2023): here is the first run ![image](https://github.com/go-gitea/gitea/assets/597115/93f2d6a9-b54e-445f-965c-7e44204f084b) here is the second with re run all jobs ![image](https://github.com/go-gitea/gitea/assets/597115/000db3d6-b660-4e68-9a9b-6dae7fa1d68d)
Author
Owner

@gilesbradshaw commented on GitHub (Nov 2, 2023):

sorry for schizoid post - two accounts!

@gilesbradshaw commented on GitHub (Nov 2, 2023): sorry for schizoid post - two accounts!
Author
Owner

@nicorac commented on GitHub (Nov 27, 2023):

Same issue here.

I've prepared a lighter workflow to reproduce the bug:

# Since the default value of act_runner "fetch_interval" parameter is
# "10s", we need to sleep each step for > 10secs...
name: Test
run-name: ${{ gitea.actor }} started this build

on:
  push:

jobs:

  job1:
    name: job1
    steps:
      - name: job1 step
        run: |
          sleep 15
          echo "job1 done!"

  job2:
    name: job2
    steps:
      - name: job2 step
        run: |
          sleep 15
          echo "job2 done!"

  job3:
    name: job3 (waits for both job1 and job2)
    needs: [ job1, job2 ]
    steps:
      - name: job3 step
        run: |
          sleep 15
          echo "job 3 done!"
@nicorac commented on GitHub (Nov 27, 2023): Same issue here. I've prepared a lighter workflow to reproduce the bug: ```yaml # Since the default value of act_runner "fetch_interval" parameter is # "10s", we need to sleep each step for > 10secs... name: Test run-name: ${{ gitea.actor }} started this build on: push: jobs: job1: name: job1 steps: - name: job1 step run: | sleep 15 echo "job1 done!" job2: name: job2 steps: - name: job2 step run: | sleep 15 echo "job2 done!" job3: name: job3 (waits for both job1 and job2) needs: [ job1, job2 ] steps: - name: job3 step run: | sleep 15 echo "job 3 done!" ```
Author
Owner

@xXluki98Xx commented on GitHub (Jan 23, 2024):

Bug is still present in Gitea 1.21.4

@xXluki98Xx commented on GitHub (Jan 23, 2024): Bug is still present in Gitea 1.21.4
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11946