Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How do you obtain list of change sets being delivered in a Baseline in a Deliver Operation Advisor

I am working on a Deliver operation advisor to verify change set / work item linkages.  When change sets are delivered by themselves, the DeliverOperationData for the deliver operation provides the list of change sets.  When a baseline is delivered along with some new change sets (as part of the baseline) the DeliverOperationData does not provide the new change sets that are being delivered.  I can get the handle(s) to the baseline(s) being delivered, but I am not seeing a straightforward way to obtain the change sets.  Do I have to compare the baseline against the destination workspace/stream or is there a more direct way of identifying the new change sets?  Does anyone have any example code of how to go from deliverOperationData.getBaselines() to a list of IChangeSetHandles (like is returned from deliverOperationData.getChangeSetHandles()?

Thank you,

Jamie Berry.

0 votes



One answer

Permanent link
You can use the source and destination workspaces and compare them with each other.

IWorkspaceConnection connection = SCMPlatform.getWorkspaceManager(ITeamRepository).getWorkspaceConnection(DeliverOperationData.getSourceWorkspace(), monitor);

connection.compareTo(destinationWorkspaceConnection, ..);


You can follow that snippet to get your comparison report. That will return the baselines including change sets that differ from the two workspaces.

0 votes

Comments

Thanks for your reply.  I am doing this as part of a Deliver operation advisor, so I can't compare the two workspaces as not everything may be delivered.  I have been looking at comparing the baseline that is being delivered to the destination workspace, I just have to figure out how to get the WorkspaceManager from the advisor as I don't have all the same objects as when just writing a stand-alone plain java api based client.  Thanks again.

Oh right, the advisor is being run on the server. You should obtain IScmService to compare your baseline and workspace.

Thanks everyone.  I have my advisor working as desired (for the most part) now.  I wound up using:

IChangeHistorySyncReport syncRpt = scmService.compareWorkspaceToBaseline((IWorkspaceHandle)destWS.getItemHandle(), iBaselineHandle, null, null);

to compare the Baseline to the Destination workspace.  The IncomingChangeSets then had the chagne sets in the Baseline that were being delivered.  The only concern I have with this call is that scmService.compareWorkspaceToBaseline doesn't accept IProgressMonitor but uses IRepositoryProgressMonitorHandle .  I didn't see a way to convert the monitor I have to the monitor handle, so I just used null.  It works, but I don't know if there will be any issues with the progress not being reported for the baseline/workspace comparison...  If anyone has hints on how to get the IRepositoryProgressMonitorHandle object from a server side delivery advisor, I would appreciate it.

Thanks again.

You can do something like this to get a repository monitor:


IRepositoryProgressMonitor repositoryMonitor = IRepositoryProgressMonitor.ITEM_FACTORY
.createItem(IProgressMonitor);

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,927

Question asked: Oct 22 '14, 4:51 p.m.

Question was seen: 3,578 times

Last updated: Oct 23 '14, 1:05 p.m.

Confirmation Cancel Confirm