It's all about the answers!

Ask a question

RTC integration with Git - Precondition is not working

P. A. (1859) | asked Apr 29 '16, 5:12 p.m.

I'm using RTC 6.0.1 and have our own GitLab server. We've followed user guide to integrate the two systems but it's not working as it should.

Our requirement is that any commit that does not have a work item number, that commit should be rejected when pushing to GitLab. But, that's not working. The remote Git server accepts commits without an work item number. And if the commit does have a work item number mentioned, a link is generated on the respective work item to the git commit.

I do have the necessary pre-condition setup. In RTC, under the "Process Configuration -> Team Configuration -> Operations Behavior -> Git -> Push Operation (server)", I have the pre-condition added, which is named "Require work item hint in commit comment". But it seems this pre-condition is not being executed.

Is there any other configuration/setting that I missed?

P. A. commented May 16 '16, 11:45 a.m.


Just checking if anyone else can help with this issue. Here's some more update:

In my production server, if I enable the "Pre-Condition" to ONLY allow commits with workitem hint, I'm not able to push anything despite having workitems mentioned in the commit. I can't even create a new branch from Gitlab.

In the Sandbox server, I don't have the above mentioned issue, but the pre-condition is not working all the time. It only works for the first commit and that too for branches that does not exist remotely. If the branch I'm pushing remotely does exist, then the pre-condition doesn't work. Meaning, I'm able to push without entering a workitem hint.

One answer

permanent link
Ralph Schoon (63.2k33646) | answered May 02 '16, 5:05 a.m.
If operational behavior does not work, it usually is a configuration issue. See for how the basic rules are.

P. A. commented May 02 '16, 9:53 a.m.

Hi Ralph,

Thanks for your reply. I will try to go through that article although it is written for a much older version of RTC than what I'm using right now.

I do have a staging area where the pre-condition is somewhat working. In there it only works if I have a git branch on my local machine that hasn't been pushed to a remote git server yet.

Configuration wise, everything looks similar between staging and production. However, in production it's not working at all.

P. A. commented May 03 '16, 9:35 a.m.

 It turned out that after my colleague had enabled the Pre-Condition, that change wasn't saved properly. 

We made sure it was enabled yesterday but then we ran into another weird issue. We couldn't create a branch on the remote Git Server. The hook was preventing the branch creation. Unfortunately I don't have the details of the error.

Plus, In the staging server, I'm still not able to find out why the pre-condition doesn't work if the branch already exists in the remote git server.

Has anyone ran into similar issue?

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.