feat(jobparser): support ${{ needs... }} in runs-on as IncompleteRunsOn #1194

Merged
mfenniak merged 5 commits from runs-on-references-dynamic-matrix into main 2025-12-01 15:42:16 +00:00
Owner

Note: this PR is stacked on #1195.

Following the same pattern as #1190, this PR adds support for ${{ needs ... }} within the runs-on field. It also extends the support of the runs-on: ${{ matrix... }} to include matrixes that are dynamically defined per #1190.

Minor additional changes are required in Forgejo to: use the new SupportIncompleteRunsOn() parse option, mark jobs as blocked when they come back as IncompleteRunsOn, and add related error handling and test automation cases.

Together these changes allow the accurate parsing of these jobs that aren't supported currently:

on:
  push:

jobs:
  define-matrix:
    runs-on: docker
    outputs:
      scalar-value: ${{ steps.define.outputs.scalar }}
      array-value: ${{ steps.define.outputs.array }}
    steps:
      - id: define
        run: |
          echo 'scalar=debian-ci-latest' >> "$FORGEJO_OUTPUT"
          echo 'array=["debian-latest", "debian-ci-latest"]' >> "$FORGEJO_OUTPUT"

  runs-on-needs:
    needs: define-matrix
    runs-on: ${{ needs.define-matrix.outputs.scalar-value }}
    steps:
      - run: uname -a

  runs-on-dynamic-matrix:
    needs: define-matrix
    strategy:
      matrix:
        runs-on:
          - debian-latest
          - "${{ needs.define-matrix.outputs.scalar-value }}"
    runs-on: ${{ matrix.runs-on }}
    steps:
      - run: uname -a
  • features
    • PR: feat(jobparser): support ${{ needs... }} in runs-on as IncompleteRunsOn
**Note:** this PR is stacked on #1195. Following the same pattern as #1190, this PR adds support for `${{ needs ... }}` within the `runs-on` field. It also extends the support of the `runs-on: ${{ matrix... }}` to include matrixes that are dynamically defined per #1190. Minor additional changes are required in Forgejo to: use the new `SupportIncompleteRunsOn()` parse option, mark jobs as blocked when they come back as `IncompleteRunsOn`, and add related error handling and test automation cases. Together these changes allow the accurate parsing of these jobs that aren't supported currently: ```yaml on: push: jobs: define-matrix: runs-on: docker outputs: scalar-value: ${{ steps.define.outputs.scalar }} array-value: ${{ steps.define.outputs.array }} steps: - id: define run: | echo 'scalar=debian-ci-latest' >> "$FORGEJO_OUTPUT" echo 'array=["debian-latest", "debian-ci-latest"]' >> "$FORGEJO_OUTPUT" runs-on-needs: needs: define-matrix runs-on: ${{ needs.define-matrix.outputs.scalar-value }} steps: - run: uname -a runs-on-dynamic-matrix: needs: define-matrix strategy: matrix: runs-on: - debian-latest - "${{ needs.define-matrix.outputs.scalar-value }}" runs-on: ${{ matrix.runs-on }} steps: - run: uname -a ``` <!--start release-notes-assistant--> <!--URL:https://code.forgejo.org/forgejo/runner--> - features - [PR](https://code.forgejo.org/forgejo/runner/pulls/1194): <!--number 1194 --><!--line 0 --><!--description ZmVhdChqb2JwYXJzZXIpOiBzdXBwb3J0ICR7eyBuZWVkcy4uLiB9fSBpbiBydW5zLW9uIGFzIEluY29tcGxldGVSdW5zT24=-->feat(jobparser): support ${{ needs... }} in runs-on as IncompleteRunsOn<!--description--> <!--end release-notes-assistant-->
feat(jobparser): enhance incomplete_matrix with information about what job & output was accessed
All checks were successful
checks / validate pre-commit-hooks file (pull_request) Successful in 33s
checks / validate mocks (pull_request) Successful in 36s
checks / build and test (pull_request) Successful in 52s
checks / runner exec tests (pull_request) Successful in 25s
checks / runner integration tests (pull_request) Successful in 5m13s
checks / integration tests (pull_request) Successful in 11m2s
issue-labels / release-notes (pull_request_target) Successful in 5s
cascade / debug (pull_request_target) Has been skipped
cascade / end-to-end (pull_request_target) Successful in 5s
cascade / forgejo (pull_request_target) Successful in 1m35s
675d1c949b
mfenniak changed title from feat(jobparser): support ${{ needs... }} in runs-on as IncompleteRunsOn to WIP: feat(jobparser): support ${{ needs... }} in runs-on as IncompleteRunsOn 2025-11-30 04:36:03 +00:00
Author
Owner

