File | Date | Author | Commit |
---|---|---|---|
bin | 2020-11-27 | Ralf Schlatterbeck | [4ef281] Header processing |
config-example | 2023-01-19 | Ralf Schlatterbeck | [51eb48] Add docs for pkcs12 feature |
trackersync | 2023-01-20 | Ralf Schlatterbeck | [71db57] Fix SupplierResponse.Status |
.gitignore | 2021-11-30 | Ralf Schlatterbeck | [fcce64] Encountered an unknown schema entry type |
MANIFEST.in | 2015-04-13 | Ralf Schlatterbeck | [acacb1] Release preparation, Docs |
Makefile | 2019-03-01 | Ralf Schlatterbeck | [4a47f6] Release preparation |
README.rst | 2023-01-20 | Ralf Schlatterbeck | [1ff555] README update, minor corrections |
mendelson.diff | 2019-03-01 | Ralf Schlatterbeck | [4a47f6] Release preparation |
setup.py | 2020-11-04 | Ralf Schlatterbeck | [949ba1] Fix install of scripts |
Author: | Ralf Schlatterbeck <rsc@runtux.com> |
---|
When running an issue tracker – e.g. for tracking bugs and feature requests of a software project – sooner or later the requirement arises that you want to synchronize certain issues with an external issue tracker.
External issue trackers might be run by an external open source project where you're monitoring certain issues because bugs you're tracking locally depend on fixes of the remote project. Or you're a company tracking issues of their customers – the customer may run their own issue tracker and certain issues in the customer's tracker are for you.
In particular this is widespread in the automotive industry: Suppliers are expected to synchronize their bug-trackers with the bug-tracker of the OEM they're working for. For an individual supplier usually more than one OEM-tracker needs to be kept in sync.
This project solves this requirement. Currently the local issue tracker (the one you are running) is limited to roundup, an open source issue tracker or jira a well-known commercial offering. For the remote tracker we're currently supporting KPMweb, the issue tracker run by VW/Audi with access for their suppliers – if you're one of them you know how to access it. Another OEM from the automotive industry is now supported: The tracker run by Porsche named PFIFF. Other remote trackers are currently being implemented, notably support for jira. This is not to be confused with the local tracker you are running: Jira is well-supported as the local tracker. Jira as the remote tracker, however, is work in progress.
This section applies only when you're running roundup. For synchronisation with external trackers you need to add a new Class and several attributes to your roundup instance. We need a new ext_tracker Class:
ext_tracker = Class(db, "ext_tracker", name = String (indexme = 'no') , description = String (indexme = 'no') , url_template = String (indexme = 'no')) ext_tracker.setkey("name")
This Class tracks information about external trackers. If two-way message synchronisation should be used an additional class is needed for keeping track of the message-ids in the remote system:
ext_msg = Class(db, "ext_msg", ext_tracker = Link ("ext_tracker") , msg = Link ("msg") , ext_id = String (indexme = 'no') , key = String (indexme = 'no') ) ext_msg.setkey("key")
Now we need to add some attributes to the issue class for keeping information about the external tracker:
... , ext_id = String () , ext_status = String () , ext_attributes = Link ("msg") , ext_tracker = Link ("ext_tracker") ...
These attributes are needed for keeping track of the status of the remote issue. In particular the ext_id tracks a unique identifier of the remote issue. The ext_attributes track all attributes of the remote issue as a json dictionary. If you want to display these attributes in your issue, it makes sense to extend the html templates html/issue.item.html and html/issue.index.html in your tracker directory.
To configure the synchronisation you can find example configuration files in the config-example subdirectory. Configuration files are in python syntax and should end in .py. The attributes to synchronize need to be defined. Property definitions typically define the attribute name on the remote side and on the local (roundup or jira) side. For both, roundup and jira, property names can include dots (".") indicating dereferencing an item, e.g., "prio.description" would dereference a Link property "prio" and return the value of the property "description" of this prio. In addition there is a syntax in roundup for Link1-properties: These are not stored in the roundup-issue itself but link to the roundup issue with a Link property named "issue". The sync framework makes sure that at most one such link exists per issue. The syntax for these properties is "/<classname>/property" where property can again be a multilevel property including dots. The classname is the name of the Link1 class and the item linking to the currently-synchronized issue is determined by searching the class for items where the "issue" property refers to the current issue.
The following attribute definitions are possible:
In addition to the synchronized attributes, the URL of the local tracker (which depending on the backend might include user name and password) needs to be specified in the configuration file with the variable LOCAL_URL. If the username and password are not included in that url, they need to be specified with the config items LOCAL_USERNAME and LOCAL_PASSWORD. The type of local tracker needs to be selected with LOCAL_TRACKER.
The KPMweb user name and the mailbox address of the supplier in KPMweb (used as a search term, also called organisational unit) can be specified in the configuration file with the options KPM_USERNAME and KPM_OU. In addition the KPM_PLANT needs to be given, in the default config this is a testing-area named Z$. These options can also be set on the command line. If they are specified in both, the configuration file and on the command line, the command line wins.
The configuration file for the KPMweb synchronisation typically lives in /etc/trackersync/kpm_config.py but can be overridden on the command line. The configuration file for the Jira synchronisation backend lives in the same directory by default.
For accessing KPM, a client certificate and a key are needed. By default these are in PEM format in the directory /etc/trackersync, the private key in the file kpm_certificate.key and the certificate in the file kpm_certificate.pem. The config items KPM_CERTPATH and KPM_KEYPATH can be used to change the location and filename of certificate and key file.
If you got certificate and key in a PKCS12 bundle, there is now experimental support for directly using the .pkcs12 file (without having to convert it to PEM format): Set the configuration variable KPM_PKCS12_PATH to the location of the file and optionally set KPM_PKCS12_PASSWORD to the password of the file if it is password protected. This overrides the KPM_CERTPATH and KPM_KEYPATH settings which are not used when a PKCS12 file is in use. For the PKCS12 support you need to install the requests-pkcs12 python package:
pip install requests-pkcs12
For Porsche PFIFF you need to set up an OFTP connection to the OEM. The Open Source OFTP Server from Mendelson was used successfully, albeit with a patch: The server does not support specification of a virtual OFTP file name for each transfer, instead for each poll request a filename can be specified. For ENGDAT specification of the file name is necessary. The patch can be found in the file mendelson.diff. Note that the patch has no checking if the filename of the spool-file conforms to the requirements of OFTP (which supports only uppercase characters, numbers, and a dash plus some other less-used characters). A better implementation would have more checking. The patch was also posted to the Mendelson Forum, you may want to check with them if this feature will make it into a future version. They also have a commercial version, so they may reserve such a feature for a commercial offering as one user on the forum suggested.
The sync uses ENGDAT v2 packages as input. These consist of a description file in EDIFACT syntax plus a ZIP file with the synchronisation data. For output again an ENGDAT v2 package is produced. In addition for testing a -z option exists that can specify a ZIP file as input for the sync. An example configuration using ENGDAT can be found in config-examples/pfiff_jira_config.py.
My latest information indicates that Porsche may be in the process of moving to KPMweb (see above) for tracking newer projects, you may want to find out with your Porsche contact if this is the case for your project.
Download the source at https://sourceforge.net/projects/trackersync/ or https://github.com/schlatterbeck/trackersync and install using the standard python setup, e.g.:
python setup.py install --prefix=/usr/local
Alternatively you may want to install using pip:
pip install trackersync
Version 1.5: Pfiff Sync
Now Porsche Pfiff is supported. You need an OFTP-Server for the actual data transfer. We transfer data from/to the OFTP server (which can be either local or accessed via SSH/SFTP). We also create an ENGDAT v2 package.
Version 1.4: Jira as local tracker
Now we can sync between Jira as the local tracker and KPM as the remote tracker.
Version 1.3: Two-way KPM sync
We now can sync changed attributes back to KPM
Version 1.2: KPM data structures in roundup
Now we can model some of the KPM data structures in roundup.
Version 1.1: Implemented Jira synchronisation
Jira synchronisation is implemented, this needs a recent version of the python requests library installed. In some new sync attributes have been implemented, in particular two-way synchronisation. Two-way synchronisation is now also supported for messages and files.
- Jira synchronisation
- Two-way sync for atomic attributes
- Two-way sync for messages and files
- Standalone command-line tools for KPM and Jira sync
Version 1.0: Initial Release with kpmsync
Tool for Synchronisation of Issue Trackers
- First Release version