Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

QuickBuild configuration.getNextVersion() setting version for wrong config #4431

sidthr ·

I have a config Alpha and its child Bravo and Bravo's child Charlie

Alpha
------> Bravo
------------> Charlie

I run this script in a step in Charlie

def releaseCfg = configuration.getParent().getParent();  // root/Branches/Alpha/Bravo/Charlie , we want root/Branches/Alpha
nextVersion = releaseCfg.getNextVersion(true); // expected to get next version number of Alpha without setting it
logger.info("NextVersion:" + nextVersion + " for config:" + releaseCfg.getName());

The log shows "NextVersion:Alpha.0.0.4 for config:Alpha" Checks out, as expected."

However,

if I change the dryRun parameter to false and keep everything else the same,

nextVersion = releaseCfg.getNextVersion(false); // expected to get next version number of Alpha and set it

The log now shows "NextVersion:Bravo.0.0.31 for config:Alpha" AND Bravo's version number is incremented in the build Vars

Note how releaseCfg.getName() always returns Alpha as it should

Any help would be appreciated

  • replies 1
  • views 1253
  • stars 1
robinshen ADMIN ·

Please change the line "nextVersion = releaseCfg.getNextVersion(false);" as below to see if it works:

com.pmease.quickbuild.Context.push(releaseCfg);
try {
  nextVersion = releaseCfg.getNextVersion(false);
} finally {
  com.pmease.quickbuild.Context.pop();
}

If still does not work, please create a minimal test database and send to me [robin AT pmease DOT com] for diagnostics.