From 87bd194c640f5a20d129e7a6fb6890bedb427e97 Mon Sep 17 00:00:00 2001 From: Tushar Mathur Date: Wed, 27 Nov 2024 16:53:06 -0800 Subject: [PATCH] add docs --- src/generate.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/generate.rs b/src/generate.rs index 4c775fe..b604a47 100644 --- a/src/generate.rs +++ b/src/generate.rs @@ -81,6 +81,14 @@ impl Generate { } } +/// Organizes job dependencies within a given `Workflow`. +/// +/// This function iterates over all jobs in the provided `Workflow` and ensures that +/// each job's dependencies are correctly set up. If a job has dependencies specified +/// in `tmp_needs`, it checks if those dependencies are already defined in the workflow. +/// If not, it creates new job IDs for the missing dependencies and inserts them into +/// the workflow. The function then updates the `needs` field of each job with the +/// appropriate job IDs. fn organize_job_dependency(mut workflow: Workflow) -> Workflow { let mut job_id = 0; let mut new_jobs = IndexMap::::new();