Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
6 replies Latest Post - ‏2013-11-18T12:01:46Z by sreenivasj
sreenivasj
sreenivasj
8 Posts
ACCEPTED ANSWER

Pinned topic Script for finding all the objects (files) in parallel for a release

‏2013-11-14T11:59:17Z |

HI,

I would need urgent help:

I have a Synergy (7.1) project which was not verified for parallel conflicts till now. But, as of now, all the objects(files) which are conflicting to each other, need to be identified and a report need to be created. This report will be given to the developer and later he will enact on resolving the parallel conflicts.

Note: The project structure is in such a way that: there are releases such as Rel_1.0, Rel_2.0, and Rel_3.0. The new version of a file would be checked out from a Rel_1.0 release,Say, Rel_3.0 version of file is checked out from Rel_2.0 version. There could be a parallel version for Rele_3.0 file, in Rel_1.0 release itself. I am expecting that, this is a conflict for my Rel_3.0 version of file and should be captued through the script. So, in a nutshell, I need all latest release files to have no parallels (of previous releases) in version history view. The script should help me in idetifying all the objects in the project which has this type of conflicts.

Please let me know your thoughts.

 

Regards,
Sreenivas.

  • sreenivasj
    sreenivasj
    8 Posts
    ACCEPTED ANSWER

    Re: Script for finding all the objects (files) in parallel for a release

    ‏2013-11-14T14:41:22Z  in response to sreenivasj

    To add some light to the way in which (i assume), the solution can be found:

    Can we ,using the CLI script, find all the files in a given project, and go the 'history details' of each file.  We have an option in CLassic client 'Show History Details' which lists all "Predecessors' and Successors'.

    As per my requirement, I should get a report of all file versions with doesnot have a 'Successor' (except the last object in the history). This should be repeated for all distinct files.

     

    Any suggestion, solution, please

    • Mike.Scharnow
      Mike.Scharnow
      43 Posts
      ACCEPTED ANSWER

      Re: Script for finding all the objects (files) in parallel for a release

      ‏2013-11-14T15:50:18Z  in response to sreenivasj

      Hello Sreenivas,

      Well I guess this is possible.

      You would start with a query

      • ccm query "is_member_of (name='nameofyourproject' and version='versionofyourproject')" -u -f %name,%type,%instance

      Then for every member you get you would put name, type and instance in variables, lets say $name, $type, $instance and make a query

      • ccm query "is_hist_leaf() and name='$name' and type='$type' and instance='$instance'" -f %objectname,%task_release

      with this you get all objects which do not have a successor - you will then have to find out yourself which versions are problematic, depending on your requirements.

      In case this is relevant for you: should the member be a (sub)project, you will have to do this loop again for the subproject

       

      Perhaps this helps

      Regards,

      Mike Scharnow
      Consultant Software-Lifecycle Management
      IT-QBase GmbH

      • sreenivasj
        sreenivasj
        8 Posts
        ACCEPTED ANSWER

        Re: Script for finding all the objects (files) in parallel for a release

        ‏2013-11-15T18:34:54Z  in response to Mike.Scharnow

        Hi Mike,

        Thanks for the suggestion.

        I have tried the option suggested by you. What I get as output is the the current project's leaf node.

        Just to elaborate the scanario: I have a parallel development (Branches:1.0.0 to 4.0.0) and the current query output doesn't show the parallel objects in the history of objetcs. I get only the list of last objects in the history. I am expecting the output, to list the other parallel objetcs (in history view) too, though they are of different release tag.

        Just tp speak in terms of the query I have executed:

        ccm query "recursive_is_member_of('1/project/<project_name>/<version>',none)" -u -f %name,%type,%instance    

        ==> Gave me the list of objects in the project.

        ccm query "is_hist_leaf() and recursive_is_member_of('1/project<project_name>/<version>',none)" -f %objectname,%task_release,%task

        ==> Gave me around 500 odd objects list.

        Just to let you know, with an example, what is the concern here:

        The output had the object:

        150) MapDialogueSMT.cc-37:c++:1,FUR/4.0.0,7138

        And this is just the last node of the file object though we have parallel objects as shown in the attached hisotry view.

        Though the objects are in different releases (4.0.0  and 3.3.0), I need all these objects to be listed in the query output.

        Could you suggest please?

        Regards,

        Sreenivas.

        • Mike.Scharnow
          Mike.Scharnow
          43 Posts
          ACCEPTED ANSWER

          Re: Script for finding all the objects (files) in parallel for a release

          ‏2013-11-17T12:36:46Z  in response to sreenivasj

          well, one idea would be to create a dummy project which has in its update properties all completed tasks of all releases that you work for.

          then you can use the synergy internal "show conflicts" routine.

          If this does not suit your needs, you have to think of a method to analyze parallel objects in  a script. Use the relation "successor" to find successors and predecessors of a given object. One possible way would be

          • for each object in the project
            • create a list of all object versions with the same name, type and instance
            • starting from the object inside the project recursively travel through all successors and predecessors until you hit is_hist_root() or is_hist_leaf()
            • remove all found object versions you detected in your journey from the above list. 
            • The remaining objects in the list should be the parallel versions you are looking for

          Does this help?
          Regards,
          Mike

        • Mike.Scharnow
          Mike.Scharnow
          43 Posts
          ACCEPTED ANSWER

          Re: Script for finding all the objects (files) in parallel for a release

          ‏2013-11-17T12:51:35Z  in response to sreenivasj

          Just to add: When reading through your requirements again, I still do not completely get your needs.

          Let's take your picture as an example. I understand that, if you are in a project of release "4.0.0" you want to get the output "31.2.1". and if you are in a project of release "3.3.0" you want to get the output "31.1.1, 32, 33, ..., 37". Correct? And in a project of release "1.0" you would want to get "31.1.1, 31.2.1, 32, 33, …, 37" Correct? If so, why? Anyway, this should be solved from the approach above.

          From your first two posts I understood that in release "3.3.0" you only need the outpot "37" and in "1.0" only "31.2.1, 37". This would have been solved with the solution from Thursday.

          If this still is not what you want, please tell me from the example I attached, which list you would expect? But I think you should have enough information by now to define your own solution...

          BR,

          Mike

          • sreenivasj
            sreenivasj
            8 Posts
            ACCEPTED ANSWER

            Re: Script for finding all the objects (files) in parallel for a release

            ‏2013-11-18T12:01:46Z  in response to Mike.Scharnow

            Hi Mike,

            Thank you for looking into this.

            I think, you have mentioned in your above post, on my requirement ("I understand that, if you are in a project of release "4.0.0" you want to get the output "31.2.1".").

            What I need is: all the parallel version for the higher release (though the higher release's Reconfig Temeplate doesn't include lower release objects). In the above example, when I am in project of release 4.0.0, I would need, version: 31.2.1 and 37 to be listed as parallel versions. In case, if we have another parallel version of (say 18.1.1 , of release 2.0.0) in history view, that version too should be listed by the script as a parallel object.

            The rationale of this requirement is: The developement team working on this project has, these branches (1.0.0, 2.0.0, 3.0.0, 4.0.0) in parallel and continue to work on them. But they has now realized that, latest release (as of now, 4.0.0) should have no parallel version history. So, they need to know, what objects have the parallel version history. Once the objects are identified, they can resolve the conflicts by doing the Merge. Though, this approach may not stick to the right SCM practise, as a need of the project, should follow this.

            Note: If I create a project, which include all completed tasks of all releases, and check for conflicts,it may not list the parallel objects. But, instead, is listing the implicite conflicts. So, defenitely, I would need script to tackle the situation, I feel.

            Regards,
            Sreenivas.