openhatch / oh-bugimporters

Bug importers for the OpenHatch project oh-mainline
https://oh-bugimporters.readthedocs.org/
GNU Affero General Public License v3.0
12 stars 28 forks source link

bugzilla bug importer crashes with AttributeError #82

Closed ghost closed 10 years ago

ghost commented 10 years ago

Comment by paulproteus:

When handle_query_response() gets a tracking bug XML response, it crashes.

Sample URL: https://bugzilla.redhat.com/show_bug.cgi?ctype=xml&id=509829

      File "/home/deploy/oh-bugimporters/bugimporters/bugzilla.py", line 84, in 

handle_query_response bug_ids = self.handle_tracking_bug_xml(response.body)

      File "/home/deploy/oh-bugimporters/bugimporters/bugzilla.py", line 123, in 

handle_tracking_bug_xml self.bug_ids.extend([int(depend.text) for depend in depends]) exceptions.AttributeError: 'BugzillaBugImporter' object has no attribute 'bug_ids'

We should be returning bug_ids, not modifying self.bug_ids. We should make sure this particular case gets covered in the test suite.

To fix this, take the following steps:

  • Create a new test method in some existing class in bugimporters/tests/test_bugzilla.py
  • Make sure the above URL appears in the list of queries for the TrackerModel (usually self.tm or "tm").
  • Then run the test suite and watch it crash. Fix the crashes and now you'll get bugs imported in the test.

Yay.


Comment by paulproteus:

I fixed this in https://github.com/openhatch/oh-bugimporters/commit/211c607ff828784c81904c26a89f33b9ff43b37c


Status: resolved Nosy List: paulproteus Priority: bug Imported from roundup ID: 790 (view archived page) Last modified: 2012-11-26.19:45:57