Topic
  • 2 replies
  • Latest Post - ‏2013-04-29T20:57:00Z by benray
GKellner
GKellner
259 Posts

Pinned topic Pre-Checkin trigger - identify deliver/rebase action

‏2013-04-29T05:37:30Z |

Hi fellows,

I've written a pre-ci trigger, which should only be run, if the checkin is done by the developer, but it shouldn't be run, if it's a checkin due to UCM deliver or rebase action.

Has anyone a hint, how to identify those actions on checkin event?

greetings georg.

  • stamaja
    stamaja
    8 Posts

    Re: Pre-Checkin trigger - identify deliver/rebase action

    ‏2013-04-29T14:40:14Z  

    Hello Georg,

    Something you may want to look into for accomplishing that are the environment variables set during trigger operations.  Something that looks to me like it might be a good indicator of what is causing the checkin is CLEARCASE_POP_KIND.  The documentation for the "mktrtype" says that for the "deliver -complete" and "rebase -complete" commands, CLEARCASE_POP_KIND will have that as its value.  So by checking to see if CLEARCASE_POP_KIND has either of those, the if-condition would be true for a UCM deliver or rebase.

    I'm going strictly from the documentation - I haven't tested it.

    Regards,  Jim

  • benray
    benray
    74 Posts

    Re: Pre-Checkin trigger - identify deliver/rebase action

    ‏2013-04-29T20:57:00Z  

    A preop-checkin trigger is going to fire on every checkin, including those in rebase or deliver operations, unless it is locked obsolete or the user is in the -nusers list for that trigger type. So the answer may depend on your process. For example, do developers rebase/deliver their own streams? If not you could have the admin doing the rebase/deliver operations in the -nusers list. Are these operations done only during off hours? You could lock -obsolete the trigger temporarily while the rebase/deliver is done.

    If your rebase/deliver ops are done by developers during working hours (most likely the case) these are not good solutions and you will need to have a trigger that fires on every checkin but includes logic to short circuit itself if the operation is a deliver or rebase. In this sense Jim is on the right track with looking at the CLEARCASE_POP_KIND to incorporate into the trigger script/logic.