Harvest

Expand all | Collapse all

Code review - Multiple changes to same file

  • 1.  Code review - Multiple changes to same file

    Posted Sep 14, 2017 03:33 PM

    Hi,  our company is using CA Harvest 12.5 as its SCM.  We are looking to implement code review flows using Harvest.  We have multiple developers and tend to have multiple changes to the same file from different packages in our releases.

     

    My question is how can we efficiently review changes from package A on file X when multiple changes exist to this file from more than one package since the base version.

     

    For example

     

     

    DeveloperFileVersionPackageComment
    Base versionabc.c0N/ABase Version
    Dev1abc.c1123adds change1 for project 1
    Dev1abc.c2123adds change 2 for project 1
    Dev2abc.c3456adds unrelated changes for project 2
    Dev1abc.c4123adds change 3 for project 1
    Dev1abc.c5123adds change 4 for project 1

     

     

    Dev1 then requests a review of package 123 to Reviewer1

     

    When Reviewer1 starts the review of abc.c for package 123 he sees a diff between versions 5 and 4 by default.  It is possible to change version 4 in the right pane to any of the lower versions.  You don't see all the changes in the package by default, only the latest version diff.

     

    I can't find a way to see only the changes from package 123 together for the review. (ie. I want to see all the diffs in versions 1,2,4,5 but not version 3 from package 456 as this is not related to this review)

     

    I can change the right pane to version 4,3,2,1 or 0 but I can't change the left view from version 5.

    It would be okay if I can see individual diffs 5-3, and 2-0 for the review but you currently have to know all of the version numbers in package 123 head of time -- you can't see which version is in which package during the review.

     

    Is it possible to achieve this?



  • 2.  Re: Code review - Multiple changes to same file

    Broadcom Employee
    Posted Sep 15, 2017 10:55 AM

    Hi Bernt,

    Concurrent Development model or parallel development model is supported by harvest

    First ,I will take this question and request to review these thoroughly which may answer the remaining questions as well.

    Question:
    how can we efficiently review changes from package A on file X when multiple changes exist to this file from more than one package since the base version.
    Multiple changes can exist because of multiple developers.Each developer is the owner of his branch.

     

    I will provide an example in detail on usage of same files by multiple developers and how they can branch out ,merge and effectively create the final version after effective reviews.

    1. Let's say Base version of a file say for example. abc.c exists in the repository baseline.

    2. Let us have two packages say p1 created by developer1 and p2 created by developer2 in the state Development

    3. There is a process called Check out for update defined in the harvest state -Development.Enclosed is a snapshot of the process. Concurrent update option needs to be checked here by the harvest administrator.

     


    4. Developer1 checks out abc.c for cconcurrent upate using package p1 and continues to work on this file
    At this point ,abc.cpp will have a BRANCH version created as 0.1.1 [R] with reserved tag in the package p1

    5.Developer 2 checks out abc.c for cconcurrent upate using package p2 and continues to work on this file
    At this point ,abc.cpp will have a BRANCH version created as 0.2.1[R] with reserved tag in the package p2

    6. Now say Developer1 completes his work and he checks in his file abc.cpp into the repository.Now his file will have version 0.1.1[N]-N is normal version in package p1

    7. Now say Developer2 completes his work and he checks in his file abc.cpp into the repository.Now his file will have version 0.2.1[N]-N is normal version in package p2

    8. Branch versions need to merged into TRUNK now.

    9.Developer 1 merges his branch 0.1.1 work into the main trunk  using package p1 and Concurrent merge process will create a version 1 now in the package p1
    [ version 1 and version 0.1.1 contents are identical.It is just a plain merge from branch onto trunk]

    10.Developer 2 merges his branch 0.2.1 work into the main trunk using package p2.
    Now there is a conflict between version 0.2.1 and version 1 and a merged tag 2 [M] tag is created.

    11..Now any user  or whoever is assigned a role to resolve that merge say for ex: merge engineer can use interactive merge process and sees the two changes in the interactive merge pane
    Now he chooses the content which he wants to retain in the main trunk .

    Now the M tag is changed into N tag

    2[M] is converted to 2 [N] after successful interactive merge option.

    This is the way to review changes effectively when multiple changes exist in a file

     

    Sample interactive Merge dialog box:

     

     

    But kindly note that this is possible when you use concurrent update/branching model and make best use of branching provision and merging in harvest.

    If you have only trunks enabled within a project .This is not possible within a project because always the changes take place on a trunk and conflicts will not be shown.

    For branching out details ,please refer to the harvest documentation available from here

    https://docops.ca.com/ca-harvest-scm/13-0/en/using/understanding-versions

     

    For concurrent merging details ,please refer to the harvest documentation available from here

    https://docops.ca.com/ca-harvest-scm/13-0/en/using/compare-and-merge-versions#CompareandMergeVersions-ConcurrentMergeProcess

    https://docops.ca.com/ca-harvest-scm/13-0/en/using/compare-and-merge-versions#CompareandMergeVersions-ConcurrentMergeProcess

     

    Please review these answers thoroughly and let us know further questions!

     

    Regards,

    Balakrishna.



  • 3.  Re: Code review - Multiple changes to same file

    Posted Sep 17, 2017 11:45 AM

    Hi Balakrishna,

    Thanks for your detailed response.

    We are already using branching, interactive merges, and concurrent merges to resolve the code in Harvest.

     

    My question is only for the built in Harvest Code Review process when trying to review above changes where multiple developers modify the same file before the review.  The interleaved changes from other packages that are not part of the review request are shown when comparing versions -- so it's hard to determine exactly what is in the package during the review and what code to exclude from the review.  Currently it seems the review needs to know every version of every file that is in the package being reviewed ahead of time and there is no way to exclude changes from other packages during the review process.  I am hoping there is a solution to this with the current version of Harvest.

     

    Regards,

    Bernt



  • 4.  Re: Code review - Multiple changes to same file

    Broadcom Employee
    Posted Sep 17, 2017 01:48 PM

    HI Bernt,

    Thanks for the clarification.

    Request you to review the Peer Review feature of harvest

     

    Here is the link

    Team Collaboration for Code Review - CA Harvest SCM - 13.0 - CA Technologies Documentation 

     

    Also embedded is a video with a short explanation of what it is all about.

    I will provide more details to all your questions in the follow up update

    Regards,

    Balakrishna.



  • 5.  Re: Code review - Multiple changes to same file

    Posted Sep 17, 2017 02:28 PM

    Thanks.  I have already reviewed it and am actually trying to use it.  It works fine for simple single version changes -- my question relates to multiple changes on the same file from two packages.  When I try to review that I can only see diffs against the highest version and it includes non-related changes from the other package. Please review my original post with the version change details in the example.  The review should not consider changes from the other package in my opinion.  I want to review the code in the package the code review request is for -- and I want to see ALL of the changes in this package only.

     

    Hope that clarifies my request.

     

    Regards,

    Bernt



  • 6.  Re: Code review - Multiple changes to same file

    Broadcom Employee
    Posted Sep 18, 2017 01:36 PM

    Hello Bernt,

     

    Correct me if i understood your requirement.

     

    You want to have only the versions related to package while navigating  versions in the review process so that you would be comparing the versions which are part of the package only.

    or

    You are expecting a package name beside the version number. This way you can skip comparing those versions.

     

    Thanks,

    Sridhar



  • 7.  Re: Code review - Multiple changes to same file

    Posted Oct 02, 2017 10:28 AM

    Hi Sridhar,

     

    Both would be very useful.  Ideally I want to only see changes relating to the package under review.

    Having the package name beside the version number will help identify what versions are in the package and what is not but it would be much better if the tool could somehow filter away the changes not related to the package under review.

     

    Regards,

    Bernt



  • 8.  Re: Code review - Multiple changes to same file

    Broadcom Employee
    Posted Sep 18, 2017 10:24 AM

    HI Bernt,

     

    Thanks for the detailed explanation.

    You would want to see all versions 1,2 ,4 and 5 but not version 3 which is not related to the change in the present project.

    Please note that version 3 is the parent of version 4 and we cannot directly access version 4 from version 2.

    There is no mechanism to group all version 1 ,2 and 4 and 5 excluding version 3 if they are already on trunks

    Because 5 is the cumulative change on trunk which included  versions 1,2,3 ,4 and 5.

     

    I would suggest a way for this.

    Here is your table

     

    DeveloperFileVersionPackageComment
    Base versionabc.c0N/ABase Version
    Dev1abc.c1123adds change1 for project 1
    Dev1abc.c2123adds change 2 for project 1
    Dev2abc.c3456adds unrelated changes for project 2
    Dev1abc.c4123adds change 3 for project 1
    Dev1abc.c5123adds change 4 for project 1

     

    Here is our suggestion to use branches in this way

     

    DeveloperFileVersionPackageComment
    Base versionabc.c0N/ABase Version
    Dev1abc.c0.1.1123adds change1 for project 1
    Dev1abc.c0.1.2123adds change 2 for project 1
    Dev2abc.c0.2.1456adds unrelated changes for project 2
    Dev1abc.c0.1.3123adds change 3 for project 1
    Dev1abc.c

    0.1.4 OR version 1 

    version 1 can be a concurrently merged version on the package 123

    123adds change 4 for project 1

    Steps to be followed:

     

    1.abc.c has version 0 in the repository.

    2.Always branch out using same package 123 by the same developer Dev1 

    0.1.1,0.1.2,0.1.3, etc

    3. Assign a different package to Dev2 -He will branch out version 0 to version 0.2.1 using package 456.

    4.All branches in the package 123 are inter related and incremental.

    Please see the snapshot below

     

    Comparing version 0.1.4 with base version trunk[package 123]

    0.1.4 is the cumulative/incremental  BRANCH version of 0.1.1,0.1.2 ,0.1.3.

     

     

     

    Note : In any of the comparison 0.1.4 with 0 ,content of 0.2.1 is not shown up which is your specific requirement I believe since 0.2.1 is altogether on a different branch on another package

    this  version would never come into this comparison done on versions existing within package 123.

     

    Second snapshot:

    Comparison of 0.2.1 and base version trunk 0[package 456]

    This change is an isolated change

    0.2.1 does not have anything to do with 0.1.1,0.1.2,0.1.3 and 0.1.4

     

    Here again ,any of the version changes included in package 123 are not shown in the comparison pane.

    They are separate branches and do not have conflicts unless merged.

     

     

    Request you to review these options thoroughly and let us know if this branching out would meet your requirements...?

     

    If trunks are used always,then it is not possible to isolate a version in between the trunks

     

    Please do let us know if you have more questions on the usage I have explained above.

     

    Regards,

    Balakrishna.



  • 9.  Re: Code review - Multiple changes to same file

    Broadcom Employee
    Posted Sep 28, 2017 09:48 AM

    HI Bernt,

     

    Did you have a chance to review the suggestions above.

    If you need more information on the usage, please do send a mail to us

     

    shaba05@ca.com

    goosr01@ca.com

    and we will be able to assist you further.

     

    It may be still better to raise a ticket with CA support system

     

     

    Note: Also request you to review the latest release of CA Harvest SCM which is V13 increment2

    You may want to review the new features/additional capabilities in the new release from here

    New Features and Enhancements - CA Harvest SCM - 13.0 - CA Technologies Documentation 

     

    Please do let us know if you need more information

     

    Regards,

    Balakrishna



  • 10.  Re: Code review - Multiple changes to same file

    Posted Oct 02, 2017 11:05 AM

    Hi Balakrishna,

     

    In our company we use merging only when going to the next release of the product.  Individual developers work in multiple packages on trunk so the review of a branch won't work for us unfortunately.  Good suggestion though.  For us packages relate to project request changes and are all applied on trunk for the next version of the product. This unfortunately interleaves changes from multiple packages as separate versions of the files being modified.

     

    In our company individual developers do not have permission to create branches.

     

    Thanks for all your input on this.

     

    Regards,

    Bernt