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

[BUG] Pivotal Tracker importer can fail on KeyError: 'person' when importing comments #175

Open
mig5 opened this issue Oct 9, 2024 · 0 comments · May be fixed by #176
Open

[BUG] Pivotal Tracker importer can fail on KeyError: 'person' when importing comments #175

mig5 opened this issue Oct 9, 2024 · 0 comments · May be fixed by #176
Labels
bug Something isn't working

Comments

@mig5
Copy link

mig5 commented Oct 9, 2024

Describe the bug

I am using the Pivotal Tracker importer to import projects from Pivotal Tracker which is being shut down by Broadcom at the end of April 2025.

The importer tool seems great! It has imported hundreds of stories, epics, comments, tags, history and so on, in my initial test.

The problem I have, is that it is bombing out on this exception:

Traceback (most recent call last):
  File "/taiga-back/manage.py", line 17, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/opt/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/venv/lib/python3.11/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/opt/venv/lib/python3.11/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/taiga-back/taiga/importers/management/commands/import_from_pivotal.py", line 78, in handle
    importer.import_project(project_id, options)
  File "/taiga-back/taiga/importers/pivotal/importer.py", line 83, in import_project
    self._import_user_stories_data(project_data, project, options)
  File "/taiga-back/taiga/importers/pivotal/importer.py", line 400, in _import_user_stories_data
    self._import_comments(project_data, us, story, options)
  File "/taiga-back/taiga/importers/pivotal/importer.py", line 484, in _import_comments
    user=users_bindings.get(comment['person']['id'], User(full_name=comment['person']['name'])),
                            ~~~~~~~^^^^^^^^^^
KeyError: 'person'

There must be a peculiar comment in a specific story but I don't know which. It has imported many other comments so I know it generally is working fine.

The problem is obviously with the data returned from Pivotal. I can't do much about that. But I wondered if a Taiga developer could help me work around this problem in the importer code? Perhaps we can just 'skip' on KeyError rather than fatally error out?

How would I go about editing the code? I am running the command like this:

./taiga-manage.sh import_from_pivotal  --token xxxx --project-id xxx

When I do that, it spins up an instance of taiga-back as a container. I am not building my own image, I'm using the official ones. What's the easiest way for me to perhaps tweak the code? Can I run it directly within the container, perhaps?

Thanks so much for writing this importer! It is looking like it will be a life saver! With Pivotal shutting down, I am sure I won't be the last person looking to migrate to Taiga. :)

Taiga environment

Self-hosted Taiga installed via Docker

@mig5 mig5 added the bug Something isn't working label Oct 9, 2024
@mig5 mig5 linked a pull request Oct 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant