It's all about the answers!

Ask a question

How can an operation advisor know which files are going to be delivered?


Michal Sipos (112) | asked Nov 21 '16, 12:20 p.m.
edited Nov 23 '16, 1:40 p.m. by David Lafreniere (4.1k7)
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!

Comments
Michal Sipos commented 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...

One answer



permanent link
Ralph Schoon (54.9k23642) | answered Nov 22 '16, 2:49 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Nov 22 '16, 2:58 p.m.
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.

Comments
Michal Sipos commented Nov 22 '16, 3:40 p.m.

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?


Ralph Schoon commented Nov 23 '16, 2:14 a.m. | edited Nov 23 '16, 2:14 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
   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.  

Ralph Schoon commented Nov 23 '16, 3:00 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 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();

Your answer


Register or to post your answer.