Skip to content

Import crashes due to name clash between default labels and imported labels #124

@Ident

Description

@Ident

We use a label called "documentation" but github repos by default contain a "Documentation" label.

This lead to a crash when an issue with a "documentation" label on bitbucket was attempted to be imported. It took me a long time to debug this but now I just figured it out and remove the default labels and the import works!

Imo the importer should delete all pre-existing labels before starting, if this is possible through the API, just to prevent these unforseeable collisions because it can happen otherwise with a fresh repo and that is something I consider rather unexpected as a user.

For reference, here is the crash log with trace:

Completed 204 issues
Traceback (most recent call last):
File "A:\Programs\PyCharm\helpers\pydev\pydevd.py", line 2411, in
globals = debugger.run(setup['file'], None, None, is_module)
File "A:\Programs\PyCharm\helpers\pydev\pydevd.py", line 1802, in run
launch(file, globals, locals) # execute the script
File "A:\Programs\PyCharm\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/Users/Lukas/PycharmProjects/bitbucket_migrate/migrate/migrate.py", line 877, in
sys.exit(main(options))
File "C:/Users/Lukas/PycharmProjects/bitbucket_migrate/migrate/migrate.py", line 255, in main
resp = verify_github_issue_import_finished(
File "C:/Users/Lukas/PycharmProjects/bitbucket_migrate/migrate/migrate.py", line 862, in verify_github_issue_import_finished
raise RuntimeError(
RuntimeError: Failed to import GitHub issue due to the following errors:
{'id': 2725386, 'status': 'failed', 'url': 'https://api.github.com/repos/Ident/ceguiissuetest/import/issues/2725386', 'import_issues_url': 'https://api.github.com/repos/Ident/ceguiissuetest/import/issues', 'repository_url': 'https://api.github.com/repos/Ident/ceguiissuetest', 'created_at': '2020-01-05T13:35:06.000+01:00', 'updated_at': '2020-01-05T13:35:06.000+01:00', 'errors': [{'location': '/issue/labels[1]', 'resource': 'Label', 'field': 'name', 'value': 'Documentation', 'code': 'invalid'}]}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions