Giter Site home page Giter Site logo

Comments (11)

jaraco avatar jaraco commented on June 14, 2024 3

I encountered this issue today attempting to migrate CherryPy with a missing issue.

from bitbucket-issue-migration.

jeffwidman avatar jeffwidman commented on June 14, 2024

This is a legit problem--example: https://bitbucket.org/zzzeek/sqlalchemy/issues/2479

from bitbucket-issue-migration.

jeffwidman avatar jeffwidman commented on June 14, 2024

Added a test to catch this in 0dc1824

from bitbucket-issue-migration.

jeffwidman avatar jeffwidman commented on June 14, 2024

As noted in #70 (comment), can't just use track the offset here for fix_links() because of the following scenario:

  1. issue 1 created
  2. issue 2 created
  3. issue 3 created, and then issue 1 edited to include a reference to issue 3.
  4. issue 2 deleted.

If I just track an offset, when the link in issue 1 to issue 3 is converted, the way the script is currently written means it won't be aware of the offset created by issue 2 being deleted. Could do a mapping, but that feels a bit overblown.

So probably the most pragmatic solution is still to insert blank placeholder issue.

from bitbucket-issue-migration.

mithrandi avatar mithrandi commented on June 14, 2024

I just wanted to point out that it's possible for issues to be non-contiguous even if no issues were deleted; for example, when we originally migrated from Launchpad to BitBucket, we kept the Launchpad bug numbers for everything. Since Launchpad bug numbers are global (a single bug can be associated with multiple projects), our bug numbers start at a high number (#433605), and have lots and lots of holes (latest issue is #1228543).

from bitbucket-issue-migration.

jeffwidman avatar jeffwidman commented on June 14, 2024

@mithrandi thanks, I was ignorant of that--definitely affects the proposed solution here. Likely I'll need to instead just make the link converter function optional, so that it can be disabled for these scenarios.

Did Bitbucket support specifying the issue ID when you imported over from Launchpad?

from bitbucket-issue-migration.

mithrandi avatar mithrandi commented on June 14, 2024

It's been a while since we did the migration to BitBucket (and I can't find the script we wrote to do it), but I believe it was done by preparing the data in a suitable format for the Import/Export feature, documented here. I don't think you can create an issue through the API with an arbitrary issue ID, but you can specify it in the import data.

By the looks of things, the GitHub issues import API does not support this, and creating hundreds of thousands of placeholder issues is obviously not a great idea. Perhaps they would add it if we ask nicely? On the other hand, at least in our particular case, we probably don't care too much about keeping the issue IDs, we mainly did it in the LP→BB migration because we could, not because it was important. (If it wasn't clear, we're looking to migrate from BB→GH now).

from bitbucket-issue-migration.

mithrandi avatar mithrandi commented on June 14, 2024

Aha, found it the script: https://bitbucket.org/jonathanj/lp2bb

from bitbucket-issue-migration.

jeffwidman avatar jeffwidman commented on June 14, 2024

@mithrandi the GitHub issue import API uses a task queue to process/import tasks, they're not immediately created. So I doubt they'd add support for specifying IDs, as it'd likely require changing their whole infrastructure underlying issue importing.

Given the wide range of holes for issue IDs from Launchpad, sounds like actually best to create a mapping of issue IDs in BB to expected ID in GitHub. This mapping should also account for existing issues in the GH destination repo (#70). Then run the import (and hope that nobody files a new issue during the import process... probably add a note to the docs encouraging folks who really care to start with blank repo, and only migrate the code if the issues migrate successfully, otherwise to redo the issue import).

This will require fetching all issues & issue comments from BB before starting to import anything into GitHub so that they can all be processed in one go once the mapping is finished. Currently comments are fetched as an issue is imported.

Also could make fix_links() controlled by an optional flag on teh command line, defaulting to enabled, but that way people disable if desired. Personally, I think it's extremely convenient to run fix_links() for updating crosslinks between issues.

from bitbucket-issue-migration.

mithrandi avatar mithrandi commented on June 14, 2024

You should probably include the original BB ID somewhere in the migrated issue at least, since this may appear elsewhere (eg. in VCS commits that were migrated).

from bitbucket-issue-migration.

thomasjsn avatar thomasjsn commented on June 14, 2024

@jaraco Thanks for your work on filling gaps, work beautifully :)

from bitbucket-issue-migration.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.