Marked as WIP for the moment due to a test failure in evalmatrixneeds2 that I won't be able to immediately fix.

Marked as WIP for the moment due to a test failure in `evalmatrixneeds2` that I won't be able to immediately fix.
mfenniak force-pushed runs-on-references-dynamic-matrix from 960c356ee9
Some checks failed
cascade / forgejo (pull_request_target) Has been skipped
cascade / debug (pull_request_target) Has been skipped
cascade / end-to-end (pull_request_target) Has been skipped
checks / validate pre-commit-hooks file (pull_request) Successful in 1m18s
checks / validate mocks (pull_request) Successful in 1m38s
checks / build and test (pull_request) Successful in 3m43s
checks / runner exec tests (pull_request) Successful in 30s
checks / runner integration tests (pull_request) Successful in 6m21s
checks / integration tests (pull_request) Failing after 12m38s
issue-labels / release-notes (pull_request_target) Successful in 4s
to c5703f2c03
Some checks failed
cascade / forgejo (pull_request_target) Has been skipped
cascade / debug (pull_request_target) Has been skipped
cascade / end-to-end (pull_request_target) Has been skipped
checks / build and test (pull_request) Failing after 17s
checks / runner exec tests (pull_request) Has been skipped
checks / runner integration tests (pull_request) Has been skipped
issue-labels / release-notes (pull_request_target) Successful in 10s
checks / validate mocks (pull_request) Failing after 32s
checks / validate pre-commit-hooks file (pull_request) Successful in 32s
checks / integration tests (pull_request) Successful in 11m1s
2025-11-30 17:46:59 +00:00
Compare
mfenniak force-pushed runs-on-references-dynamic-matrix from c5703f2c03
Some checks failed
cascade / forgejo (pull_request_target) Has been skipped
cascade / debug (pull_request_target) Has been skipped
cascade / end-to-end (pull_request_target) Has been skipped
checks / build and test (pull_request) Failing after 17s
checks / runner exec tests (pull_request) Has been skipped
checks / runner integration tests (pull_request) Has been skipped
issue-labels / release-notes (pull_request_target) Successful in 10s
checks / validate mocks (pull_request) Failing after 32s
checks / validate pre-commit-hooks file (pull_request) Successful in 32s
checks / integration tests (pull_request) Successful in 11m1s
to 7f13e5cf30
All checks were successful
checks / validate pre-commit-hooks file (pull_request) Successful in 33s
checks / validate mocks (pull_request) Successful in 36s
checks / build and test (pull_request) Successful in 47s
checks / runner exec tests (pull_request) Successful in 27s
checks / runner integration tests (pull_request) Successful in 5m11s
checks / integration tests (pull_request) Successful in 10m41s
issue-labels / release-notes (pull_request_target) Successful in 5s
cascade / debug (pull_request_target) Has been skipped
cascade / end-to-end (pull_request_target) Successful in 7s
cascade / forgejo (pull_request_target) Successful in 1m16s
2025-11-30 17:49:18 +00:00
Compare
mfenniak changed title from WIP: feat(jobparser): support ${{ needs... }} in runs-on as IncompleteRunsOn to feat(jobparser): support ${{ needs... }} in runs-on as IncompleteRunsOn 2025-11-30 18:53:37 +00:00
Contributor

cascading-pr updated at actions/setup-forgejo#781

cascading-pr updated at https://code.forgejo.org/actions/setup-forgejo/pulls/781
Contributor
cascading-pr updated at https://codeberg.org/forgejo/forgejo/pulls/10272
mfenniak deleted branch runs-on-references-dynamic-matrix 2025-12-01 15:42:18 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
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
forgejo/runner!1194
No description provided.