We use Trac for an open-source project I'm working on. I'd like to export all of our open tickets to Github's Issues. I've found a couple small scripts that might do it, but I was wondering if anyone has done this and has suggestions.
Ideally, it would convert trac's description syntax to markdown and also export metadata like milestone information, but even a simple, working export is probably okay.
https://github.com/trustmaster/trac2github looks like it might work well, covering milestones, tickets, comments, converting usernames and setting assignees.
I exported ticket details to a CSV file using a Trac query and converted them to Github issues using PyGithub. You can find the Python script and Trac query at http://pypi.python.org/pypi/tratihubis/.
The advantage of the CSV approach is that you do not need direct access to the database and it works with any database because all you need is a Trac query. Furthermore you can manually cleanup the CSV before import and e.g. remove tickets you do not want to convert to issues.
Thanks to PyGithub, all this works with Github API v3. API v2 has been deprecated, so some older scripts doing the same might not work anymore.
You can try my trac2github PHP script, which moves only tickets, trying to preserve formatting and order of comments.
I've also written a small utility trac-hub that does the job: http://mavam.github.io/trac-hub.
It uses octokit to access github's API and sequel to interface to trac's database. As a result, it's fairly easy to adapt to your trac installation.
I recently needed to do this without having direct database access for the Trac server and wrote a Python script which uses Trac's XML-RPC interface:
https://github.com/acdha/migrate-trac-issues-to-github
It makes some attempts to preserve user assignments, convert Trac markup in the ticket description and comments, migrate commit links, rewrite ticket references to the corresponding Github issue numbers, and preserve the original Trac data for searches.
Related
This might be a basic github question, but I'm having trouble finding the right keywords to google because I don't know the terminology. Apologies and thanks in advance.
I've noticed with library dependencies in library.json, under "dependencies", there is often a github remote repo link with a version number after the #
For example
https://github.com/codewitch-honey-crisis/htcw_ili9341.git#1.0.0"
What is that exactly after the #? A branch? A release?
More importantly, how do I make my github repo expose these. Like, I want to make a 1.0.0 one now for htcw_ili9341.git but later I may want to make 1.0.1
Using the github website, and/or the command line, how do I go about this?
It would be really helpful if you explained as you went as well.
So you know where I'm coming from with this, I've been using github for awhile but only for the most basic things, and driving it all through VS Code for the most part, sometimes resorting to the web interface and only occasionally dropping to the command line, which I've done a handful of times to resolve merge conflicts. I'm not an expert, but not completely new to it either.
anything after # is never posted to the server. It's basically a comment in this specific instance.
Is there a way to easily search for / list template repositories on Github?
Templates are quite interesting because they allow to create a new project from a, well, template without having to get all the history with it.
An example with Spring Boot : https://github.com/Spring-Boot-Framework/Spring-Boot-Application-Template.
I tried the usual search on Github itself but using the "template" query doesn't give any meaningful results because many repositories use the "template" string without the actual Github meaning. I couldn't find any way to tag those repos either.
Even the API search page doesn't seem to include proper qualifiers for template repositories.
That leaves me to wonder how they can actually become useful since the discoverability is so low at the moment.
Thanks!
Got an answer from Github support yesterday. As of now, it is not possible.
Hi Julien,
Thank you for writing to GitHub Support.
If I understand you correctly, you want a way to search for repositories but only show template repositories.
If so, then, unfortunately such functionality does not exist. If you want, I can pass this ticket to our product team which reads and evaluates feedback about our products.
Regards,
Paul
GitHub Support
I create a repository on GitHub. And I wan't create a issue label Linux, but I input wrong as linux, Now, I wan't change it or delete it, what should I do?
Note: I need to delete a label from all issue not only a single issue issue.
I would suggest to do it via the REST API of GitHub. How to work with lables and issues is documented in the section Lables of the REST API documentation.
You can create the new label manually or also via REST, add the new label to all affected issues and delete the old label. Doing it via the REST API might be the best way if a lot of issues must be changed.
You can also consider to script it via Ruby or JavaScript if you don't want to deal directly via the commandline with the API.
At the first glance it looks like a lot of effort, but it is worth it as you will discover a new and very helpful way to manage your repositories.
The Github gists feature is interesting to me because it provides a facility to publish things that are of interest but may not rate a new repo, like snippets of useful code. I would like to follow a user's gists and know when a new gist is published, but I see no way to do that in the web user interface. Is this possible?
Yes, this can be done, but you have to use the combination of the Github Gist API and a bit of coding. One example of how to do this is here, using Python. This utility lets you query a Github user's gists, and creates a small file with the timestamp of the latest gist. When you run the query again it checks to see if there are any newer gists and lets you know, then updates the file with the new timestamp.
How can I easily backup & restore bugtracker of project on Github? Repository itself is obvious, wiki is also a git repository - but what about bugtracker?
I want to fully backup bugtracker (tickets, attached imaged, labels, comments, images attached in comments, dates of creation and closing of tickets etc) with ability to recreate it on github account.
Saving it as editable format would be a good bonus.
I am aware about Github API and that I can make tool like this. But I would prefer to use (optionally improve) existing one.
Existing ones mainly export the issue text, not always their attachments.
github-issues-export
github-to-bitbucket-issues-migration
Those services could be extended with the issue API to export more.
A more complete service is backhub.co, which exports a bit more (but isn't as easily expendable). It is free for public repos.
Update August 2018: vorburger adds in the comments a direct link example of how to use the GitHub Issues API to obtain all comments from a particular issue:
https://api.github.com/repos/JDKMissionControl/jmc/issues/1/comments