How can an operation advisor know which files are going to be delivered?
Hello,
I am trying to implement an operation advisor that is activated when DELIVER operation on server is attempted.
I have followed this blog that deals with the advisor that, when DELIVER operation is attempted,checks if workitems are of the desired type. If not, delivery is forbidden.
My task is to program a similar advisor, but mine should be able to find out which files are going to be delivered (are modified or new) and then, it should carry out specific checks on that files.
MY GOAL: Get the advisor find out which files are going to be delivered and therefore the advisor should perform specific check on them.
Thank you very much in advance!
I am trying to implement an operation advisor that is activated when DELIVER operation on server is attempted.
I have followed this blog that deals with the advisor that, when DELIVER operation is attempted,checks if workitems are of the desired type. If not, delivery is forbidden.
My task is to program a similar advisor, but mine should be able to find out which files are going to be delivered (are modified or new) and then, it should carry out specific checks on that files.
MY GOAL: Get the advisor find out which files are going to be delivered and therefore the advisor should perform specific check on them.
Thank you very much in advance!
One answer
Consider google for "deliver change set Team Concert Advisor" and the like. Limit using site:jazz.net as selection criterion. https://rsjazz.wordpress.com/ also has API examples more in https://rsjazz.wordpress.com/interesting-links/ . A deliver advisor can iterate all items that are to be delivered.
https://rsjazz.wordpress.com/2016/02/03/setting-access-control-permissions-for-scm-versionables/ explains some of the API, I think.
https://rsjazz.wordpress.com/2016/02/03/setting-access-control-permissions-for-scm-versionables/ explains some of the API, I think.
Comments
Thank you Ralph, but I have already been google-ing for some days and I am still confused on where to start. I am a student and I am a novice in extending RTC, this is my school work, I would really appreciate just some guidance on which way to go I mean wether to look at com.ibm.team.scm.common or which another part of the API?
From this blog have you followed how to set up your environment for debugging and done the extensions workshop? If not, do that and then look at your code again.
Note: deliver delivers changes/change sets. the changes are to files at the end, but a change set does not necessarily impact only one file. https://rsjazz.wordpress.com/2016/02/03/setting-access-control-permissions-for-scm-versionables/ , as mentioned above shows the API to use. Dependent on what operation you use you will have to use SCM API and setControl in above link shows you how to go from an IChangeSet to an IChange to an IVersionableHandle.
This is code to get all the change sets in a delivery
IItemServiceIterator changeSetIterator = ItemServiceIteratorFactory.INSTANCE
.createFetchItemsIterator(fItemService, changeSetHandles
.toArray(new IItemHandle[changeSetHandles.size()]),
IRepositoryItemService.COMPLETE);
while (changeSetIterator.hasNext()) {
IChangeSet changeSet = (IChangeSet) changeSetIterator.next();
Comments
Michal Sipos
Nov 22 '16, 1:49 p.m.I would like to have just a little advice on in which parts of the API I should look at.
I need to get information about which files were modified or added to the repository workspace and are included in a particular changeset and I need to go through all the files and do some operations on them...