#68 'list' object has no attribute 'username' on pgimport push
Closed: Fixed 7 years ago Opened 7 years ago by clime.

Hey, this procedure gives the above mentioned error when applied on verigak/progress Github repository:

 pgimport clone ...
 pgimport github (final anwer yes)
 <manual assembled_commentors.csv file editing to fill out missing names and emails>
 pgimport gihub (final answer no)
 pgimport push ...

produces this traceback:

 remote: Traceback (most recent call last):
 remote:   File "./hooks/post-receive.pagure-ticket", line 107, in <module>
 remote:     main(sys.argv[1:])
 remote:   File "./hooks/post-receive.pagure-ticket", line 103, in main
 remote:     run_as_post_receive_hook()
 remote:   File "./hooks/post-receive.pagure-ticket", line 99, in run_as_post_receive_hook
 remote:     json_data=json_data)
 remote:   File "/home/vagrant/devel/pagure/lib/git.py", line 460, in update_ticket_from_git
 remote:     user=user.username,
 remote: AttributeError: 'list' object has no attribute 'username'
 remote: Hook ./hooks/post-receive.pagure-ticket failed with error code 1

If I look at one custom generated issue file in the Pagure tickets (non-bare) repository, I see:

 {
     "assignee": null,
     "blocks": [],
     "close_status": "",
     "comments": [],
     "content": "Reproducer:\n\n``` python\nfrom progress import spinner, bar\n\ns = spinner.Spinner('Foo ... ')\ns.next()\ns.finish()\n```\n\nThere is no newline after this spinner, so my terminal prompt is on the same line, e.g.:\n\n```\nFoo ... \\[bkabrda@zizalka test]$\n```\n\nI guess the problem is in WriteMixin (used by spinners), which doesn't print newline, as opposed to WritelnMixin (used by bars) which prints new line.\n",
     "date_created": "1394790248",
     "depends": [],
     "id": null,
     "milestone": null,
     "private": false,
     "status": "Open",
     "tags": [],
     "title": "No newline after spinners",
     "user": {
         "emails": [
             null
         ],
         "fullname": "Slavek Kabrda",
         "name": "bkabrda"
     }
 }

"emails" field is [null], which is probably the problem (there are [null]s in the other files too) for some users.


There is a big problem with github importer that we can't get emails of "issue commentors" from their API, that's why it has to be manually added (as of now). There is a csv file for this where you can add an email corresponding to the user. I know this is painful. It's in the readme, check the overview page.

You pgimport check and bail earlier than after submitting the data then?

@vivekanand1101: oh, that's not the case. If you do not fill out the missing data in assembled_commentors.csv and try to runpgimport github (answer 'n'), you get "You need to fill out all the emails of the issue commentors" message.

This issue should be fixed by https://pagure.io/pagure-importer/pull-request/69.

Two things happened that day:

  1. I didn't read the issue properly
  2. I forgot what i had written in the code

Sorry about both.

@cverna changed the status to Closed

7 years ago

Login to comment on this ticket.

Metadata