[x]
):Please add support for importing issues from Bugzilla.
Note that Bugzilla is often used to track issues for many different projects in one place, whereas Gitea/GitHub-style issue tracking has a separate issue tracker for each project. A Gitea importer would need to be able to select which Bugzilla “product” to import issues for.
It would also be preferable if Gitea could import from Bugzilla XML output, without contacting a Bugzilla instance directly. That way, Gitea won't need to deal with authenticating itself to Bugzilla, which may require a client certificate, Kerberos/Active Directory ticket, or the like.
I think this would be pretty low priority if being honest, as most migrations are centered around github at the moment (and in the future probably similar services with similar APIs).
If you are looking to do this yourself, you could probably try and script it from the BugZilla XML export. This is an older script that took data from BugZilla and put it into Github.
https://github.com/erikmd/github-issues-import-api-tools/blob/master/attic/bugzilla2github
And perhaps some more information here:
https://www.theozimmermann.net/2017/10/bugzilla-to-github/
As a starting point for how somebody else did something similar
@mrsdizzie I can indeed do that, except that there's currently no way in the API to preserve the issue numbers, and @lunny thinks it would be a bad idea to add a way, because issue migration should be built into Gitea instead. That's why I opened this issue.
As you say, Gitea's migration code seems designed for migrating Git repositories and associated data from GitHub-like sites. It would need a pretty major redesign to handle migrating anything else, such as issues from a separate issue tracker like Bugzilla. That's why I posted #7790: it would be a much simpler change, and allow people like me to write external issue-migration tools without having to make such drastic changes to Gitea itself.
With you apparently disagreeing with @lunny, I'm now at a loss as to what to do. Should I insert issues through Gitea's API and then change the issue numbers (with UPDATE issue SET `index` = ? WHERE `id` = ?
) in the database directly? That seems to work, but will it break anything?
I don't disagree with Lunny or have any particular opinion other than I wouldn't expect somebody else to add this migration code to Gitea anytime soon if you were hoping the issue would result in that.
Given that I was just pointing to a script of somebody who did something similar with Github which has the same limitations on not allowing setting an issue number via API.
Have you checked the "external issue tracker" option? I don't know what it does, but sounds interesting:
(Available at Repository Settings)
@mrsdizzie Ok, fair enough. Would you happen to know if changing the issue numbers in the database after they're created (with the API) will break anything?
@guillep2k Yes, I saw that. That is an option, but I was hoping to migrate the issues into Gitea, because Bugzilla is rather slow and much less user-friendly than Gitea.
@mrsdizzie Ok, fair enough. Would you happen to know if changing the issue numbers in the database after they're created (with the API) will break anything?
@argv-minus-one You need to update all the other related tables (attachment
, issue_assignees
, issue_watch
, issue_dependency
, issue_user
, reaction
, stopwatch
, tracked_time
, pull
, review
) to reflect the changes. But you'll probably have no rows in many of them if you've just created the issues. Disclaimer: I've just made a crude search through the source code to get the list; it may not be complete.
@argv-minus-one Two things:
@jpicht
- Do you have an example of a Bugzilla XML file?
Here's one from Mozilla's Bugzilla instance.
Here's the XML DTD from Mozilla's Bugzilla instance. Note that the DTD varies from instance to instance, because it reflects whatever custom fields are configured in the Bugzilla instance. Here's a Gist containing the DTD from my Bugzilla instance, which doesn't have any custom fields configured.
- Would it be useful solution for you to only be able to import the XML while also importing the repository via migrations?
Yes.
I'd prefer to be able to upload the XML from my browser, instead of Gitea pulling it directly from a running Bugzilla instance, for two reasons:
I need to edit the comments in Bugzilla. Besides Bugzilla, I am also preparing to migrate from Mercurial to Git, and some of the comments in Bugzilla talk about Mercurial commit identifiers. These need to be rewritten to the corresponding Git commit identifiers, and the simplest way to do that is by editing the XML before handing it off to Gitea.
In my Bugzilla instance, user names are email addresses, and that's what appears in the XML. I need to rewrite them to Gitea user names. Again, the simplest way to do that is by editing the XML.
In the longer term, it would be ideal if Gitea could migrate issues (and perhaps other kinds of data) into existing repositories as well. However, I understand that Gitea's current design doesn't allow for this.
Most helpful comment
@jpicht
Here's one from Mozilla's Bugzilla instance.
Here's the XML DTD from Mozilla's Bugzilla instance. Note that the DTD varies from instance to instance, because it reflects whatever custom fields are configured in the Bugzilla instance. Here's a Gist containing the DTD from my Bugzilla instance, which doesn't have any custom fields configured.
Yes.
I'd prefer to be able to upload the XML from my browser, instead of Gitea pulling it directly from a running Bugzilla instance, for two reasons:
I need to edit the comments in Bugzilla. Besides Bugzilla, I am also preparing to migrate from Mercurial to Git, and some of the comments in Bugzilla talk about Mercurial commit identifiers. These need to be rewritten to the corresponding Git commit identifiers, and the simplest way to do that is by editing the XML before handing it off to Gitea.
In my Bugzilla instance, user names are email addresses, and that's what appears in the XML. I need to rewrite them to Gitea user names. Again, the simplest way to do that is by editing the XML.
In the longer term, it would be ideal if Gitea could migrate issues (and perhaps other kinds of data) into existing repositories as well. However, I understand that Gitea's current design doesn't allow for this.