mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-06 05:50:16 +00:00
fix(actions): fail unexpandable reusable workflow callers and decouple the job emitter's cross-run processing (#38565) (#38587)
Backport #38565 by @Zettat123 ## Changes ### 1. Handle reusable workflow expansion failures If a reusable workflow caller job is invalid (e.g. uses a workflow with syntax error), the job emitter should mark it as failed instead of retrying. Related: https://github.com/go-gitea/gitea/pull/38518#discussion_r3608882095 ### 2. No longer process concurrent run inline **Before**: If a run(R1)'s status change unlocks another blocked run(R2) via concurrency group, the job emitter will process R2 in R1's transaction. **Current**: No longer process R2 inline and emit the ID of R2 to let another pass process it. Co-authored-by: Zettat123 <zettat123@gmail.com>
This commit is contained in:
@@ -333,6 +333,14 @@ func GetDirectChildJobsByParent(ctx context.Context, parentJob *ActionRunJob) (A
|
||||
return jobs, nil
|
||||
}
|
||||
|
||||
// DeleteDirectChildJobsByParent deletes the direct child jobs of a parent job.
|
||||
func DeleteDirectChildJobsByParent(ctx context.Context, parentJob *ActionRunJob) error {
|
||||
_, err := db.GetEngine(ctx).
|
||||
Where("run_id=? AND parent_job_id=?", parentJob.RunID, parentJob.ID).
|
||||
Delete(new(ActionRunJob))
|
||||
return err
|
||||
}
|
||||
|
||||
// CollectAllDescendantJobs returns every job in `allJobs` that lives under parent's subtree (recursively), excluding `parent` itself
|
||||
func CollectAllDescendantJobs(parent *ActionRunJob, allJobs []*ActionRunJob) []*ActionRunJob {
|
||||
parents := map[int64]bool{parent.ID: true}
|
||||
|
||||
Reference in New Issue
Block a user