Subversion ALM with ViewVC?

Stephen McCants June 4, 2014

Hello,

We just switched to Subversion ALM from the regular Atlassian Subversion in order to use Subversion in JQL searches. This is working well for us.

However, we've had some problems with the Subversion ALM web client and I'm wonder if there is a way to configure it to use ViewVC as we had for the regular Atlassian Subversion?

Thanks for your help.

Sincerely,

Stephen McCants

2 answers

1 accepted

1 vote
Answer accepted
Stephen McCants June 9, 2014

Actually, it is possible.

  • As JIRA Administrator with Administration mode, go to Plugins => Plugins.
  • Next under Subversion ALM disable:
    • Subversion Commits Tab Panel (svnplus-subversion-commits-tabpanel)
    • Subversion Commits Project Tab (svnplus-subversion-project-tab)
  • Now enable JIRA Subversion plugin.

This provides you with ALM for JQL and commits calendar, but the tradition SVN commits tab on the work item page and projects page. That let you use ViewVC or some other solution that isn't quite as buggy.

Chris Holt March 13, 2017

Since Atlassian has now discontinued the "JIRA Subversion" plugin (since 7.3) it's time for a new workaround for this.  It involves a bit more work though.  You will need apache in front of jira's tomcat for this to work and php support in your apache.  You can find instructions for using apache in front of JIRA's tomcat from Atlassian (here).  It worked pretty much exactly like they describe.  I made one refinement of changing tomcat's 8080 listener to 8081, so that I could have apache listen on 8080 and not have to change our internal links to JIRA.  

 

First, in the httpd.conf config for the apache front end you will want it to look something like this:

 

<VirtualHost *:8080>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/secure/SWCTopMenuAction
RewriteCond %{QUERY_STRING} url=([^&]+).+rev=([^&]+)
RewriteRule ^.*$ http://internal/vvc/changes.php?path=%1&r2=%2 [L,R]
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyRequests Off
ProxyPass / ajp://jira:8009/
ProxyPassReverse / ajp://jira:8009/
</VirtualHost>

Basically, you are going to catch the links to the the diff viewer and redirect them to a php script on a server you control (internal/vvc/changes.php).  It captures the file and revision you want to compare.  (The RewriteCond directives are probably too broad and need refinement, fyi.)

 

Then in the changes.php script you do another redirect:

 

<?php
parse_str($_SERVER['QUERY_STRING'], $output);
$r2 = $output['r2'];
$r1 = $r2;
$r1--;
$url = 'http://svn/viewvc/svn' . $output['path'] . '?r1=' . $r1 . '&r2=' . $r2 . '&pathrev=' . $r2;
header("Location: " . $url);
exit;
?>

 

I had to have the php because I had to subtract 1 from the revision number to pass to viewvc's diff command.    

 

I know this is crude, and I'll probably have to refine the rewrite rules a bit as it probably breaks legit Subversion ALM plugin functionality.  But, this restores the use of view-vc within JIRA for looking at code changes, which was a must have for us.



 

0 votes
Pablo Beltran
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 4, 2014

It is not possible.

May I ask waht problems you have got with the built-in browser (Polarion)?

Stephen McCants June 4, 2014

We have a varierty of problems with the built-in browser:

  • * It is often very slow to render.
  • * Sometimes it fails to show one or both sides on the file on the difference page.
  • * Sometimes the next/previous change buttons don't work.
  • * JQL queries (the feature we really want) are slow.

We've never had any problems with ViewVC, which runs on the same server (through Apache - not Tomcat).

Stephen McCants June 4, 2014

Also, the change/delete/add counts are sometimes wrong showing deletes as changes or similar such switch.

Seems to be related to opening multiple tabs at the same time. May be AJAX calls and results are getting crossed?

Stephen McCants June 4, 2014

Another problem is with the browser back button. When you get a diff and use the next/previous change buttons and then hit "back" rather than taking you back to a different web page, it unwinds the next/previous change buttons. Since the next/previous change buttons will let you "unwind" the stack that way, it seems like the back button should take you to the previous web page (especially if you can't use multiple tabs).

Pablo Beltran
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 4, 2014

Seems to be related to opening multiple tabs at the same time. May be AJAX calls and results are getting crossed?

The bundled Polarion web client is 100% upon JSPs (no Ajax). I'll investigate the crossing data problem.

Sometimes it fails to show one or both sides on the file on the difference page.

Maybe is it related to the previous issue?

Sometimes the next/previous change buttons don't work.

Resolution is pending... [SVNALM-25]

It is often very slow to render.

JQL queries (the feature we really want) are slow

Regarding the performance, Subversion ALM is a really BIG application running on JIRA. Is your environment dimensioned for the new hardware requirements?

You might want to run both plugins at time. The Atlassian's one for the issue and project views and ALM for Agile (if installed) and JQL: you can hide any visual element from JIRA. Look at the plugin modules and try by disable the elements you want to hide...

Stephen McCants June 4, 2014

Thanks for your prompt reply.

I don't think [SVNALM-25] is our problem with the next/previous buttons, but I think that may be related to the data problem. Should I open a ticket about the data problem?

I'll look at running the the Atlassian SVN plugin and the ALM one side be side. When I initially had them installed together (when we started switching to ALM) I had errors about duplicate plugin names or something like that.

Pablo Beltran
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 4, 2014
Should I open a ticket about the data problem?
Yes, please. This would help.
I initially had them installed together (when we started switching to ALM) I had errors about duplicate plugin names or something like that.
Earlier versions of ALM had duplicated plugin keys and names. However, I changed them and now it should be able to run in parallel without any conflict.
Stephen McCants June 4, 2014

I created an account for https://kintosoft.atlassian.netbut I don't have a create ticket button. User ID is smm.

Suggest an answer

Log in or Sign up to answer