Changes between Version 9 and Version 10 of ScarabToTracScript
- Timestamp:
- Nov 3, 2015, 8:45:32 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ScarabToTracScript
v9 v10 1 = Migrate Scarab issues to Trac tickets = 1 [[PageOutline(2-5,Contents,pullout)]] 2 2 3 = = Description ==3 = Migrate Scarab issues to Trac tickets 4 4 5 Script that migrates [http://scarab.tigris.org/ Scarab] issues to Trac tickets 5 == Description 6 6 7 == Bugs/Feature Requests == 7 This is a script that migrates [http://scarab.tigris.org/ Scarab] issues to Trac tickets. Scarab is an artefact tracking system released under the Apache license. 8 9 == Bugs/Feature Requests 8 10 9 11 Existing bugs and feature requests for ScarabToTracScript are … … 11 13 12 14 If you have any issues, create a 13 [ http://trac-hacks.org/newticket?component=ScarabToTracScript&owner=szaffaranonew ticket].15 [/newticket?component=ScarabToTracScript new ticket]. 14 16 15 == TODO == 17 [[TicketQuery(component=ScarabToTracScript&group=type,format=progress)]] 18 19 == TODO 20 16 21 1. Translate error messages to English 17 22 1. Improve validation errors … … 19 24 1. Implement a console (vielleicht readline) to facilitate the importation 20 25 21 == Download ==26 == Download 22 27 23 Download the zipped source from [ download:scarabtotracscript here].28 Download the zipped source from [export:scarabtotracscript here]. 24 29 25 == Source ==30 == Source 26 31 27 You can check out ScarabToTracScript from [ http://trac-hacks.org/svn/scarabtotracscript here] using Subversion, or [source:scarabtotracscript browse the source] with Trac.32 You can check out ScarabToTracScript from [/svn/scarabtotracscript here] using Subversion, or [source:scarabtotracscript browse the source] with Trac. 28 33 29 == Example ==34 == Installation 30 35 31 You should have installed the [http://trac-hacks.org/wiki/XmlRpcPlugin XmlRpcPlugin] because updates are done through it. 36 General instructions on installing Trac plugins can be found on the [TracPlugins#InstallingaTracplugin TracPlugins] page. 37 38 == Configuration 39 40 You must install the XmlRpcPlugin, because updates are done through it. 32 41 33 42 1. Modify the configuration file, import-configuration.sample.xml. There are several sections: 34 1. Common: common stuff. '''scarab-attachments-path''' should be the path where are the Scarab attachments. 35 {{{ 36 #!xml 37 <common> 38 <trac-xmlrpc-url>http://user:password@any-host-to-trac/projects/a-project/login/xmlrpc</trac-xmlrpc-url> 39 <scarab-attachments-path>/tmp/scarab/attch_scarab</scarab-attachments-path> 40 </common> 43 1. Common: common stuff. '''scarab-attachments-path''' should be the path where the Scarab attachments are located. 44 {{{#!xml 45 <common> 46 <trac-xmlrpc-url>http://user:password@any-host-to-trac/projects/a-project/login/xmlrpc</trac-xmlrpc-url> 47 <scarab-attachments-path>/tmp/scarab/attch_scarab</scarab-attachments-path> 48 </common> 41 49 }}} 42 50 1. Mappings between scarab users and trac users 43 {{{ 44 #!xml 51 {{{#!xml 45 52 <users-map> 46 53 <user id-scarab="scarab-userA" id-trac="trac-userA" /> … … 48 55 </users-map> 49 56 }}} 50 1. Global mappings between scarab und trac form fields. The optional ''ignore'' attribute indicates that if the field does not exist in the Trac form, will be ignored. It is used to define fields to be used as part of other fields (in transformations). The '''transformation''' element indicates that before setting the value of these field there will be a [http://genshi.edgewall.org/ Genshi] transformation, using as genshi's context a variable named '''ticket''' with all Scarab issue's fields, including those marked with ignore = true and too the '''aditional-attributes''' (see below) 51 {{{ 52 #!xml 53 <global-attributes-map> 54 <attribute id-scarab="Para" id-trac="owner" /> 55 <attribute id-scarab="CC" id-trac="cc" ignore="true"/> 56 <attribute id-scarab="Caso de Test" id-trac="summary"> 57 <transformation>$ticket.summary [Issue Scarab $ticket.id]</transformation> 58 </attribute> 59 </global-attributes-map> 57 1. Global mappings between Scarab and Trac form fields. The optional ''ignore'' attribute indicates that if the field does not exist in the Trac form, will be ignored. It is used to define fields to be used as part of other fields (in transformations). The '''transformation''' element indicates that before setting the value of these field there will be a [http://genshi.edgewall.org/ Genshi] transformation, using as genshi's context a variable named '''ticket''' with all Scarab issue's fields, including those marked with ignore = true and too the '''aditional-attributes''': 58 {{{#!xml 59 <global-attributes-map> 60 <attribute id-scarab="Para" id-trac="owner" /> 61 <attribute id-scarab="CC" id-trac="cc" ignore="true"/> 62 <attribute id-scarab="Caso de Test" id-trac="summary"> 63 <transformation>$ticket.summary [Issue Scarab $ticket.id]</transformation> 64 </attribute> 65 </global-attributes-map> 60 66 }}} 61 67 1. a '''scarab-artifact''' section: mappings for a particular scarab issue type. '''additional-attributes''' Adds to Trac ticket (ticket-type attribute) associated with scarab issue (type attribute). The value is too a Genshi transformation. Should have a '''scarab-artifact''' tag for each Scarab Issue type. 62 {{{ 63 #!xml 64 <scarab-artifact type="Reporte Error QA" ticket-type="Defecto"> 65 <attributes-map> 66 <!-- equal to globalattributes-map --> 67 </attributes-map> 68 {{{#!xml 69 <scarab-artifact type="Reporte Error QA" ticket-type="Defecto"> 70 <attributes-map> 71 <!-- equal to globalattributes-map --> 72 </attributes-map> 68 73 69 70 71 72 73 74 75 76 77 78 79 80 74 <additional-attributes> 75 <attribute id="description"> 76 Ticket importado desde Scarab, ID = ${ticket.id} 77 {% if "descripcion_scarab" in ticket %}${ticket.descripcion_scarab}{% end %} 78 {% if "log" in ticket %}Log: 79 ${ticket.log} 80 {% end %} 81 {% if "observaciones_comentarios_mejoras" in ticket %}Observaciones, comentarios y mejoras: 82 $ticket.observaciones_comentarios_mejoras 83 {% end %} 84 </attribute> 85 </additional-attributes> 81 86 }}} 82 87 1. a '''status-map''': maps the status field between Scarab and Trac statuses. 83 {{{ 84 #!xml 85 <status-map> 86 <status id-scarab="Abierto" id-trac="new" /> 87 <status id-scarab='Resuelto' id-trac='closed' /> 88 </status-map> 88 {{{#!xml 89 <status-map> 90 <status id-scarab="Abierto" id-trac="new" /> 91 <status id-scarab='Resuelto' id-trac='closed' /> 92 </status-map> 89 93 }}} 90 1. The scarab2trac.py script should run in a text terminal. 94 1. The scarab2trac.py script should run in a text terminal. With the "-h" parameter it prints the help: 91 95 {{{ 92 96 Usage: scarab2trac.py [options] … … 99 103 100 104 }}} 101 CONF file was explained above. SCARAB file must be a XML file, exported from Scarab (Scarab options: Admin -> Current module -> XML export issues) 102 == Recent Changes == 105 106 The CONF file was explained above. The SCARAB file must be a XML file, exported from Scarab (Scarab options: Admin -> Current module -> XML export issues). 107 108 == Recent Changes 103 109 104 110 [[ChangeLog(scarabtotracscript, 3)]] 105 111 106 == Author/Contributors ==112 == Author/Contributors 107 113 108 114 '''Author:''' [wiki:szaffarano] [[BR]] 115 '''Maintainer:''' [[Maintainer]] [[BR]] 109 116 '''Contributors:'''