Attached is the beginning of a sync plugin for Trac. I'm trying to get out of the house and get to work at the moment, but I'll post a Trac URL for the project later this week. For now, if anybody is interested in testing or working on it, here's a partially functioning start.
It requires trac4r and ditz, but nothing else. It also assumes that you installed trac4r with rubygems. Right now, it *only* does one-way syncing from Trac to Ditz. Going the other direction won't be any more difficult; I just haven't gotten to it yet. Usage: first, save attachment to wherever your ditz plugins live; eg, /usr/local/lib/site-ruby/1.8/ditz/plugins. Then: ditz reconfigure # Only the first time ditz sync # yeah, yeah... overlaps with the git plugin. The 'ditz reconfigure' allows you to set the Trac URL of the project (without the login/xmlrpc stuff), and the uid and password for a user that has XMLRPC permissions in Trac There are a *lot* of caveats to this: 1. Work with a *clone* of your repository to start with. I do not guarantee that this is bug-free. 2. Not everything between ditz and Trac map 1-1. I had to make some assumptions about how to map statuses and dispositions -- most of these assumptions are in the mappings at the top of the plugin. Suggestions about better mappings are welcome. 3. I'm planning on extending the ditz Issues to include some of the information from Trac; in particular, the plugin matches issues by the Trac:summary / ditz:title, which is guaranteed to fail in not-to-unusual edge cases, so I'm going to store the Trac ID in the ditz issue. 4. Related to the previous two points is that some Trac information isn't saved in ditz, such as priority or severity. I'll add support for these, but some information -- such as attachments -- I probably won't. 5. Because of limitations in ditz's configuration system (specifically, there isn't per-repo configuration), you can only use this with a single project. That is, the configuration is global, not per repo. I may have to implement a plugin-specific configuration mechanism to fix this. 6. It is very verbose right now. I need to add a --debug mode to reduce that. Oh, and the code is not particularly pretty, nor well documented. OTOH, it isn't very complex, either. However, it seems to work fairly well, although testing has so far been very limited. Please, please, make sure that XMLRPC is working *outside* of this plugin before submitting issues about it. And don't bother asking me about how to configure Trac to get XMLRPC working -- it was a pain in the ass for me to get it working on my site, and I'm not eager to go through that again. I'm not even sure what I did that made it work, so I'd probably just screw up your Trac configuration. Feedback is welcome. Assistance is welcome even more. Cheers, --- SER
trac-sync.rb
Description: application/ruby
_______________________________________________ ditz-talk mailing list [email protected] http://rubyforge.org/mailman/listinfo/ditz-talk
