RTC/Git integration: who's done it/how well does it work?
Hi all. I've read the "Integrating other SCM Systems with Rational Team Concert 2.0" document from 2009, which gives a lot of detail but is a little lacking as to the higher-level pros and cons, and searched these forums looking for people who've actually implemented this integration but haven't found much.
Has anyone out there actually implemented the RTC/Git bridge described in the above document? How is it working for you? Do you have any advice? Are you willing to give a general overview of how your system works? With a DVCS there are lots of decisions to make (it seems to me); do you connect RTC with only the "master" git repository? All of them? Etc. Is there any existing community around this environment that I can contact? What features of RTC does one lose by choosing the Git bridge instead of the builtin SCM? The above doc just says "it is possible to provide a similar type of integration between RTC work items and other SCM systems by using comments and the "Related Artifacts" links provided by the Work Items component. The level of integration will not be as high as with RTC SCM but it is useful none the less"; I'm wondering exactly what "not as high" means: what features are preserved, and which are not. Finally in some of my readings I've seen discussion of a "connector", while the above doc describes a Git "bridge". Are "connector" and "bridge" different names for the same thing? If not what is the advantage of a connector over a bridge (or vice versa), and if a connector gives tighter integration then is there one available for Git and/or would it be difficult to create one? Thanks for any guidance/pointers/guidelines anyone can provide! Cheers! |
22 answers
Yeah sorry, i didnt see the comment there..I see you created a soft link..so I downloaded the zip for hooks provided by IBM and unzipped them on my local and edited the scripts mentioned in Readme.txt and placed them on server in /hooks folder for my repo. yours is a nice way to link to multiple repos. Next thing..I'll check my python-3.3.5 installation again..i downloaded a .tgz tarball and untar it but i think all i have is source code and not executable
Comments
Amrinder Singh
commented Aug 13 '14, 3:04 p.m.
Also my system has python 2.7. Just because rtc-git integration requires python 3.3.5, do i have to make it as default for everything? because the git integration provides some pre-compiled (pyc) python files, the interpreter version must match almost exactly.
Amrinder Singh
commented Aug 19 '14, 5:42 p.m.
Hey Sam.. thanks for the guidance so far but I have a doubt regarding Python. I have Python 2.7 and 3.3.4 installed and default is set to 2.7. I dont want to change that but how do i make sure that integration python scripts use 3.3.4 an not 2.7?
sam detweiler
commented Aug 19 '14, 9:06 p.m.
I have both as well, but only set the explicit path in the post-receive hook file
|
So the latest version of ActivePython is is 3.3.4.1, would that work? or its the same thing
Comments
sam detweiler
commented Aug 13 '14, 3:41 p.m.
yes, I corrected my comment, that is the same I installed
|
Ok so I installed ActivePython-3.3.4.1 by running ./install.sh and its installed in opt/ActivePython-3.3/bin/python, but to run python I see two files python3 and python3.3, which one do i execute or they are same? "Wish I could put my snap in here"
Comments
sam detweiler
commented Aug 13 '14, 4:30 p.m.
I used python3.3 and the script executes now.. fails connecting to RTC cause I haven't finished the config yet., but at least doesn't crash for bad interpreter version.
|
So couple of things I did today to fix my python mess: 1) Installed ActivePython-3.3.4.1 (default install location: /opt/ActivePython-3.3/bin) 2) Edited my Python scripts( post-receive, pre-receive, ref-update and ref-updated.py) by adding a shebang at the beginning of my script (#!/opt/ActivePython-3.3/bin/python3.3) though python 2.7 is installed but I think this shebang will help execute what version of Python I want. So one of IBM requirement is to mention HOOKS_PATH in the scripts Example: Location where Git Python hook scripts are copied example hooksPath="C:/PythonScripts/rtcgithooks" So to do this we need to create a rtcgithooks folder and copy all hook scripts there? Comments
sam detweiler
commented Aug 13 '14, 7:00 p.m.
my post-receive hook script from ibm says
sam detweiler
commented Aug 13 '14, 11:34 p.m.
I finally got my web git interface working git-web on tomcat. and was able to registr the repo. this generates a key that is needed in the hook script. so the link approach won't work. as each repo has a different key..
|
So in my pre-receive script I have this after all editing: #!/opt/ActivePython-3.3/bin/python3.3
remote="$1"
while read oldRev newRev refName; do
exit 0 and I try to execute this script manually it throws syntax error:invalid Syntax on below url.. Dont know why??but will try troubleshooting jazzRepoUrl=https://ptcpassbuild1:9443/jazz/
|
But overall I have registered Git repository but still the integration doesnt work....
Comments
sam detweiler
commented Aug 14 '14, 11:24 a.m.
and in the git commit message you have to put some specific text to trigger the integration
|
My GIT commit is like this:
git commit -s -m "fix defect 419901" and then I push it and then I got to links in RTC but nothing comes up. Is this message correct? Comments according to http://www-01.ibm.com/support/knowledgecenter/api/content/SSYMRC_5.0.0/com.ibm.team.connector.cq.doc/topics/t_git_assoc_wi.html
|
I have my scripts in below loactions: 1) For Git repo: /media/storage/gerrit2/review_site/git/testproject2.git/hooks {hookslib.pyc, post-receive.py, pre-receive.py, rtcprocess.pyc and commit-msg} 2) For Gerrit : /media/storage/gerrit2/review_site/hooks {ref-update.py and ref-updated.py} 3) For hooks path: /opt/ActivePython-3.3/share/python3.3/scripts/rtcgithooks {AssociateWorkItem.py, hookslib.pyc, post-receive.py, pre-receive.py, ref-update.py, ref-updated.py, rtcprocess.pyc and ValidatePush.py}
For this integration I have modified post-receive, pre-receive , ref-update and ref-updated scripts.
Please let me know if any script needs to be placed in any other folder/directory?
|
1) For Git repo: /media/storage/gerrit2/review_site/git/testproject2.git/hooks {hookslib.pyc, post-receive.py,
pre-receive.py, rtcprocess.pyc and commit-msg} only post-receive needs to be in the hooks folder. post-receive is the thing git calls. and ONLY that file on push. it must be executable too chmod +x post-receive the others are in the location where the ibm files are /opt/ActivePython-3.3/share/python3.3/scripts/rtcgithooks |
Yeah I'll do that.. Its weird I only changed the Url and path in scripts and now I tried running post-receive.py scripts manually and I get a syntax error: file "./post-receive.py", line 35 while read local_ref local_sha remote_ref remote_sha; do SyntaxError: invalid syntax. Did you try running urs? Comments
sam detweiler
commented Aug 14 '14, 4:27 p.m.
I don't have a post-receive.py
|
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.