fix: re-parsing incomplete jobs must use on.workflow_call.inputs, not global inputs #1251

Merged
mfenniak merged 1 commit from workflow-call-reparse-inputs into main 2025-12-31 14:18:43 +00:00
Owner

Defect discovered while testing https://codeberg.org/forgejo/forgejo/pulls/10647 -- within a nested reusable workflow that is also "incomplete" (can't be fully defined until an input from another job is provided), the inputs context is incorrectly evaluated in the context of the top-most workflow, rather than the reusable workflow's inputs.

In other words, when the job layer-2 is defined in this end-to-end test...

forgejo/end-to-end@776506dfef/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml (L44-L52)

It has to be parsed twice:

  • the first time it is marked "incomplete" because ${{ needs.callee-1... }} isn't defined, since callee-1 isn't done.
  • the second time it is parsed, ${{ inputs... }} was incorrectly referencing the overall job's inputs, not the inputs to reusable-layer-1.yml, due to the bug here.
  • bug fixes
    • PR: fix: re-parsing incomplete jobs must use on.workflow_call.inputs, not global inputs
Defect discovered while testing https://codeberg.org/forgejo/forgejo/pulls/10647 -- within a nested reusable workflow that is also "incomplete" (can't be fully defined until an input from another job is provided), the `inputs` context is incorrectly evaluated in the context of the top-most workflow, rather than the reusable workflow's inputs. In other words, when the job `layer-2` is defined in [this end-to-end test](https://code.forgejo.org/forgejo/end-to-end/pulls/1362)... https://code.forgejo.org/forgejo/end-to-end/src/commit/776506dfef1144fd86ffe1252bf25d53ff3b6a53/actions/example-workflow-call-expansion/.forgejo/workflows/reusable-layer-1.yml#L44-L52 It has to be parsed twice: - the first time it is marked "incomplete" because `${{ needs.callee-1... }}` isn't defined, since `callee-1` isn't done. - the second time it is parsed, `${{ inputs... }}` was incorrectly referencing the overall job's inputs, not the inputs to `reusable-layer-1.yml`, due to the bug here. <!--start release-notes-assistant--> <!--URL:https://code.forgejo.org/forgejo/runner--> - bug fixes - [PR](https://code.forgejo.org/forgejo/runner/pulls/1251): <!--number 1251 --><!--line 0 --><!--description Zml4OiByZS1wYXJzaW5nIGluY29tcGxldGUgam9icyBtdXN0IHVzZSBvbi53b3JrZmxvd19jYWxsLmlucHV0cywgbm90IGdsb2JhbCBpbnB1dHM=-->fix: re-parsing incomplete jobs must use on.workflow_call.inputs, not global inputs<!--description--> <!--end release-notes-assistant-->
mfenniak changed title from fix: re-parsing jobs must use on.workflow_call.inputs, not global inputs to fix: re-parsing incomplete jobs must use on.workflow_call.inputs, not global inputs 2025-12-31 04:03:11 +00:00
mfenniak force-pushed workflow-call-reparse-inputs from bb6013a713
Some checks failed
checks / build and test (pull_request) Failing after 42s
checks / runner exec tests (pull_request) Has been skipped
checks / runner integration tests (pull_request) Has been skipped
checks / validate pre-commit-hooks file (pull_request) Successful in 44s
checks / validate mocks (pull_request) Failing after 45s
issue-labels / release-notes (pull_request_target) Successful in 4s
checks / integration tests (docker-latest) (pull_request) Successful in 10m18s
checks / integration tests (docker-stable) (pull_request) Successful in 12m10s
to 0cd0279598
All checks were successful
checks / validate mocks (pull_request) Successful in 39s
checks / validate pre-commit-hooks file (pull_request) Successful in 41s
checks / build and test (pull_request) Successful in 2m38s
checks / runner exec tests (pull_request) Successful in 24s
checks / runner integration tests (pull_request) Successful in 5m25s
checks / integration tests (docker-latest) (pull_request) Successful in 8m47s
checks / integration tests (docker-stable) (pull_request) Successful in 11m7s
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
issue-labels / release-notes (pull_request_target) Successful in 9s
2025-12-31 04:33:00 +00:00
Compare
viceice approved these changes 2025-12-31 07:52:13 +00:00
aahlenst approved these changes 2025-12-31 10:49:54 +00:00
mfenniak deleted branch workflow-call-reparse-inputs 2025-12-31 14:18:44 +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!1251
No description provided.