Browse files

Merge from dnschur

  • Loading branch information...
2 parents 150d630 + 1e850d1 commit db9b0c5d15a691b53f500c8766d7f8557169f598 @joelpt joelpt committed Oct 14, 2012
Showing with 376 additions and 96 deletions.
  1. +50 −0
  2. +57 −12
  3. +269 −84
@@ -0,0 +1,50 @@
+This is a change-history and list of contributors to the script.
+## Even newer version by David Schnur ##
+### New Features ###
+ - Greatly optimized Github API usage, allowing the script to process several times as
+ many issues before reaching the API's hourly rate-limit.
+ - The script now tries to avoid hitting the Github API's rate-limit part-way through
+ processing an issue, to avoid leaving it in an incomplete state.
+ - Improved support of duplicate / merged issues, by detecting the 'merged into' update
+ and generating a Github comment pointing to the parent issue. The automatically-added
+ 'issue x is a duplicate of this issue' comments are now filtered out, since Github
+ already shows a reference when the duplicate links back to the parent.
+ - Added migration of Google Code statuses like 'invalid', 'wontfix' and 'duplicate';
+ these now map to the matching Github tags.
+ - The script now accepts Github projects in the form user/project, where user can be an
+ organization or a different user from the one running the script. This still requires
+ that the user running the script have enough permissions on the repository, of course.
+ - Added an option to keep issue numbers in sync, by handling cases where Google Code
+ skipped an issue number.
+ - New issues are now marked closed after all comments have been added, to better mimic
+ the order of that update in most real-world cases.
+ - Added an option to automatically assign issues that have an owner in Google Code.
+ - Added an option to omit migration of Google Code Priority labels.
+### Bug Fixes ###
+ - Comments containing percent-signs are no longer added repeatedly when the script is run
+ multiple times.
+## Newer version by Jake Biesinger ##
+ - Switched to PyGithub in order to support the Github v3 API.
+## Original version by Arthur Debert (and many other contributors) ##
@@ -1,24 +1,69 @@
-This is a simple script to move issues from google code to github.
+This is a simple script to migrate issues from Google Code to Github.
-Some liberties have been taken (as we cannot, for example, know which google user corresponds to other user on github). But most information is complete.
+For a full history of changes, including the many additions found in this fork, please
+consult the [change log](
-This script can be run repeatedly and will just pull in new issues and new comments from Google Code without mucking up what's already on github.
+### How it works ###
-Required Python libraries:
+The script iterates over the issues and comments in a Google Code repository, creating
+matching issues and comments in Github. This has some limitations:
+ - All migrated issues and comments are authored by the user running the script, and lose
+ their original creation date. We try to mitigate this by adding a non-obtrusive header
+ to each issue and comment stating the original author and creation date.
+ - Attachments are lost, since Github doesn't support them in issues or comments.
+Otherwise almost everything is preserved, including labels, issue state (open/closed),
+issue status (invalid, wontfix, duplicate) and merged-into links for duplicate issues.
+The script can be run repeatedly to migrate new issues and comments, without mucking up
+what's already on Github.
+### Required Python libraries ###
* [gdata]( -- `pip install gdata`
* [PyGithub]( -- `pip install PyGithub`
+Note that you must use version 1.8.0 or greater of PyGithub. This is due to a limitation
+in Github's API that results in a 500 error if clients try to submit a string containing a
+percent-sign. Earlier versions of this script worked around the problem by escaping the
+symbol, but this caused further problems by making it more difficult to correlate original
+Google Code issues with their migrated copies.
+We removed the script's escaping once PyGithub introduced a work-around for the problem,
+which was first included in their 1.8.0 release.
- [options] <google_project_name> <github_user_name> <github_project>
+### Usage ###
- google_project_name The project name (from the URL) from google code
- github_user_name The Github username
- github_project The Github project name, e.g. username/project
+ [options] <google project name> <github username> <github project>
+ google_project_name The project name (from the URL) from google code
+ github_user_name The Github username
+ github_project The Github project name, e.g. username/project
- -h, --help show this help message and exit
- -d, --dry-run don't modify anything on Github
+ -h, --help show this help message and exit
+ -a, --assign-owner Assign owned issues to the Github user
+ -d, --dry-run Don't modify anything on Github
+ -p, --omit-priority Don't migrate priority labels
+ -s, --synchronize-ids Ensure that migrated issues keep the same ID
+ You will be prompted for your github password.
+--assign-owner automatically assigns any issues that currently have an owner to your
+Github user (the one running the script), even if you weren't the origina lowner. This
+is used to save a little time in cases where you do in fact own most issues.
+--dry-run does as much as possible without actually adding anything to Github. It's
+useful as a test, to turn up any errors or unexpected behaviors before you run the script,
+irreversibly, on your real repository.
+--omit-priorities skips migration of Google Code Priority labels, since many projects
+don't actually use them, and would just remove them from Github anyway.
- You will be prompted for your github password.
+--synchronize-ids attempts to ensure that every Github issue gets the same ID as its
+original Google Code issue. Normally this happens anyway, but in some cases Google Code
+skips issue numbers; this option fills the gaps with dummy issues to ensure that the next
+real issue keeps the same numbering. This only works, of course, if the migration starts
+with a fresh Github repistory.
Oops, something went wrong.

0 comments on commit db9b0c5

Please sign in to comment.