Parsing multiple source packages in a bug

Bug #79546 reported by Alex Muntada
2
Affects Status Importance Assigned to Milestone
Bug Helper
Fix Released
High
Daniel Holbach

Bug Description

Some bugs like bug 77442 have several source packages listed. If you fetch https://launchpad.net/bugs/77442 the title shows only one if them, so it can't be used to get the source package name, i.e.:

  <title>Bug #77442 in vnc (Ubuntu): ...

Since there's different source packages for this bug there's also the change to get a different name each time, depending on the fetching method and LP behaviour. It seems that the last source package is listed, but I could be wrong (maybe we should ask LP developers).

(Found while working on bug 79247)

Revision history for this message
Alex Muntada (alex.muntada) wrote :

The diff below against latest Daniel's branch shows the problem and how to get a full list of source packages. Since there are more than one, I guess that self.sourcepackage should be a list (or set); but I have to figure out how the whole thing works yet, so I can provide a wider patch.

Please, note that those "print" lines on the diff are only for debugging purposes, to let you see the multiple source package results for each bug.

== modified file 'bugHelper/HTMLOperations.py'
--- bugHelper/HTMLOperations.py 2007-01-15 16:38:45 +0000
+++ bugHelper/HTMLOperations.py 2007-01-15 23:21:30 +0000
@@ -61,8 +61,10 @@
         sock.close()

         if not len(self.sourcepackage):
- titleFilter = '<title>Bug #[0-9]* in (.*?) .*: .*'
- filteredSourcePackage = re.findall(titleFilter, self.text)
+ viewstatusFilter = 'viewstatus">([^ ]*) [^<]*</a>'
+ filteredSourcePackage = re.findall(viewstatusFilter, self.text)
+ print bugnumber
+ print filteredSourcePackage
             self.sourcepackage = filteredSourcePackage[0]

         if cl.attachments:

Revision history for this message
Alex Muntada (alex.muntada) wrote :

I hope it's OK to set this fields myself... ;)

Changed in bughelper:
importance: Undecided → High
status: Unconfirmed → Confirmed
description: updated
description: updated
Revision history for this message
Daniel Holbach (dholbach) wrote :

Thanks Alex - your fix did the change. I just pushed a fix to ~dholbach/bughelper/bughelper.dev - if somebody would like to review it... :-)

Checking all the source packages involved should work now.

Changed in bughelper:
status: Confirmed → Fix Committed
Revision history for this message
Daniel Holbach (dholbach) wrote :

Hum... is this fixed in the most recent bughelper (in bugsquad.main)?

Revision history for this message
Alex Muntada (alex.muntada) wrote :

I'm afraid it isn't merged in bughelper.main yet.

I'd be happy to do it, but I still have to figure out how to do it (I'm a novice bzr user, sorry). I have my own branch and yours locally, but I don't know how to proceed and don't want to break anything. I guess I need a deeper look into bzr docs available or wiki.ubuntu.com.

Revision history for this message
Daniel Holbach (dholbach) wrote :

Do you have a test case where this doesn't work?

Revision history for this message
Alex Muntada (alex.muntada) wrote :

Daniel, I have to find a suitable info file to test bug 77442 but the changes that you committed didn't include the regexp change I was suggesting in https://launchpad.net/bughelper/+bug/79546/comments/1 so I'd say that isn't fixed yet because the "<title" regexp only catches one of the source package names listed in 77442, AFAICS.

Revision history for this message
Alex Muntada (alex.muntada) wrote :

Daniel, I just confirmed that it works fine with latest bughelper.main:

$ ./bughelper -T vino "desktop-effects" "reconnecting" -p vino
Checked at [] - no clues found.
Check README on how to create one using the bugxml(1) command.
http://launchpad.net/bugs/77442 [desktop-effects Ubuntu: Unconfirmed/Undecided][vino Ubuntu: Unconfirmed/Undecided][vnc Ubuntu: Unconfirmed/Undecided] - reconnecting

Sorry, I didn't notice that you added more info logic after parsing the title.

Changed in bughelper:
assignee: nobody → dholbach
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.