Query Build Definitions by Team Area
![]()
David Rostocil (91●14●10)
| asked Mar 16 '10, 3:31 p.m.
edited Mar 13 '13, 5:07 p.m. by Spencer Murata (2.3k●11●59●71)
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 |
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
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
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);
Sorry Sunil. I wrote this code several years ago and I no longer have access to it. Try responding to Nick's comment below.
Hi Sunil, IBuildDefinitionQueryModel is a static member type of IBaseBuildDefinitionQueryModel:
Once the query is configured the way you want, you can run it using:
See also https://jazz.net/wiki/bin/view/Main/BuildJavaProgrammingExamples