将mantisbt问题迁移到xml

mantis2xml的Python项目详细描述


mantis2xml旨在简化从mantisbt问题到其他问题的迁移 问题管理系统。它生成一个可以转换的xml文件 到其他格式,然后由问题管理系统导入。

目前,只支持迁移到launchpad bug。特别地, 提供了一个.xlst文件和一个shell脚本,以便迁移过程 启动pad bug的问题大大简化。

注意

您可能还对此感兴趣:Launchpad Export plugin for Mantis

急躁者快速指南

创建一个名为~/.mantis2xml的文件,其中包含mantis实例的url、具有managermantis访问权限的用户的用户名和密码。例如:

[mantis]
url: http://mantis.example.com/
user: scott
password: beam-me-up

安装xsltprocjing,如下所示,用于debian和衍生物:

$ apt-get install xsltproc jing tar bzip2 -y

安装bazaar并从launchpad获得mantis2xml:

$ apt-get install bzr -y
$ bzr branch lp:mantis2xml

安装mantis2xml,以确保安装了所有依赖项:

$ cd mantis2xml
$ python setup.py install

现在运行转换螳螂实例的shell脚本:

$ ./dump_all_issues.sh

如果在错误跟踪系统中只有一个项目,则 上面的命令可能就是你所需要的。如果你有不止一个 项目在mantis中,请查看文件dump_all_issues.sh 按照上面解释的步骤。

如果一切顺利,您将看到在 ~/tmp/mantis/1目录:

$ ls -al ~/tmp/mantis/1
issues.txt
issues.mantis.xml
issues.launchpad.xml
issues.launchpad.xml.tar.bz2
  • ^{tt7}$ : brief summary of issues
  • ^{tt8}$ : dump of all issues as they were obtained from MantisBT
  • ^{tt9}$ : issues transformed for being imported by Launchpad Bugs
  • ^{tt10}$ : created after validation succeeds

故障排除

如果看不到issues.launchpad.xml.tar.bz2,则表示 issues.launchpad.xml失败。错误会在标准输出中报告,但是 您可以再次看到他们输入以下命令:

$ jing -c ./bug-export.rnc ~/tmp/mantis/1/issues.launchpad.xml

最常见的问题可能与重复的问题有关。螳螂 支持问题之间的多种关系,包括 duplicated of(对于重复项)而launchpad bug支持零个或一个重复项 每期发行。如果你遇到这个麻烦,你可以用手把它修好。 issues.launchpad.xml文件或在mantis中修复它,确保您拥有零或 每个问题一个重复的问题,然后重新运行dump-all-issues.sh

将螳螂映射到启动板错误

螳螂提供字段步骤来复制没有直接 LaunchPad Bug中的对应项。此外,mantis还提供了问题之间的详细关系,如:

  • duplicate of
  • has duplicate
  • child of
  • parent of
  • related to

允许多次出现。launchpad bug只支持duplicate of,它可以 出现零次或一次。不支持所有其他关系。为了适应这些 不同之处在于,这些字段包含在launchpad bugs中的字段bug description中。

其他信息:

对Mantis2xml的贡献

mantis2xml的开发非常仓促,仅用了几天时间,其中包括这篇文档,它花费的时间比人们想象的要多。有已知的缺陷,显然还有很大的改进空间。

不幸的是,{a7}没有考虑mantis2xml的进一步开发。如果你考虑接手这个项目,作者会很高兴把代币给你。

下面您将看到一些可能与此相关的信息:

简史

此应用程序派生自sp-mantis2github,这是一个python脚本 它通过soap与mantisbt通信,并通过api与github通信。这个 应用程序做得非常好,不仅能够 将问题迁移到github,但它也会在mantis中插入注释 到github中新创建的问题。

设计决策

简单的概念证明已经完成:我试图删除对包^{tt16}的调用$ 并通过调用packagelaunchpadlib替换这些调用。由于方式 ^{甲编写了8},用一个api替换另一个api api不是一个简单的任务。这个想法被证明是“太过分了”,因为 我为执行我迫切需要的迁移预留的时间很少。

所以,我只是从github中删除了依赖项,并假设我们有足够的 对XML文件感到满意,可以稍后将其转换为 Launchpad Bugs Import Format。以下是我所采取的步骤:

  • remove dependencies from Github API. This was done either removing some code or changing function/method names so that they are never called.
  • obtain the XML representation from SOAP responses which provide objects ^{tt18}$. This is what happens when command mantis dump issue is entered, which causes the issue to be dumped to the standard output as an XML.
  • get rid of namespaces when the aforementioned XML representation is obtained. This expedient eases a lot the creation of the .XLST file which post-processes the .XML produced.
  • the process of converting the XML to Launchpad Bugs Import Format is provided via a shell script, as explained above. I’ve actually tried to automate in Python what is currently being done in the shell script, but it crashes after some 40 issues or so are dumped. No: I’m not willing to discover why it fails. Then I simply removed the logic and kept the shell script.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java嵌套循环打印一个数字,旁边有相同数量的星号   java JodReports替代方案   java如何将模型类parcelable对象从片段传递到活动?   java JCS缓存删除功能不删除特定元素   如何打开。Java的dll文件。   java在这种情况下如何选择聚合根?   java从CellEditorListener获取编辑的TreeNode   Java到web服务和mysql   从openssl ec在Java中创建公钥时出现加密无效密钥异常   Java数组:添加多个数组的元素时忽略空数组   java在初始化后向fragment发送数据   JButtons的java数组正在返回void   若联接列不包含特定值,则java JPA条件生成器仅返回实体   java ActionBar问题:NPE   java Portlet是被广泛使用还是非常罕见?