It's all about the answers!

Ask a question

How can I find if a file which is being delivered is also in the outgoing (in some change set) of the destination stream?


Fran Burgos (12311049) | asked Jan 21 '15, 4:36 a.m.
edited Jan 21 '15, 10:57 a.m.
I have an extension which runs in a Delivery action. The extension gets de files changed inside the change sets. Now would like looking for if there are change sets in the outgoing of the destination stream with this files.

How can I perform this search? Or where can I found documentation about this issue?

EDIT:

This is our use case:

We have 3 stream, A -> B -> C -> D, and a CS1 which is in A and B but not in C, and CS2 which is only in A. In addition CS1 and CS2 have different versions of F1 element. Something like this:

A     ->     B       ->     C      ->    D
|               |
CS1         CS1
(F1)         (F1)
CS2
(F1)

The aim is ban to perform a Deliver A -> B before than delivering B -> C. So I need look for if (F1 is in the outgoing of B) then fails. 

A     ->     B       ->     C      ->    D 
|               |
CS1         CS1
(F1)         (F1)
CS2                                       FAIL!
(F1)

A     ->     B       ->     C      ->    D 
|               |                 |
CS1         CS1           CS1
(F1)         (F1)           (F1)
CS2                                       RIGHT!
(F1)

A     ->     B       ->     C      ->    D 
|               |                 |
CS1         CS1           CS1
(F1)         (F1)           (F1)
CS2         CS2                       DONE A -> B (CS2)
(F1)         (F1)

PS: Granularity is about elements not about change sets.

Comments
Evan Hughes commented Jan 21 '15, 10:18 a.m.
JAZZ DEVELOPER

 Can you tell me more about your use case? Why do you want to know the incoming changes before delivery?


I ask because we have process preconditions that may be useful in this scenario. 


Fran Burgos commented Jan 21 '15, 11:01 a.m. | edited Jan 21 '15, 11:03 a.m.

@echughes I have reply you in the body of the question because it was too long for a comment. I have extended details.

One answer



permanent link
Evan Hughes (2.4k1218) | answered Jan 21 '15, 11:19 a.m.
JAZZ DEVELOPER
edited Jan 21 '15, 11:19 a.m.
I'm not sure what criteria is used to decide when a CS can move from one stream to the next, but I'm curious if it's possible for you to automate the deliveries from B -> C -> D. Could you do that in a build? If that's the case, then you can remove permission for regular users to deliver to B, C, or D, and trust your build process to perform the promotion properly. 

If that isn't possible, you can use IScmQueryService#findLocateChangeSets() to check to see if the given change set is in the preceding stream.

EDIT: spelling. 

Comments
Fran Burgos commented Jan 26 '15, 6:30 a.m.
 The criteria is:

1. If a change set in A contains a file which is in a change set of B but not on C then DELIVER FAILS otherwise DELIVER.

Does exist something like #findLocateFiles()? A service which might return in what change sets is a File 

Your answer


Register or to post your answer.