jenkins_api_client icon indicating copy to clipboard operation
jenkins_api_client copied to clipboard

chain function does a nested unchain, creates dependency on order or execution.

Open EfrainOlivares opened this issue 12 years ago • 0 comments

The chain function calls the unchain function. This creates a dependency on the order for adding jobs.

for clarity I'll write down what the jobs look like in jenkins (jobs pointing to downstream jobs like A->B meaning A has downstream job B)

For example, this order works. -create a job list [ A, B, C]
-chain the job list [A, B, C] so now jenkins has A->B->C -iterate through job array [A,B,C] and respectively add downstream jobs a, b, c. Result is this... A->B,a B->C,b C

While this order does not work -create job list [A, B, C] -iterate through job array and add downstream jobs respectively. Now jenkins has this A->a B->b C->c -chain job array [A,B,C]. Now jenkins has this A->B->C The jobs a, b and c are no longer downstream jobs because they were unchained.

Because chain will 'unchain' the jobs, the downstream jobs added in the second scenario will be lost.

Removing the nested unchain means higher level scripts would have to do this, but that may be ok as it will be more clear, and also make it more flexible.

EfrainOlivares avatar Nov 29 '12 07:11 EfrainOlivares