Can you link two Trac repository to one SVN repository?

71 views
Skip to first unread message

Abtin Khatoonabadi

unread,
Jun 11, 2014, 3:39:03 PM6/11/14
to trac-...@googlegroups.com

Hello,

 

I am trying to have the following set up. 

 

Assume that my customer has two different project developments in one SVN repository, project A and project B.  Project A and project B are also sharing the same Trac repository.  My customer is asking me to do the following:

 

·         Both Project A and B are going to share the same SVN repository.

·         Project A and B need to have their own Trac repository. 

·         When there is a commit on the project A part of the SVN repository, the referenced ticket on the Trac repository A needs to be updated.  

·         When there is a commit on the project B part of the SVN repository, the referenced ticket on the Trac repository B needs to be updated.

 

I looked at http://trac.edgewall.org/wiki and I didn’t find anything about one SVN repositoriy for multiple Trac repositories.  I was wondering if this capability exists? If yes, then could you provide the link so I can read and learn?

 

Thank you for any help you can provide in this situation.

Ryan Ollos

unread,
Jun 11, 2014, 4:45:06 PM6/11/14
to trac-...@googlegroups.com
On Wed, Jun 11, 2014 at 12:39 PM, Abtin Khatoonabadi <abti...@gmail.com> wrote:

Hello,

 

I am trying to have the following set up. 

 

Assume that my customer has two different project developments in one SVN repository, project A and project B.  Project A and project B are also sharing the same Trac repository.  My customer is asking me to do the following:

 

·         Both Project A and B are going to share the same SVN repository.

·         Project A and B need to have their own Trac repository.


There's nothing special about having two Trac project and a single Subversion repository. Just setup two Trac projects and configure each to connect to the Subversion repository. There are some nuances to how setup multiple Trac projects, and you can read more about that here: http://trac.edgewall.org/wiki/TracMultipleProjects

The situation is more complex if you wish to implement access controls so that each Trac project has limited access to the Subversion repository (e.g. Project A can only access /projectA in the SVN repository): http://trac.edgewall.org/wiki/TracMultipleProjectsSVNAccess
 

·         When there is a commit on the project A part of the SVN repository, the referenced ticket on the Trac repository A needs to be updated.  

·         When there is a commit on the project B part of the SVN repository, the referenced ticket on the Trac repository B needs to be updated.


Setting up the post-commit hook for your scenario will also be a bit more complex. For the basics of setting up a post-commit hook, start here:
http://trac.edgewall.org/wiki/TracInstall#AutomaticreferencetotheSVNchangesetsinTractickets

Assuming you are calling trac-svn-hook from your post-commit hook, you could probably use svnlook to inspect the paths that are modified, and use the modified path to set TRAC_ENV before calling trac-svn-hook.
http://trac.edgewall.org/browser/tags/trac-1.0.1/contrib/trac-svn-hook

If /projectA is associated with Trac project A and /projectB is associated with Trac project B, you'll have to decide how you want to handle the case that the user is committing changes to both paths. This might not be an issue for you depending on how you've configured access controls, or if your processes dictate that a user would never make a change like that. You could probably reject such a change in the pre-commit hook.

Steffen Hoffmann

unread,
Jun 11, 2014, 4:51:30 PM6/11/14
to trac-...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11.06.2014 21:39, Abtin Khatoonabadi wrote:
> Hello,
> I am trying to have the following set up.
>
> Assume that my customer has two different project developments in one
> SVN repository, project A and project B. Project A and project B are
> also sharing the same Trac repository.

Sorry to interfere, but there is no such thing like a "Trac repository".
Trac repository browser accesses existing repositories and provides
views on them.

Of course you may only show parts of a repository using different
fine-grained permission [1] settings for different Trac instances. I'm
assuming your setup is a multiple Trac environments in single parent
directory, but this doesn't matter at all here.

> My customer is asking me to do
> the following:
> · Both Project A and B are going to share the same SVN repository.

Possible starting from Trac 0.12. [2]

> · Project A and B need to have their own Trac repository.

Unclear, see above.

> · When there is a commit on the project A part of the SVN
> repository, the referenced ticket on the Trac repository A needs to be
> updated.

You need to customize the ticket commit updater script to know about the
mapping of different SVN branches to respective Trac environments.

> · When there is a commit on the project B part of the SVN
> repository, the referenced ticket on the Trac repository B needs to be
> updated.

Likewise.

> I looked at /_http://trac.edgewall.org/wiki_/and I didn’t find anything
> about one SVN repositoriy for multiple Trac repositories. I was
> wondering if this capability exists? If yes, then could you provide the
> link so I can read and learn?

All supported repository types have optional components that you need to
enable explicitly, even SVN since 1.0 IIRC. See the repository
administration page [3] for details.

Steffen Hoffmann


[1] http://trac.edgewall.org/wiki/TracFineGrainedPermissions
[2] http://trac.edgewall.org/wiki/MultipleRepositorySupport
[3] http://trac.edgewall.org/wiki/TracRepositoryAdmin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iEYEARECAAYFAlOYwUIACgkQ31DJeiZFuHcxMgCg0dB3GG8zsYQDSWY33eeENHWQ
T7UAmwcf9gQuRoZYjUNCWuLaP2xKciwu
=b3GN
-----END PGP SIGNATURE-----

