Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dry-run crashes in milestone code #108

Open
ThomasWaldmann opened this issue Aug 17, 2018 · 1 comment
Open

dry-run crashes in milestone code #108

ThomasWaldmann opened this issue Aug 17, 2018 · 1 comment

Comments

@ThomasWaldmann
Copy link
Contributor

getting issues from bitbucket
done, loaded 579 issues
Traceback (most recent call last):
  File "migrate.py", line 741, in <module>
    sys.exit(main(options))
  File "migrate.py", line 214, in main
    gh_issue = convert_issue(issue, options, attach_names, gh_milestones)
  File "migrate.py", line 393, in convert_issue
    out['milestone'] = gh_milestones.ensure(milestone_title)
  File "migrate.py", line 655, in ensure
    number = self.create(title)
  File "migrate.py", line 664, in create
    respo.status_code))
RuntimeError: Failed to get milestones due to HTTP status code: 404
@jeffwidman
Copy link
Owner

Valid bug.

I sat down thinking this would be a five-minute fix, but turns out its a bit more complicated, so writing down my notes and will look at more in depth later:

  1. There's a mismatch because GithubMilestones creates the milestone in GitHub as soon as its fetched from Bitbucket. Versus all the other code assembles the issues/comments, but doesn't actually push to GitHub until main() calls push_github_issue()...
  2. So may need to split out the milestone fetch from the milestone creation... but this is tricky because the issues need to know their attached milestone numbers. So if we do this at the end, then we'd have to additionally re-convert bitbucket milestone titles to github milestone numbers at the end.
  3. alternatively, could add a hook in GithubMilestones.ensure() to catch whether options.dry_run is set
  4. However, GithubMilestones currently has no knowledge of options and changing that feels like its letting abstractions leak resulting in overly tight coupling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants