It's all about the answers!

Ask a question

Code Review behavior when gaps are involved


0
2
Daniel Franke (1124) | asked Sep 14 '16, 7:28 a.m.
retagged Oct 06 '17, 4:02 p.m. by Ken Tessier (84117)

Hi,

we have enabled the code review for the task work item (id=500). In one work item we have 4 change sets associated. Switching to the approvals tab it shows this error message next to the change sets:

Diffs for the following files cannot be shown because they were modified in change set(s) that are not associated with this work item. Check to see if you have change sets that should be associated with this work item.

  • example.java

In the relevant stream s1, component x, the history view for the example.java shows 10 changes (change sets):

cs10 -  id 500
cs09 -  id 512
cs08 -  id 511
cs07 -  id 513
cs06 -  id 500
cs05 -  id 500

cs04 -  id 490
cs03 -  id 494
cs02 -  id 500
cs01 -  id 494

The error message disappears when all the change sets are linked to WI id 500. And the complete Review section under the approval tab disappears.

Is there any reason for it why this is not working when the file has been changed in change sets with other work items? When I try the same with another task which has also not all change sets linked to it - it is showing: Change Sets(Contains Gap) - But it is still working, there is no such error.

Thanks for any hints or advice.

Accepted answer


permanent link
David Lafreniere (4.8k7) | answered Oct 05 '17, 12:07 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
edited Oct 05 '17, 12:08 p.m.

I believe this is the behavior you would see in RTC 6.0.1.
In RTC 6.0.2 we added the ability to conduct code reviews even in the presence of gaps. We still indicate which file has a gap in the Compare editor though. When there is a gap it makes it more difficult to conduct a code review.
For example, if you have continuous change sets CS1, CS2, CS3 (all touching the same file - where CS2 was created by someone else) and associate CS1 and CS3 to a work item and request a code review, we flag the file as having a gap. By default the compare editor will compare the before state of CS3 and the after state of CS3. It will not pick the before state of CS1 by default. If it did, then the compare/diff would be showing changes that were added in CS2, and this would imply the author added those changes as part of this work item, when they did not. The reviewer would be expected to change the file state drop-down combos to the before/after state to that of CS1 so they can review that change set as well.

Please open any defects if you are still seeing issues in RTC 6.0.2+.


For additional information about RTC Code Review, please see:
Article: Rational Team Concert Code Review
Video: Introduction to Code Review (Part 1)
Video: Configuring Code Review (Part 2)
Video: Performing a Code Review (Part 3)
Knowledge Center: Working With the Code Review Tool

Michael Valenta selected this answer as the correct answer

One other answer



permanent link
Ralph Schoon (63.1k33645) | answered Sep 15 '16, 2:26 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I have never seen that error, but just from reading the message:

Diffs for the following files cannot be shown because they were modified in change set(s) that are not associated with this work item. Check to see if you have change sets that should be associated with this work item.

    example.java

The error is not that there are change sets not associated to the work item, the error is that there are change sets missing that are needed to compute the diff for the specific file, as far as I can tell. So the file is changed in some other change set that is not associated to this work item and this is a gap and prevents creating/showing the diff.

Comments
Daniel Franke commented Sep 15 '16, 3:02 a.m.

Hello Ralph,
thanks for your answer.

We also interpreted the error message like this in the first place and tried to attach every change set of the file to the work item.

After this, the error message disappeared but also the whole code review section disappeared from the "approval" tab.

Also we tried to reproduce the error but missing change sets lead to a "gap" and the code review still works in this case.


Ralph Schoon commented Sep 15 '16, 3:34 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Then I don't know and would suggest to create a defect with support.

Your answer


Register or 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.