Abtin Khatoonabadi

unread,
Jun 12, 2014, 1:50:43 PM6/12/14
to trac-...@googlegroups.com
Hello,
 
Thank you both so much for your quick reply and help.  I was able to use the infomation that you provided and solve the issue. 
 
I am new in the Trac Group.  Should I post the solution?

Ryan Ollos

unread,
Jun 12, 2014, 2:15:46 PM6/12/14
to trac-...@googlegroups.com


On Jun 12, 2014 12:50 PM, "Abtin Khatoonabadi" <abti...@gmail.com> wrote:
>
> Hello,
>  
> Thank you both so much for your quick reply and help.  I was able to use the infomation that you provided and solve the issue. 
>  
> I am new in the Trac Group.  Should I post the solution?

Certainly. Please do!

shat...@e-z.net

unread,
Jun 28, 2014, 12:19:07 AM6/28/14
to trac-...@googlegroups.com, Abtin Khatoonabadi
Abtin,

We have the following with success. I am presenting this as an example of
using
multiple instances of Trac browsers for an enterprise to give visibility
to the
various subversion repositories and possible virtual subdirectories that are
related to specific enterprise project management processes.

/export/svn/repos/*
Repository_1 (infra_admin)
Repository_2 (documents)
Repository_3 (common_libs)
Repository_4
Repository_5
Repository_6
Repository_7
Repository_8
Repository_9 (sandbox)

/export/trac/*
Project_1 -- InterTrac Prefix P1
ref: Repository_1 (infra_admin)
ref: Repository_2
ref: Repository_3
Project_2 -- InterTrac Prefix P2
ref: Repository_2
ref: Repository_3
ref: Repository_4
ref: Repository_5
ref: Repository_6
ref: Repository_7
ref: Repository_8
Project_3 -- InterTrac Prefix P3
ref: Repository_2
ref: Repository_3
ref: Repository_4
ref: Repository_7/subdir/path1
ref: Repository_8/subdir/path2
Project_4 -- InterTrac Prefix P4
ref: Repository_2
ref: Repository_3
ref: Repository_5
ref: Repository_6
ref: Repository_7/subdir/path3
ref: Repository_8/subdir/path4
Project_5 -- Sandbox
ref: Repository_9 (sandbox)

The Trac Projects have visibility to the subversion repository heads and
virtual subdirectory paths. Any modification to a subversion repository
issues a callback hook for each of the referencing Trac Projects.

Each project is given an InterTrac prefix so that specific project-specific
tickets can be readily referenced by repository commit messages. All
Trac projects referencing a given repository see all updates committed to
that repository. This is why we use InterTrac prefixes in our commit
messages so that the appropriate project-specific tickets can be retrieved.

We don't allow a repository commit to modify a project ticket status.

In your case, you might try using an InterTrac prefix to identify the
specific project ticket requiring a status update or content edit.

It is advisable to synchronize all Trac Project Browsers with the current
state of the referenced subversion repositories on each commit. Therefore,
all referencing Trac Projects get copies of all commit messages for each
subversion repository as part of the synchronization.

Users are encouraged to use the InterTrac prefixes in their commit messages
when specific Trac Projects and help-desk tickets are related to a repository
commit or checkin.

We also have in our enterprise some various help-desk management systems
that do not have visibility into subversion repositories. These help-desk
systems have been given InterWiki links that can be placed in repository
commit messages. This allows for Trac Projects to see related help-desk
tickets when viewing the repository commit logs.

We use Apache2 webserver to administer the repository access permissions
and the Trac logins. We also use a mix of LDAP to Active Directory
systems and file-based authentication. We also use a mix of LDAP and
file-based access authorizations. Our hosting has been prototyped on
both Debian and RedHat systems.

Beware: the devil is big in the configuration details.

Steven J. Hathaway
Systems Integrator
Criminal Justice Information Systems

>
>
> Hello,
>
>
>
> I am trying to have the following set up.
>
>
>
> Assume that my customer has two different project developments in one SVN
> repository, project A and project B. Project A and project B are also
> sharing the same Trac repository. My customer is asking me to do the
> following:
>
>
>
> · Both Project A and B are going to share the same SVN
> repository.
>
> · Project A and B need to have their own Trac repository.
>
> · When there is a commit on the project A part of the SVN
> repository, the referenced ticket on the Trac repository A needs to be
> updated.
>
> · When there is a commit on the project B part of the SVN
> repository, the referenced ticket on the Trac repository B needs to be
> updated.
>
>
>
> I looked at *http://trac.edgewall.org/wiki <http://trac.edgewall.org/wiki>
> *and
> I didn’t find anything about one SVN repositoriy for multiple Trac
> repositories. I was wondering if this capability exists? If yes, then
> could you provide the link so I can read and learn?
>
>
>
> Thank you for any help you can provide in this situation.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Trac Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to trac-users+...@googlegroups.com.
> To post to this group, send email to trac-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/trac-users.
> For more options, visit https://groups.google.com/d/optout.
>


Reply all
Reply to author
Forward
0 new messages