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
71 stars 31 forks source link

Error analyzing JIRA 6.1 #119

Closed canasdiaz closed 10 years ago

canasdiaz commented 10 years ago

The error was analyzing this code

<div class="actionContainer">
        <div id="changehistorydetails_112824" class="action-details">
    <a href="/secure/ViewProfile.jspa?name=kirby" id="changehistoryauthor_112824" rel="kirby" class="user-hover user-avatar"><span class="aui-avatar aui-avatar-xsmall"><span class="aui-avatar-inner"><img src="https://secure.gravatar.com/avatar/74f92bea1e7f0cbb71e55451b102ebd3?d=mm&amp;s=16"></span></span> Matt Kirby</a>
 made changes  - <span title="Yesterday 10:47 PM" class="date"><time datetime="2013-12-15T22:47-0800" class="livestamp">Today 10:47 PM</time></span>
        </div>

In JIRA 5.x we had this one

<div class="actionContainer">
<div class="action-details" id="changehistorydetails_1131371">
<a name="action_1131371">
</a><a class="user-hover user-avatar" rel="randy.zhu" style="background-image:url(/secure/useravatar?size=small&amp;avatarId=10162);" id="changehistoryauthor_1131371" href="/secure/ViewProfile.jspa?name=randy.zhu">Randy Zhu</a>
 made changes  - <span class="date" title="05/Apr/13 9:35 AM"><time datetime="2013-04-05T09:35-0700">05/Apr/13 9:35 AM</time></span>
canasdiaz commented 10 years ago

Error still alive in some cases ...

[13:03:18] /usr/local/bin/bicho --db-user-out=root --db-password-out= --db-database-out=lcanas_bicho_puppetlabs_2453 -d 0 -b jira -u https://tickets.puppetlabs.com/browse/FACT  >> /home/owl/automator/automatic_retrieval/puppetlabs//log/launch.log 2>&1
Checking URL: https://tickets.puppetlabs.com
Running Bicho with delay of 0 seconds
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/bicho/backends/jira.py", line 877, in analyze_bug_list
    issues = handler.getIssues()
  File "/usr/local/lib/python2.7/dist-packages/bicho/backends/jira.py", line 742, in getIssues
    bicho_bugs.append(self.getIssue(bug))
  File "/usr/local/lib/python2.7/dist-packages/bicho/backends/jira.py", line 785, in getIssue
    changes = parser.parse_changes()
  File "/usr/local/lib/python2.7/dist-packages/bicho/backends/jira.py", line 385, in parse_changes
    rel = a_link.attrs[1]
AttributeError: 'NoneType' object has no attribute 'attrs'
Tickets to be retrieved: 139
canasdiaz commented 10 years ago

The error appears parsing the history of this bug: https://tickets.puppetlabs.com/browse/FACT-23

It crashes when gets this HTML

<span class="user-hover user-avatar" rel="hailee">.......</span>

and it is expecting an "A" tag instead.