MetricsGrimoire / Bicho

Bicho is a command line based tool used to parse bug/issue tracking systems
http://metricsgrimoire.github.com/Bicho/
GNU General Public License v2.0
68 stars 30 forks source link

KeyError and AttributeError raised while analyzing Gerrit repository #124

Closed sduenas closed 10 years ago

sduenas commented 10 years ago

I got this error anayzing puppet-glance project in OpenStack's Gerrit.

/usr/local/bin/bicho --db-user-out=xxxxxxxx --db-password-out=xxxxxxxx --db-database-out=test_openstack_gerrit -d 1 -b gerrit  -u review.openstack.org --gerrit-project=stackforge/puppet-glance  -g
Checking URL: ://
Not an URL: review.openstack.org
DBG: [28/Jan/2014-11:11:50] Bicho object created, options and backend initialized
Running Bicho with delay of 1 seconds
DBG: [28/Jan/2014-11:11:50] Gerrit cmd: ssh -p 29418 review.openstack.org gerrit query project:stackforge/puppet-glance limit:500 --all-approvals --comments --format=JSON

[...]

 u'project': u'stackforge/puppet-glance',
 u'sortKey': u'0025bda3000080d1',
 u'status': u'MERGED',
 u'subject': u'Fix misnamed protocol param in glance-api.conf',
 u'topic': u'fix-protocol-param',
 u'url': u'https://review.openstack.org/32977'}
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/bicho/backends/gerrit.py", line 201, in analyze_review
    comments = self.analyze_review_comments(review)
  File "/usr/local/lib/python2.7/dist-packages/bicho/backends/gerrit.py", line 258, in analyze_review_comments
    comments = self.parse_comments(review)
  File "/usr/local/lib/python2.7/dist-packages/bicho/backends/gerrit.py", line 269, in parse_comments
    comment['reviewer']["username"] = comment['reviewer']["name"]
KeyError: 'name'
Traceback (most recent call last):
  File "/usr/local/bin/bicho", line 25, in <module>
    retval = bicho.main.main()
  File "/usr/local/lib/python2.7/dist-packages/bicho/main.py", line 56, in main
    backend.run()
  File "/usr/local/lib/python2.7/dist-packages/bicho/backends/gerrit.py", line 502, in run
    self.add_merged_abandoned_changes(entry, review_data)
  File "/usr/local/lib/python2.7/dist-packages/bicho/backends/gerrit.py", line 361, in add_merged_abandoned_changes
    if (issue.status<>'MERGED' and issue.status<>'ABANDONED'): return
AttributeError: 'NoneType' object has no attribute 'status'