fix(jobparser): evaluating matrix values within runs-on references first matrix value only #1307
No reviewers
Labels
No labels
FreeBSD
Kind/Breaking
Kind/Bug
Kind/Chore
Kind/DependencyUpdate
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
Windows
linux-powerpc64le
linux-riscv64
linux-s390x
run-end-to-end-tests
run-forgejo-tests
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo/runner!1307
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "mfenniak/forgejo-runner:fix-matrix-eval-on-runs-on"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
runs-on: [ abc, ${{ matrix.dimension }} ]is evaluating the first time the the job parser goes through the matrix, and removing the evaluation variable. For the next matrix value, there's no expression left to evaluate.Regression caused by #1194. During development, it was assumed that cloning
yaml.Nodewould create an independent node -- which it does when the data is stored in theValuefields of theyaml.Node. But whenruns-onis a sequence, the values are stored in an array of pointers which causes a clone to share internal state with the original value. Unfortunately this failed to trigger a regression test.This is currently broken in Forgejo 14.0.0 - 14.0.1, which will require this to be merged, a runner to be released, the runner to be upgraded in Forgejo, and a Forgejo release with the regression fixed.
b11eea9beefd2360b3b4otherwise LGTM
btw: which label is used by the runner to decide the execution mode? 🤔 eg: I set lxc and docker, does it run on first label defined?
we need to update the docs to be node v24 here
https://forgejo.org/docs/next/admin/actions/#lxc
@ -283,0 +292,4 @@bytes, err := yaml.Marshal(node)if err != nil {return nil, fmt.Errorf("failed to marshal node: %w", err)} else if node.Kind == 0 {shouldn't this come before the marshall to save call?
fd2360b3b410384dd6cc@viceice wrote in #1307 (comment):
The first one in the
runs-onlist is used.