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.

Some deprecated behaviors in QB 13, How to fix? #4525

tomz ·

After attempting to upgrade to QB13 to resolve the step prebuild script behavior bug, we are seeing some deprecated functionality in some of our build scripts that I would need to know how to replace before rolling this version to production.

We have some groovy source code that we use to determine if a grid node belongs to a specific resource. It needs to function whether or not that node is currently in use by that resource, or idle, but ready to be used as that resource. The function used to be:

(resource.getCount(gridNode) > 0)

but getCount() no longer can take a gridNode object in qb13. What should we be doing instead? It's important that the result of the code query lets us know if a grid node belongs to a resource whether or not it is actively in use when queried.

Thanks for your help.
Tom Z

  • replies 5
  • views 627
  • stars 1
robinshen ADMIN ·

QB13 introduced global resource besides node resource, and the syntax to do the same is changed to:

resource.type.getCount(resource.name, gridNode)
tomz ·

Follow-up question - how do I get the current version of quickbuild in script. I've been trying:

com.pmease.quickbuild.Quickbuild.getVersion(versionStringArray)

But it seems that no matter what type of string array I pass it, the scripting engine won't allow it. A far more reasonable api would include a "getVersionString()" function. This function is necessary now because this lack of backwards compatibility in getCount().

Get Quickbuild Major Version' is failed: groovy.lang.MissingMethodException: No signature of method: static com.pmease.quickbuild.Quickbuild.getVersion() is applicable for argument types: ([Ljava.lang.String;) values: [[, , , ]]
Possible solutions: getVersion([Ljava.lang.String;)

Ideally, you never break backwards compatibility without a really good reason. When there is a good reason, you should create the function again, and have it call the new way of getting the value under the hood, and then maybe log a warning that "this method is deprecated, please replace with ..." That is a fairly standard way of deprecating API functions. It gives the user a few versions to make the change instead of forcing the surprise of a bunch of broken scripts when updating.

robinshen ADMIN ·

To get current QB version, please call script:

groovy:
com.pmease.quickbuild.bootstrap.Bootstrap.buildVersion

As to API backward compability, this is something we will take care of in future versions. Sorry for the inconvenience. As far as I know, this is the only incompatible API upgrading to QB 13.

tomz ·

That bootstrap call to get the qb version is returning the incorrect value when used from a quickbuild Agent. Does updating to 13 from 12 not force update all the agents? If not, is there a way to get the bootstrap version value on the server, when run from the agent?

robinshen ADMIN ·

Bootstrap part on agent is normally not updated, although other plugins may get updated. To get build version of server bootstrap, please use below script:

groovy:

logger.info(grid.serverNode.nodeService.evalGroovyScript("com.pmease.quickbuild.bootstrap.Bootstrap.buildVersion"));