Query Build Definitions by Team Area
My team manages many builds across many repositories. Given a list of repositories, I'd like to find all builds owned by my team.
It is simple and quick (~1s) to get all the build definitions in a repository using the IBuildDefinitionQueryModel. However, I would like to limit the query results to only those definitions owned by my team. I cannot find a way to build this into my query. Currently I find all the definitions in the repository and then check the definitions process area to see if it matches mine. This approach returns the correct results but is significantly slower (~5-10s). Since this page will eventually be a publicly facing aggregated list of builds 10s will not cut it. Can I add a process area to my query filter?
Should I be able to expect the RTC server to be able to handle this type of live querying for builds/results or should I look into another approach, like maintaining a separate list of hosted builds in an external database?
Thanks,
-Dave
It is simple and quick (~1s) to get all the build definitions in a repository using the IBuildDefinitionQueryModel. However, I would like to limit the query results to only those definitions owned by my team. I cannot find a way to build this into my query. Currently I find all the definitions in the repository and then check the definitions process area to see if it matches mine. This approach returns the correct results but is significantly slower (~5-10s). Since this page will eventually be a publicly facing aggregated list of builds 10s will not cut it. Can I add a process area to my query filter?
Should I be able to expect the RTC server to be able to handle this type of live querying for builds/results or should I look into another approach, like maintaining a separate list of hosted builds in an external database?
Thanks,
-Dave
One answer
Sorry for the long delay on this. There are two possibiliies:
1) keep with the current approach, but avoid transferring all info about the definitions by specifying reduce list of properties when you fetch the items, e.g. fetch only build definition id and owner
2) cast down to internal com.ibm.team.build.internal.common.model.query.BaseBuildDefinitionQueryModel.processArea()
and filter on that
Comments
SUNIL KUURAM
Mar 13 '13, 2:03 p.m.Hello Dave,
Could you advise how to use IBuildDefinitionQueryModel? I got the native SDK but I can only find this class interface to com.ibm.team.build.common.model.query.IBaseBuildDefinitionQueryModel. Not sure how to use this. I have this code snippet -
IItemQuery itemQuery = IItemQuery.FACTORY.newInstance(IBuildDefinitionQueryModel.ROOT);
David Rostocil
Mar 13 '13, 4:17 p.m.Sorry Sunil. I wrote this code several years ago and I no longer have access to it. Try responding to Nick's comment below.
Nick Edgar
JAZZ DEVELOPER Mar 14 '13, 5:03 p.m.Hi Sunil, IBuildDefinitionQueryModel is a static member type of IBaseBuildDefinitionQueryModel:
Nick Edgar
JAZZ DEVELOPER Mar 14 '13, 5:05 p.m.Once the query is configured the way you want, you can run it using:
Nick Edgar
JAZZ DEVELOPER Mar 14 '13, 5:07 p.m.See also https://jazz.net/wiki/bin/view/Main/BuildJavaProgrammingExamples
1 vote