Changes between Version 1 and Version 2 of ScarabToTracScript


Ignore:
Timestamp:
Sep 24, 2009 3:12:50 PM (5 years ago)
Author:
szaffarano
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ScarabToTracScript

    v1 v2  
    33== Description == 
    44 
    5 script that migrates [http://scarab.tigris.org/ Scarab] issues to Trac tickets 
     5Script that migrates [http://scarab.tigris.org/ Scarab] issues to Trac tickets 
    66 
    77== Bugs/Feature Requests ==  
     
    2323== Example == 
    2424 
    25 It should have installed the [http://trac-hacks.org/wiki/XmlRpcPlugin XmlRpcPlugin] because updates are done through it. 
     25You should have installed the [http://trac-hacks.org/wiki/XmlRpcPlugin XmlRpcPlugin] because updates are done through it. 
    2626 
     27 1. Modify the configuration file, import-configuration.sample.xml. There are several sections: 
     28   1. Common: common stuff.  '''scarab-attachments-path''' should be the path where the attachment are Scarab 
     29{{{ 
     30#!xml 
     31    <common> 
     32        <trac-xmlrpc-url>http://any-host-to-trac/projects/a-project/login/xmlrpc</trac-xmlrpc-url> 
     33        <scarab-attachments-path>/tmp/scarab/attch_scarab</scarab-attachments-path> 
     34    </common> 
     35}}} 
     36   1. Mappings between scarab users and trac users 
     37{{{ 
     38#!xml 
     39<users-map> 
     40   <user id-scarab="scarab-userA" id-trac="trac-userA" /> 
     41   <user id-scarab="scarab-userA" id-trac="trac-userB" /> 
     42</users-map> 
     43}}} 
     44   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''' tag indicates that before setting the value of these field there will be a Genshi transformation, using as context all fields (including those marked with ignore = true) 
     45{{{ 
     46#!xml 
     47    <global-attributes-map> 
     48        <attribute id-scarab="Para" id-trac="owner" /> 
     49        <attribute id-scarab="CC" id-trac="cc" ignore="true"/> 
     50        <attribute id-scarab="Caso de Test" id-trac="summary"> 
     51            <transformation>$ticket.summary [Issue Scarab $ticket.id]</transformation> 
     52        </attribute> 
     53    </global-attributes-map> 
     54}}} 
     55   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. 
     56{{{ 
     57#!xml 
     58    <scarab-artifact type="Reporte Error QA" ticket-type="Defecto"> 
     59        <attributes-map> 
     60           <!-- equal to globalattributes-map --> 
     61        </attributes-map> 
    2762 
     63        <additional-attributes> 
     64            <attribute id="description"> 
     65                Ticket importado desde Scarab, ID = ${ticket.id} 
     66                {% if "descripcion_scarab" in ticket %}${ticket.descripcion_scarab}{% end %} 
     67                {% if "log" in ticket %}Log: 
     68                   ${ticket.log} 
     69                {% end %} 
     70                {% if "observaciones_comentarios_mejoras" in ticket %}Observaciones, comentarios y mejoras: 
     71                   $ticket.observaciones_comentarios_mejoras 
     72                {% end %} 
     73            </attribute> 
     74        </additional-attributes> 
     75}}} 
     76   1. a '''status-map''': maps the status field between Scarab and Trac statuses. 
     77{{{ 
     78#!xml 
     79    <status-map> 
     80        <status id-scarab="Abierto" id-trac="new" /> 
     81        <status id-scarab='Resuelto' id-trac='closed' /> 
     82    </status-map> 
     83}}} 
     84 1. The scarab2trac.py script should run in a text terminal.  With the "-h" parameter it prints the help: 
     85{{{ 
     86Usage: scarab2trac.py [options] 
    2887 
     88Options: 
     89  -h, --help            show this help message and exit 
     90  -c CONF, --conf=CONF  Archivo de configuracion 
     91  -s SCARAB, --scarab-issues=SCARAB 
     92                        Archivo con los issues exportados desde Scarab 
     93 
     94}}} 
     95 CONF file was explained above.  SCARAB file must be a XML file, exported from Scarab (Scarab options: Admin -> Current module -> XML export issues) 
    2996== Recent Changes == 
    3097