build engine and build definition visibility
I have been working on a utility to clone a project from one server to another.
making progress.
my userid has permissions such that I cannot delete anything on the source server.
time for another test.
create a new project base, run scripts to clone the data..
hm.. copying builds fail.
in eclipse, they are not all shown anymore.. only some build definitions.
if I open one, I can see the supporting build engine and open it, and its related build defs (which is bigger than the list I see in the eclipse UI)..
this is 3.0.1.3 client and server.
anyone seen anything like this? I closed eclipse and re-opened.. no change.
3 answers
Hi Sam, that does sound weird. When you create the copies, are you setting the context id on the items at all? The context id controls overall visibility of an item. For all Build items it should be the item id of the project area for the associated process area of the build engine / definition. Build results and their secondary items take it from the definition (but I assume you're not copying results). If you leave the context id null, the save operation sets it as appropriate. Actually, I doubt the context id is the problem as, if it was incorrect, switching the TA filter wouldn't affect the visibility.
How are you propagating the owning process area? I assume you must maintain a map from original to new for these, and any other referenced items (e.g. build engine -> supported build definitions).
If you want to try to debug it, the relevant query is in com.ibm.team.build.internal.ui.domain.BuildDomainContentProvider.getBuildDefinitionStatusRecords(IProjectAreaHandle, IProgressMonitor)
(have I mentioned before how I hate the text limit on questions!.. here is another 'answer' to be able to hold the text.)
thanks.. to create the BuildEngine and BuildDefinition objects I use
IBuildEngine buildEngine_new = BuildItemFactory.createBuildEngine((IProcessArea) new_project);
and
IBuildDefinition newbuildDef = BuildItemFactory.createBuildDefinition((IProcessArea) new_project);
so they are associated with the new repository project object.
I am not setting the 'contextID' explicitly.
I also lost all contact to the build engines and builddefs on the new repository.
they were there, but not visible in any project area. I had to run thru and delete them and recreate to get them visible again.
in the production system project, where I don't have write authority, I can see only some of the BE and BD if I set the filter to 'All projects'
if I specify a filter and click the project specifically, I can see ALL the BE and BDs.
no idea what is going on.
the BE to supported BD (and vice versa) is working fine.