== Ubuntu Open Week - Bughelper - Making Bug Work Easier - Markus Korn - Fri, May 2, 2008 == === jcastro changed the topic of #ubuntu-classroom to: Ubuntu Open Week | Information and Logs: https://wiki.ubuntu.com/UbuntuOpenWeek | How to ask questions: https://wiki.ubuntu.com/UbuntuOpenWeek/Rules | Ask questions in #ubuntu-classroom-chat, prefaced with "QUESTION:" |See https://wiki.ubuntu.com/UbuntuOpenWeek/JoiningIn to filter out channel noise | [15:55] thekorn_: 5 minutes! === jcastro changed the topic of #ubuntu-classroom to: Ubuntu Open Week | Information and Logs: https://wiki.ubuntu.com/UbuntuOpenWeek | How to ask questions: https://wiki.ubuntu.com/UbuntuOpenWeek/Rules | Ask questions in #ubuntu-classroom-chat, prefaced with "QUESTION:" |See https://wiki.ubuntu.com/UbuntuOpenWeek/JoiningIn to filter out channel noise | "Bughelper - Making Bug Work Easier" - Markus Korn [15:56] Ok everyone welcome back, we'll get started in a few minutes [15:56] Please note that there has been a last minute scheduling change: https://wiki.ubuntu.com/UbuntuOpenWeek/ [15:57] We apologize for this being last minute, so to fill in the time we'll continue to discuss bughelper and general Q+A things like 5-a-day. [15:57] then @ 1700 UTC I will hold a general Ubuntu Q+A session [15:58] thanks to everyone for showing up, thekorn_ will begin at the top of the hour! [15:58] as always, feel free to send me feedback at jorge (at) ubuntu.com [16:01] * thekorn_ rings the bell [16:02] Good morning everybody to today's first session of the Ubuntu Open Week. [16:02] My name is Markus Korn, I'm one of the developers of bughelper and python-launchpad-bugs [16:02] and I would like to show you how this tools can help you work with your bugs. [16:03] If you have any questions please ask in #ubuntu-classroom-chat [16:03] If you want to tryout the examples I provide in this session, please install bughelper and python-launchpad-bugs. [16:04] Some of this examples will only work with the latest version of both tools. [16:04] To get this version please add [16:04] deb http://ppa.launchpad.net/bughelper-dev/ubuntu hardy main [16:04] to your /etc/apt/sources.list, and replace 'hardy' with the version of ubuntu you use. [16:05] Then you can should update via 'sudo apt-get update' and install bughelper and python-launchpad-bugs. [16:05] That's all preparation we need, let's start the session! [16:05] [16:06] So first of all: what's bughelper and python-launchpad-bugs? [16:06] * python-launchpad-bugs is a python interface to work with bugs, and blueprints, in Launchpad. [16:06] * While bughelper is a suite of utilities that uses python-launchpad-bugs to help you find specific bugs in Launchpad. [16:07] I'll start off talking about the bughelper suite and then move on to python-launchpad-bugs. [16:07] [16:07] The most important tools in the bughelper suite are buginfo, bugnumbers and bughelper itself. [16:08] Let's have a closer look at this tools: [16:08] [16:08] 'buginfo' provides an easy interface for accessing information about a single bug for example [16:09] 'buginfo --title 123456' [16:09] will return the bugs title. [16:09] [16:09] 'bugnumbers' is designed to return a list of bug based on a query. [16:10] Let's say you would like to get a list of all bug in ubuntu's 'bughelper' package, run bugnumbers like: [16:10] 'bugnumbers -p bughelper' [16:11] As there is also a project called 'bughelper' registered on launchpad.net, [16:11] you can add the option '-U' to get a complete list of all open bugs in the package and in the project. [16:12] Other possible options are: [16:12] '-D=' to change the distrubution to look in [16:13] (note: this distro has to be registered in launchpad.net) [16:13] '-P=' to only search for all bugs in a given project [16:13] '-l=' to filter buglists based on a given url [16:14] [16:14] So far you get a list of all open bugreports, [16:14] by adding additional options you can filter this lists further. [16:15] Some of these filters are are also available via the search feature of launchpad, some of them are not. [16:15] Some features not in Launchpad are querying on the quantity of duplicates, subscribers, comments, attachments. [16:16] Or you can query on the date and author of the last comment in a bugreport. [16:16] [16:16] Let me give you some simple examples: [16:16] 'bugnumbers -P python-launchpad-bugs --reporter thekorn' [16:17] 'bugnumbers -P python-launchpad-bugs --reporter thekorn --status New' [16:17] both calls will return you a list of all open bugs in the python-launchpad-bugs project, [16:17] but the second one will only show you the 'New' ones. [16:18] [16:18] That's no magic so far, let's have a look at a more complex one: [16:18] 'bugnumbers -l "https://bugs.launchpad.net/~thekorn" --na ">1" --closed' [16:19] This will return a complete list of all bugs related to me with one or more attachments. [16:19] This list will also contain closed bugreports [16:20] [16:20] On http://people.ubuntu.com/~brian/reports/ Brian Murray is using bugnumbers to create interesting reports. [16:20] For example 'yesterday' contains a list of all bugs in ubuntu which where reported yesterday. [16:21] This reports show you that there are different output-formats, in this case he is using a html-format for the output, [16:21] there are also options for a 'wiki' and 'csv' styled output. [16:21] [16:22] Any questions so far? [16:22] QUESTION: How do you use bughelper on websites? You need to place it in cron? [16:23] qense, yes, bdmurray is running a cron job to create this pages, [16:24] but there is also a script called 'bughelper-server.py' in the bzr branch [16:24] which helps you to organize runs of bughelper and bugnumbers a bit [16:25] you can get the branch via: [16:25] bzr branch lp:bughelper [16:25] qense, does this answer your question [16:26] ? [16:26] ok, let's move on [16:26] [16:26] With 'bughelper', the application, you can search bug reports, comments and attachments for a specific string. [16:27] 'bughelper' provides you clue based on the search result. [16:27] Clues are stored in clue files with the suffix '.info' in '~/.bughelper/packages' [16:27] https://code.launchpad.net/bughelper-data/ is the project in launchpad to organise this clue-files and every member of the bugsquad can commit clue files to the .main branch of this project. [16:28] [16:28] So, what's the structure of such an clue-file? [16:28] And how does such an file look like? [16:28] As an example let's take a look at ~/.bughelper/packages/bughelper [16:29] (you can view this file online at http://tinyurl.com/2zwm7a) [16:29] Such clue files are in a xml format and can contain multiple clues. [16:29] Each clue needs at least two elements: [16:30] '' [16:30] this element contains the actual search pattern. [16:30] It is possible to add logical elements like 'and' or 'or' to such a node. [16:30] In the first clue you can see an example of using regular expressions as an search pattern. [16:31] The 'field' attribute specifies which attribute of an bugreport has to be searched. [16:31] If you run bughelper and one of the clues in an clue files matches the content of the related '' node will be printed as the output. [16:31] [16:32] As an example, if you run 'bughelper -p bughelper' you will get an output like: [16:32] http://launchpad.net/bugs/88102 [[bughelper: Confirmed/Medium],[bughelper (Ubuntu): Confirmed/Undecided]] - tags: xpath or commandline; importance: Undecided [16:32] [16:32] With this I would like to finish the first part of this session about the bughelper tools. Any further questions? [16:33] [16:33] Ok, then let's have a brief look at the underlieing python modul 'python-launchpad-bugs' [16:34] afflux> you can test very simple searches by using: bughelper -p package -T package "keyword" "description". This can be very useful for finding duplicates of crasher bugs which differ slightly. I used "bughelper -A -p compiz -T compiz workaroundRemoveFromFullscreenList 'dup of bug 183685'" for finding a lot of duplicates of this bug [16:34] thanks afflux, good point, forgot to tell you about this. [16:34] [16:35] good, than I think it's time for python-launchpad-bugs [16:35] [16:35] python-launchpad-bugs allows you to access bugs.launchpad.net via python. [16:36] This python module is used by many tools like apport, ubuntu-dev-tools and of course bughelper and bugnumbers. [16:36] [16:36] Let me give you a short "Howto" on using python-launchpad-bugs. [16:36] This requires some basic understanding of python. [16:36] [16:37] Let's start a python session and do some general preparation: [16:37] >>> import launchpadbugs.connector as Connector [16:37] >>> from launchpadbugs.basebuglistfilter import URLBugListFilter [16:37] [16:37] so far so good, let's get a list of all open bugs in the bughelper project [16:38] >>> BugList = Connector.ConnectBugList() [16:38] >>> bl = BugList("https://bugs.launchpad.net/bughelper/+bugs") [16:38] Each element of this list has attributes like 'bugnumber', 'url', 'status' and 'importance'. [16:39] [16:39] Getting filtered lists is also very easy: [16:39] >>> bug_filter = URLBugListFilter() [16:39] >>> bug_filter.add_option("status", ("New","Confirmed")) [16:39] >>> bug_filter.add_option("importance", ("Medium",)) [16:40] >>> bl = BugList(bug_filter("https://bugs.launchpad.net/bughelper/+bugs")) [16:40] It's also possible to use any python functions as a filter, but this would go too far right now. [16:40] [16:41] Okay, that's all about bug lists for now, for more information please visit http://tinyurl.com/yrmze9 [16:41] [16:41] Now, let's have a look on how to handle bugreports with python-launchpad-bugs: [16:41] >>> Bug = Connector.ConnectBug() [16:41] >>> b = Bug(123456) [16:42] The argument of Bug() can either be a bug number, an url of a bugreport or an element of a BugList-object [16:42] There is a huge amount of attributes of a bug-object. [16:42] You can access almost all information of a bugreport. [16:42] Let's have a look at some examples: [16:43] >>> b.url [16:43] 'https://bugs.launchpad.net/ubuntu/+source/xine-lib/+bug/123456' [16:43] >>> print b.subscriptions [16:43] set([, [...], ]) [16:43] >>> print b.comments [16:43] [,[...],] [16:43] For a list of all attributes of a Bug-object and some examples on using these attributes have a look at http://tinyurl.com/2mboze [16:43] [16:44] So far, we have only read bugs, but with python-launchpad-bugs you can also change bugreports in a very easy way! [16:44] First of all, only registered user can change bugreports in launchpad, so let's authenticate with our account data: [16:45] >>> Bug.authentication = {"password":"","email":""} [16:45] There is also another possibility of authentication: you can use a mozilla cookie-file (this for example works for cookies created by epiphany or firefox < 3.0) [16:46] >>> Bug.authentication = "/path/to/the/cookiefile/cookie.txt" [16:46] If you are using Firefox 3.0 'Bug.authentication' also accepts the new .sqlite type of cookie files. [16:46] [16:47] Now I want to show you, as an example, how to change the status of a bug: [16:48] >>> demo = Bug(193948) [16:48] >>> demo.status [16:48] 'New' [16:48] >>> demo.status = "Invalid" [16:48] >>> demo.commit() [16:49] Until you call the 'commit()'-method all changes are local, with 'commit()' you try to commit all changes you did locally to launchpad. [16:49] Like this you can for example change the description, add comments or attachments, subscribe to a bug or change the tags. [16:49] [16:50] Any further questions? [16:50] let's move on [16:50] [16:51] Let's have a look at two more complex examples. [16:51] You can get this scripts here: https://wiki.ubuntu.com/BugHelper/Dev/python-launchpad-bugs/Examples [16:51] These two scripts show you how to use python-launchpad-bugs to do things you can't do in launchpad itself. [16:51] [16:51] Let's say you are a developer of an upstream project in launchpad. [16:52] When you create a package of your tool and build it for ubuntu, bugs in ubuntu are closed by the (LP: #123456) syntax, but upstream bugs were not. [16:52] The first example also closes this upstream bugs in your project and adds a comment containing the changelog-entry. [16:52] [16:53] I wrote the second example in the last February when we had all these python-central bugreports. [16:53] This example returns you a list of bugs created in ubuntu after 2008-02-18 and filters this list by the following criteria: [16:53] * 'pycentral' or 'python-central' in the content of the bugreport [16:54] * an attachment called 'DpkgTerminalLog.gz' which contains 'pycentral' or 'python-central' [16:54] [16:54] As a last example I would like to show you how to create a bugreport with python-launchpad-bugs, it's only one line of code! [16:55] >>> b = Bug.New( [16:55] ... product = {"name":"buglog-data"}, [16:55] ... summary = "First part of the session is almost over", [16:55] ... description = "Ubuntu Open week rocks!") [16:55] This creates a new bugreport in the 'buglog-data'-project, if you would like to file a bugreport in ubuntu use [16:55] 'product = {"target": "ubuntu", "name": "my-package"}' [16:56] [16:56] Ok, that's all about python-launchpad-bugs for now, time for some questions! [16:57] QUESTION: why is len(launchpadbugs.connector.ConnectBug()(123456).comments) == 0 for me? [16:57] sorry if that's too much support ;) [16:59] afflux, I think it's a bug or something :) [16:59] as the text-mode works [16:59] will investigate after this session. let's move on with other questions [17:00] [17:00] QUESTION: Do requests with this package require more or less bandwidth than visiting the website? Or is it the same? [17:00] That's an interesting question, [17:00] as LP does not provide a scripting database interface yet, [17:01] python-launchpad-bugs is doing screen scrapping, [17:01] this means in almost all cases the required bandwidth is the same. [17:02] I hope that there will be a public database interface to launchpad.net soon [17:02] this will make a lot of things easier [17:02] [17:03] QUESTION: Is there a way via pyhon-launchpadbugs I can get back a list of possible duplicates (like the LP web interface does when reporting a new bug)? [17:03] ScottK, not yet, but I think this is a very good idea, just made a note on my TODO list [17:04] [17:05] Ok, as far as I can see, i answered all questions. [17:06] Let me end the first part of this session with a few notes: [17:06] * bughelper has a separate mailing list, bughelper@l.u.c [17:07] * browse https://launchpad.net/python-launchpad-bugs and https://launchpad.net/bughelper to file bugreports or get the code [17:07] * for more information check out our wiki pages at https://wiki.ubuntu.com/BugHelper [17:07] * and last but not least ping me in #ubuntu-bugs [17:08] please use this if you have any questions, [17:08] would like to see a certain feature [17:08] or I you would like to contribute to bughelper and python-launchpad-bugs [17:09] [17:09] Ok, I think that's all for the first part of this session. [17:09] As jcastro mentioned at the beginning, [17:10] there were some changes to the schedule, some I will be here for another hour ;) [17:10] We can continue to answer questions. [17:10] And we can talk about 5-a-day [17:12] If you haven't heard about 5-a-day: https://wiki.ubuntu.com/5-A-Day [17:12] The basic idea is for everyone to touch 5 bugs a day [17:12] During the Reporting Bugs and Bugsquad sessions Brian and Pedro discussed bug filing and triaging teachniques [17:13] Note that those sessions will be repeated tomorrow @ 1700 and 1800 UTC [17:13] With 5-a-day we have provided tools to keep track of bugs you touch [17:13] which get reported to launchpad, and then we generate statistics [17:13] Current statistics are here: http://daniel.holba.ch/5-a-day-stats/ [17:14] the stats are broken down into individuals and teams [17:14] so you can register your Ubuntu Local Team and get tracked via stats [17:14] So for example, the team I belong to, ubuntu-michigan, has helped triage 1015 bugs [17:15] This is useful because a) It motivates people in my team to get involved [17:15] b) It provides metrics so we can measure how effective our team is when it comes to contributing to Ubuntu [17:16] c) It's nice to be able to say "I helped Ubuntu triage 214 bugs" so I sleep better at night. :) [17:16] questions so far? [17:17] < qense> QUESTION: What is the function of a tag? [17:17] So with the 5-a-day tool you can "tag" bugs with certain tags [17:17] we use tags to tag bugs that are fixed during a specific event [17:18] so for example if you participate in a Hug Day, you tag your bugs with the tag for that day [17:18] this helps us see how effective we are at triaging bugs during Hug Days [17:19] Note that this is a voluntary project, you don't have to participate, and many people just triage bugs in launchpad without being part of 5-a-day [17:19] which is fine, but it's nice to get a sample on how we're doing for hugs day [17:19] Anyone can use the tags in 5-a-day [17:19] So for example, if you and your friends want to get together and triage bugs [17:20] We have this: https://wiki.ubuntu.com/RunningBugJam [17:20] So for example you and friends can have a "Quense's Bug Killing Blastorama" bug jam, tag it in 5-a-day, and it will show up in the statistics [17:21] As you can see in the lp log: https://code.edge.launchpad.net/~5-a-day/5-a-day-data/main [17:21] People are committing and sending in data all the time. [17:22] What I do every day [17:22] is run the applet in my panel [17:22] and as I triage/report/comment on bugs, I drag the firefox tab into the applet [17:22] and the applet reports it up to launchpad. [17:23] Some days I don't get many done, some days I do more than 5, which is fine also [17:23] Any more questions? [17:23] the applet does not only work with firefox but also with all other mozilla based browsers, [17:24] If you do participate, there are tips on the wiki for generating your own email signature in both plain text and html. [17:24] and the applet does also work in xfce, and there will be a QT version soon [17:24] So that people know what bugs you've touched. [17:25] So in short, if you're going to be triaging and other bug work, we encourage you to sign up for 5-a-day [17:26] and your friends in your local group [17:26] kubuntu-de.org is leading the pack with 1292 bugs, but hard work will move your team up the leaderboard! [17:27] Ok, we have 30 minutes left, any more questions on bughelper or 5-a-day? [17:31] If there are no questions, I would like to point you to two tools which are using python-launchpad-bugs: [17:31] First one is 'Gnome Launchpad Bugs Applet' [17:31] https://launchpad.net/lp-bugs-applet/ [17:32] It's an applet based on Chris Lamb's 'debian-bts-applet' [17:33] It shows you your pet bugs in a list in your gnome panel [17:34] you can feed this list with tools like bugnumbers or you can get all bugs of an ubuntu hug-day [17:34] [17:35] another one is 'hugday-tools' [17:35] https://launchpad.net/hugday-tools/ [17:35] this simlifies editing of the hug-day wiki-pages [17:35] via the commandline [17:36] so you don't have to edit the wiki pages directly in your browser, [17:36] the only thing you have to do is: [17:37] hugday close 123456 [17:38] to mark bug 123456 in lightgreen and add your nickname to this row on the wiki page [17:39] [17:39] should we also talk about the requirements for joining ubuntu-bugcontrol? [17:40] I suggest moving this to tomorrows sessions with bdmurray and pedro_, [17:41] as I'm definitely not the right person to talk about this [17:42] [17:42] Ok, if there are no questions left, [17:42] and if there is nothing to add [17:43] and, of course, jcastro has nothing to add, [17:43] I think we should all take a small break, [17:44] and wait for the next session [17:45] Thanks Markus for showing us bughelper! [17:50] jcastro, thanks for organizing this week!