I’ve talked about preventing bugs from being reported by apport and creating duplicate signatures so the apport retracer can mark bugs as duplicates of another. There is another process for preventing bugs from being reported and that is writing bug patterns something I’ve given a class on.
When apport begins the bug reporting process it first checks to see if the bug being reported matches a pattern and if the bug does it redirects the reporter to the bug, or wiki page, matching that pattern. Additionally, the apport retracer helps us identify bug reports that would benefit from a pattern (those with 10 duplicates) by tagging them bugpattern-needed and subscribing the Ubuntu Bug Control team to the bug report.
After we write a bug pattern we should do three things to the bug report:
1) Remove the tag bugpattern-needed
2) Add the tag bugpattern-written
3) Unsubscribe Ubuntu Bug Control
While modifying the tag is essentially one operation in the Launchpad web interface there are still two steps involved here. This was two too many in my opinion! I wanted to write a bazaar plugin to modify the Launchpad bug report appropriately after the bzr branch with the pattern was pushed to Launchpad. I became extremely motivated yesterday when I saw about a dozen merge proposals from Vadim Rutkovsky (thanks!) for bug patterns.
So now there is a bazaar plugin in the bug patterns branch that will properly take care of a bug report once a pattern is written for it. To use it you need to have python-launchpadlib-toolkit installed, for working with the Launchpad API, and create a symlink to bugpattern_written.py in your ‘~/.bazaar/plugins/’ directory. Enjoy!