Skip to content

rerunning all jobs no longer respects what needs what #27884

Closed
@gilesb2

Description

@gilesb2

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/[email protected]
        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/[email protected]
        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/[email protected]
        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/[email protected]
        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/[email protected]
        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/[email protected]
        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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions