During material configuration, specifically when changing the value of poll for new changes checkbox (or autoUpdate attribute of a material in config.xml) you sometimes encounter the following validation error
Material of type XXX (<XXX details>) is specified more than once in the configuration with different values for the autoUpdate attribute. All copies of the a material should have the same value for this attribute.
As the error indicates, Go tries to determine if two materials are same. Go scans through the configuration and figures out all the unique materials. It uses this unique material list for polling the material repositories so that the same repository is not polled twice for a change (in one cycle) because it has been specified in multiple pipelines.
The logic to determine if two SCM materials are same is explained in the pseudocode below.
sub areMaterialsSame( material1, material2) : boolean
return false if material1.type != material2.type
switch (material.type)
case git: return areGitMaterialsSame(material1,material2)
case hg: return areHgMaterialsSame(material1,material2)
case svn: return areSVNMaterialsSame(material1,material2)
case tfs: return areTFSMaterialsSame(material1,material2)
case p4: return areP4MaterialsSame(material1,material2)
end
end
sub areGitMaterialsSame(gitmaterial1,gitmaterial2) : boolean
if(gitmaterial1.url == gitmaterial2.url
&& gitmaterial1.branch== gitmaterial2.branch)
return true
else
return false
end
end
sub areHgMaterialsSame(hgmaterial1,hgmaterial2) : boolean
if(hgmaterial1.url == hgmaterial2.url)
return true
else
return false
end
end
sub areSVNMaterialsSame(svnmaterial1,svnmaterial2) : boolean
if(svnmaterial1.url == svnmaterial2.url
&& svnmaterial1.username == svnmaterial2.username
&& svnmaterial1.checkExternals == svnmaterial2.checkExternals)
return true
else
return false
end
end
sub areTFSMaterialsSame(tfsmaterial1,tfsmaterial2) : boolean
if(tfsmaterial1.url == tfsmaterial2.url
&& tfsmaterial1.username == tfsmaterial2.username
&& tfsmaterial1.domain == tfsmaterial2.domain
&& tfsmaterial1.projectpath == tfsmaterial2.projectpath)
return true
else
return false
end
end
sub areP4MaterialsSame(p4material1,p4material2) : boolean
if(p4material1.serverAndPort == p4material2.serverAndPort
&& p4material1.username == p4material2.username
&& p4material1.view == p4material2.view)
return true
else
return false
end
end
In summary, pseudocode should help understand the logic used by Go, for each type of materials, to determine if they are same.
Comments
2 comments
We have autoUpdate="false" set on a particular material for all instances in our config file, yet it still triggers when something in that material changes? Is this a known bug or something else? We are on "Go Version: 13.1.0(16710-d2671e928c0cbe)" Thanks
Hi Levent,
What version control do you use?
regards
Srikanth
Please sign in to leave a comment.