Groovy plugin script issue after upgrade to 6.5.1 from 5.1
Hi, I'm trying the upgrade procedure from 5.1 to 6.5.1 and something is not working correctly with the Groovy plugin. I installed the version for TC 6.5 but some customizations to the GroovyPropertiesProvider.groovy script are no longer working. Some properties I am adding to the build are no longer being picked up and dependencies on the existence of those properties imply that the builds which depend upon them are no longer starting. Below the code:
private void addProductVersionAndAssemblyVersionParameters(BuildParameters parameters, SBuild build) {
/*if(!build.isFinished())
return;*/
String buildNumber = build.getBuildNumber();
Pattern p = Pattern.compile([some regex here]);
Matcher m = p.matcher(buildNumber);
if(!m.matches())
return;
if(m.groupCount() != 2)
return;
parameters.addConfiguration("build.number.productVersion", m.group(1));
parameters.addConfiguration("build.number.assemblyVersion", m.group(2));
LOG.debug("Calculated productVersion and assemblyVersion configuration properties for build type " + build.getBuildTypeId());
}
It used to be working fine in version 5.1 but now I can't see them anymore. Note that I have other properties which are being set in the same way and are populated correctly, so there seems to be something wrong with these two. It might have to do with the lifecycle of a build perhaps? Note the commented code at the beginning of the procedure, initially I thought the build would have to be completed for this to be working correctly, but it was working fine in 5.1 with that snippet commented out.
Also, I can't seem to find a way to enable logging for this plugin, any advice?
Please sign in to leave a comment.
Simone,
We checked the parameters resolution logics once more. As it turned out, there was one more change in the resolution logics. Starting from TeamCity 6.5 dependency parameters provider prefers Snapshot Dependency parameters to Artifact Dependency parameters. In the implementation, snapshot dependecy parameters are taken from a build configuration. For artifact dependecny, TeamCity uses a build instance (with properties that were reported!)
I added an internal property that make TeamCity behave in the older way:
teamcity.parametersProviders.processArtifactDependenciesFirst=true
Secondly, we discused above a property to make TeamCity call parameters providers for finished builds
teamcity.parametersProviders.callForFinishedBuilds=true
I uploaded the build containing the fix at
ftp://ftp.intellij.net/pub/.teamcity/TW-17536/TeamCity-17991.exe
ftp://ftp.intellij.net/pub/.teamcity/TW-17536/TeamCity-17991.tar.gz
Simone,
could you plase try this build with both internal properties set.
To apply those properties, create internal.properties file under <teamcity data directory>/config directory and put there:
teamcity.parametersProviders.processArtifactDependenciesFirst=true
teamcity.parametersProviders.callForFinishedBuilds=true
Adding those two properties should make you groovyplug script work in the same way as in was under TeamCity 6.0.
To make those properties work you need to restart the server after you set those properties.
Simone, please let me know if this help you to resolve your dep* parameters resolution issue.