mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-05 21:23:55 +02:00
refactor(actions): defer dynamic matrix expansion to jobparser
Expand a needs-dependent matrix through the new jobparser.ExpandMatrixWithNeeds, which evaluates the raw matrix against the needs context via NewInterpeter the same way EvaluateConcurrency does. This replaces synthesizing a workflow with stub jobs and re-parsing it once the dependencies complete. Parse now emits a single placeholder per needs-dependent matrix and the whole matrix expands exactly once when the needs finish, instead of being split per static value at planning time and re-expanded per placeholder. This removes ExtractRawStrategies, HasMatrixWithNeeds and constructWorkflowWithNeeds. Side effects of deferring the whole matrix: a static+dynamic matrix no longer duplicates N times, needs-output detection no longer relies on string matching (so bracket notation is handled), and a deferred placeholder gets no commit status until it expands, avoiding an orphaned status from the name change. Co-Authored-By: Claude (Opus 4.8) <noreply@anthropic.com>
This commit is contained in:
@@ -46,6 +46,11 @@ func CreateCommitStatusForRunJobs(ctx context.Context, run *actions_model.Action
|
||||
}
|
||||
|
||||
for _, job := range jobs {
|
||||
// A deferred-matrix placeholder's name changes when it expands, so a status created now
|
||||
// would be orphaned; the expanded combos get theirs at expansion time.
|
||||
if job.RawStrategy != "" && !job.IsMatrixEvaluated {
|
||||
continue
|
||||
}
|
||||
if err = createCommitStatus(ctx, run.Repo, event, commitID, run, job); err != nil {
|
||||
log.Error("Failed to create commit status for job %d: %v", job.ID, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user