kemakorn / support-tools

Automatically exported from code.google.com/p/support-tools
Apache License 2.0
0 stars 0 forks source link

GitHub issue exporter fails on a repo with existing pull requests (issue IDs don't match expected) #90

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'd like to port http://code.google.com/p/ibus to http://github.com/ibus/ibus.

When I run github_issue_converter.py, I got an error.

% python github_issue_converter.py --github_owner_username=ibus \
  --github_repo_name=ibus \
  --issue_file_path=$FILE/GoogleCodeProjectHosting.json \
  --project_name=ibus \
  --github_oauth_token=$TOKEN --rate_limit=false

Traceback (most recent call last):
  File "github_issue_converter.py", line 479, in <module>
    main(sys.argv)
  File "github_issue_converter.py", line 475, in main
    parsed_args.rate_limit)
  File "github_issue_converter.py", line 431, in ExportIssues
    issue_exporter.Start()
  File "support-tools/googlecode-issues-exporter/issues.py",
line 614, in Start
    self._AssertInGoodState()
  File "support-tools/googlecode-issues-exporter/issues.py",
line 683, in _AssertInGoodState
    last_gh_issue_id, last_gh_issue["title"]))
RuntimeError: Unable to find Google Code issue #21 'Fixed a typo in IMdkit.h'.
    Were issues added to GitHub since last export attempt?

It seems the command refers https://github.com/ibus/ibus/pull/21 but ibus has 
no issues.

Original issue reported on code.google.com by takao.fujiwara1 on 1 May 2015 at 10:17

GoogleCodeExporter commented 9 years ago
When the GitHub Issue Exporter starts, it first queries the GitHub project to 
see if it already has any issues. (In case the exporter crashed/failed on a 
previous run.)

That particularly error comes from here:
https://code.google.com/p/support-tools/source/browse/googlecode-issues-exporter
/issues.py#680

It looks like it is trying to find the latest GitHub issue (#21 "fixed a typeo 
in IMdkit.h") in the Google Code issues dump, but not finding it.

This means that a GitHub issue was added since the previous export attempt, 
which would cause all of the issue numbers to be out of sync.

The fact that the project already has no issues is pretty suspicious. Could you 
try running the tool and attaching the entire command-line output as a TEXT 
file to this bug? I'd be curious to see what the rest of the logging out put 
said.

Original comment by chrsm...@google.com on 4 May 2015 at 6:41

GoogleCodeExporter commented 9 years ago
> It looks like it is trying to find the latest GitHub issue (#21 "fixed a 
typeo in IMdkit.h") in the Google Code issues dump, but not finding it.

As I explained, it refers the pull requests 
https://github.com/ibus/ibus/pull/21 instead of issues.

There is no other logging:

% python github_issue_converter.py --github_owner_username=ibus \
  --github_repo_name=ibus \
  --issue_file_path=$JSON_PATH/GoogleCodeProjectHosting.json \
  --project_name=ibus \
  --github_oauth_token=$TOKEN --rate_limit=false
Getting any previously added issues...
Starting issue export for 'ibus'
Existing issues detected for the repo. Likely due to a previous
    run being aborted or killed. Checking consistency...
Traceback (most recent call last):
  File "github_issue_converter.py", line 479, in <module>
    main(sys.argv)
  File "github_issue_converter.py", line 475, in main
    parsed_args.rate_limit)
  File "github_issue_converter.py", line 431, in ExportIssues
    issue_exporter.Start()
  File "googlecode-issues-exporter/issues.py", line 614, in Start
    self._AssertInGoodState()
  File "googlecode-issues-exporter/issues.py", line 683, in _AssertInGoodState
    last_gh_issue_id, last_gh_issue["title"]))
RuntimeError: Unable to find Google Code issue #21 'Fixed a typo in IMdkit.h'.
    Were issues added to GitHub since last export attempt?

Original comment by takao.fujiwara1 on 4 May 2015 at 7:21

GoogleCodeExporter commented 9 years ago
Any status?
I cannot migrate the project to github without this fix.

Original comment by takao.fujiwara1 on 14 May 2015 at 7:02

GoogleCodeExporter commented 9 years ago
Hello, I will take a look at this issue shortly. Unfortunately I have been out 
most of this week sick and dying. Hopefully I can take care of this early next 
week.

Original comment by chrsm...@google.com on 14 May 2015 at 5:03

GoogleCodeExporter commented 9 years ago
I have the same problem. I have a googlecode project used for issues and wiki, 
and a github project used for source code and pull requests. Now I want to 
transfer issues from googlecode to github, but it fails with this error. It 
considers the existing pull requests to be issues and fails a consistency check.

Btw, if there even were some previous issues on github (which I don't have, but 
even if), I would still want this to work for a one-time export. I don't need 
regular syncing, just one-time export is enough (so I don't really care if the 
issue ids match or not - of course, it's better if they do.)

Original comment by kamil.paral on 16 May 2015 at 2:52

GoogleCodeExporter commented 9 years ago
I gotcha, yeah. I didn't know GitHub worked like that. I'll update the tool now 
that I know that :P

Original comment by chrsm...@google.com on 19 May 2015 at 12:39

GoogleCodeExporter commented 9 years ago
I removed the invariant that issue IDs match between Google Code and GitHub, 
which had the nice side effect of greatly simplifying the code. If you sync and 
try your issue export again it should work. If you run into any problems let me 
know.

Original comment by chrsm...@google.com on 20 May 2015 at 12:18

GoogleCodeExporter commented 9 years ago
Thanks a lot, it works now. 

Unrelated to this, every 50 issues or so, I got temporarily banned:

Content:
{u'documentation_url': u'https://developer.github.com/v3#abuse-rate-limits', 
u'message': u'You have triggered an abuse detection mechanism and have been 
temporarily blocked from content creation. Please retry your request again 
later.'}

But I haven't had that many issues to transfer, so I don't mind.

Original comment by kamil.paral on 24 May 2015 at 5:50