[00:03] good night === IdleOne_ is now known as IdleOne [10:35] hi all === deegee_1 is now known as deegee === Knightlust is now known as Igorots [13:23] quit === Igorots is now known as Knightlust === Hutley_ is now known as Hutley [15:59] WELCOME TO THE LAST DAY OF UBUNTU DEVELOPER WEEK! [15:59] As you can see on https://wiki.ubuntu.com/UbuntuDeveloperWeek we have a bunch of GREAT sessions lined up for today [16:00] If you have any questions, please ask them in #ubuntu-classroom-chat and prefix them with QUESTION: [16:00] ie: QUESTION: Does Jono really just listen to Death Metal music? [16:01] and if you'd prefer not to ask questions in English have a look at the bottom of https://wiki.ubuntu.com/UbuntuDeveloperWeek - we have a couple of channels where you can ask questions in your native language :) [16:01] (and consider helping out there too) [16:02] ok... I just learned that our first speaker has trouble making it to the session [16:02] I'll make sure that he'll repeat the session some time later [16:02] I'm sorry [16:02] I'd suggest we make this a Question and Answer session [16:03] feel free to ask every development-related question you can think of during this session and I'll try to get you an answer :) [16:03] QUESTION: Does Jono really just listen to Death Metal music? === godzilla is now known as Guest57848 [16:03] Daviey: I'm afraid he almost exclusively listens to Death Metal. Sometimes there's some AC/DC too and sometimes some ABBA, but 95% Death Metal :) [16:04] I'm sure that jcastro can confirm that ^ [16:04] I can't neither confirm nor deny any ABBA listenage [16:05] do we have more questions about Ubuntu and Ubuntu development? anything that was unclear during the week? [16:05] QUESTION: should tabs be represented as 4 spaces or 8? Vi or Emacs? Hungarian notation? [16:05] mhall119|work: I guess that depends who you ask :-) [16:05] mhall119|work: if you mainly work with python, you might want to check out http://www.python.org/dev/peps/pep-0008/ which at least has something to say about spaces [16:06] QUESTION: Is there any advanced guide to packaging, for example many banarie packages out of one source package? [16:06] lbrinkma: if you worked your way through https://wiki.ubuntu.com/PackagingGuide I suggest check out http://www.debian.org/doc/debian-policy/ (Debian Policy) and http://www.debian.org/doc/maint-guide/ (Debian New Maintainer's Guide) [16:07] plus checking out a lot of source packages and see how they do it [16:07] I'm no expert, but a lot I know today I learnt from other packages and checking out what other maintainers did [16:07] that's one of the things I LOVE about Ubunt, everything is just an "apt-get source ..." away :) [16:08] Have you used 'Groundcontrol' yet and how do you see that being integrated into the community? [16:08] duanedesign56: I personally didn't [16:08] jcastro: ^ did you? [16:08] I saw the video [16:08] it's a nautilus integration thing for bzr [16:08] oh nice [16:08] does it integrate with olive (bzr-gtk)? [16:09] dholbach: he has mentioned bzr-gtk integration in a future release [16:09] I guess that answers the question :) [16:10] any more questions? [16:10] maybe something that wasn't explained due to time constraints? [16:14] QUESTION: in utilities that are developed "in-house" by (k)ubuntu, rather than just packaged, is there a proper QA cycle, or is it just an 'ok' from the dev followed by waiting for bug reports to flow in? [16:15] amichair: yes, although there's no strict one-QA-process-for-everything there's quite a lot of QA being done [16:16] tools like bazaar and launchpad which are mainly developed by Canonical engineers are developed through test-driven development and have extensive test-suites that are run for every merge [16:16] (and run several hours in the case of Launchpad AFAIK) [16:16] tools that actually are in Ubuntu, like upstart have testsuites too [16:17] http://mago.ubuntu.com/ is an approach to test desktop applications by test-driving them through the accessibility interface (IIRC) [16:17] the security and SRU team add test-cases for stuff that broke to ensure it doesn't break again [16:18] and we do quite a lot of certification testing and ISO testing of CD images [16:18] I'm sure I forgot heaps of things [16:18] jcastro: anything I missed? [16:19] I don't know anything about testing [16:19] #ubuntu-testing and #ubuntu-bugs and #ubuntu-qa are good places to talk about that [16:19] (and we had a session about automated server testing too! :) [16:19] QUESTION: I'm a Git/Github user, and am really comfortable with the system. I maintain a project on Launchpad and use bzr-git to import the existing repository. Should I switch to bzr, and if so, why? [16:20] donaldharvey: what you could easily do without having to switch tools is setting up a bzr in code.launchpad.net [16:20] erm sorry [16:20] a bzr import [16:20] that'd give people the opportunity to use code.launchpad.net to propose merges when they're used to using that already [16:21] I love using code.launchpad.net and made great experiences with new contributors who quickly "got it" and knew how it worked [16:21] That's what I'm doing currently, yeah [16:21] I have little experience with git to be honest, but a lot of good with bzr, so I'm probably the wrong person to talk to :-) [16:22] but the fine people in #bzr and #launchpad can probably give you some further advice [16:23] Are there any charts or graphs that show bug stats plotted over time? [16:23] jcastro: ^? [16:23] I know there are some on qa.ubuntu.com [16:24] let me see if I can spot them easily [16:24] not anything that isn't on qa.ubuntu.com [16:24] for large packages they have this [16:24] http://status.qa.ubuntu.com/qapkgstatus/knetworkmanager [16:24] as an example [16:25] but nothing that summarizes everything. [16:25] this would be good info to get started on [16:26] for example look at this one: http://status.qa.ubuntu.com/qapkgstatus/gnome-power-manager [16:26] oldest bug with status NEW: 446 days [16:26] that means someone either can't confirm the bug or it's been forgotten [16:27] jml mentions that he has this: http://people.canonical.com/~jml/lp-bugs/ [16:28] jcastro, it's a prototype that uses out-of-date data and is a chart of the bugs on Launchpad itself [16:29] jcastro, I'd be over the moon with ecstasy and joy if someone wanted to turn that into an actual page on Launchpad, and would be more than happy to help whoever wants to do it [16:29] graphing in general would be useful I think [16:29] heck yes. [16:33] as a newbie to Ubuntu developer, but someone who can program, where can I make the most impact and help Ubuntu? [16:33] breinera: awesome question! === R_ is now known as Guest24303 [16:34] the most important thing you need to have as somebody who wants to help out with Ubuntu is: a knack for making things work again, some patience, some humour and being a team player [16:34] I'd recommend having a look at https://wiki.ubuntu.com/MOTU/TODO for now until we managed to give http://daniel.holba.ch/harvest a facelift [16:35] we soon will have a nice overview over tasks that need some help and group them by packages and everything [16:35] until then it's this a bit ugly list of lists [16:35] so... what do we have there? [16:35] jcastro mentions 'bitesize' bugs [16:35] we tag bugs in Launchpad to indicate what kind of task there are [16:36] 'bitesize' for example indicates "this is a job to get started with" [16:36] 'update' means "this package needs updating to a new upstream version" [16:36] 'packaging' means "here's something wrong with the packaging" [16:36] etc. [16:36] I'd also be inclined to say that it's always most effective to follow your own interests [16:36] people tend to be more productive with things they care about [16:36] the list of official tags can be found here: https://wiki.ubuntu.com/Bugs/Tags [16:37] thanks cjwatson - absolutely agreed [16:38] Ok, maybe we should broaden the scope of the session somewhat and ask for some feedback about the whole week... what do you think about the week? what do you think went well, what didn't? [16:39] (if you still have questions, that's fine too) [16:41] Any feedback? [16:41] Any questions? :) [16:41] maybe requests for the next Ubuntu Developer Week? [16:43] or other development related classes outside of UBuntu Developer Week? [16:43] [QUESTION] i was wondering if theres a difference in focus over the development cycle, ie, work on merging, fixing bugs in ubuntu, or getting bugs fixed in debian [16:43] SevenMachines: definitely [16:44] one key decision is to try to land as many earth-shattering changes as early as possible so they can get tested and debugged most appropriately [16:44] also if you find out that Debian suffers from the same problem and you want to fix it there too, then early in the cycle is a good time for that [16:45] the later it gets in our cycle the more we exclusively focus on just fixing stuff [16:45] it doesn't make sense to first push the critical fix to Debian, wait for it to get included, then maybe sync or merge it again [16:45] http://people.canonical.com/~dholbach/cheatsheet.jpg tries to give a bit of an overview over release-cycle decisions [16:46] QUESTION: Any suggestions for running a successful Global Jam? Focus more on giving people the tools to help, versus actual triage and packaging? [16:46] jcastro: ^ you want to take that one? [16:48] dscassel: I'd try to do everything that the people want to do [16:48] dscassel: if some of them are very new to the processes and to Ubuntu they will need all the help they can get [16:48] https://wiki.ubuntu.com/Jams is a place to start [16:49] the key is to ask around for groups that have done jams in the past [16:49] so you don't make a simple mistake [16:49] I'm in the Ubuntu Berlin team and we made good experiences with splitting up stuff among team members: one organises bug triage efforts, somebody else does packaging, etc. [16:49] for example our first jam we did in a bar and then didn't realize that under-21 people couldn't attend! [16:50] now we have that in a wiki page so people don't repeat our mistake [16:50] haha :) [16:51] more questions? more feedback? more requests? [16:55] ok my friends, thanks a lot for your questions [16:55] let's all take a 5 minute break before cjwatson is up with "Doing merges right!" [17:00] Next up is the incredible and unstoppable Colin Watson, talking to us about "Doing merges right!" [17:00] * cjwatson fusses around a bit looking for his notes. :-) [17:00] Hi, I'm Colin Watson, from the Ubuntu Foundations team, and this talk is called "Doing Merges Right". [17:00] You can ask questions at any time in #ubuntu-classroom-chat. Please write QUESTION at the beginning of your question so I can see it more easily. I'll stop at the end of a section and answer some questions. [17:01] This session is mostly for people who've never done merges before and want to know how to do it properly, though it will help if you know what a patch looks like. [17:01] If you already know how to do merges, though, consider listening in anyway. I'm going to describe up-to-date tools that not everyone will already be familiar with, and I'll cover a few common mistakes along the way. [17:01] Apologies to the desktop folks, but this is unashamedly a terminal-based session. It is not full of sexy slides and whizzy graphics, because I don't do those. Love The Terminal. The Terminal Is Your Friend. [17:01] To follow along with this talk, you should install the bzr, bzr-builddeb, and ubuntu-dev-tools packages. Make sure that bzr is version 2.0 or better; karmic's is fine. [17:01] WHY [17:01] Every time we open a new development release of Ubuntu, we need to merge our changes with those made in Debian. [17:02] Not everyone finds this exciting, but it's really important; it keeps our repository up to date with the rest of the free software world, and it gives us an opportunity to audit the changes we're carrying and discard ones that don't make sense any more. [17:02] Since we have a lot of packages and a relatively small number of developers, it's important that we have some common understanding of how to go about this. [17:02] Plus, half the time you end up merging something you haven't worked on for months if at all, so some basic habits come in handy ... [17:02] In this session, I'm going to run through an example merge using a couple of different methods. [17:02] WHEN [17:02] http://merges.ubuntu.com/ is your friend for finding things to do. The lists are divided into a section for packages that haven't been uploaded so far this release, and a section for packages that have been touched but still have a newer version in Debian. The first section is usually more important. [17:02] Each merge has a "last uploader" recorded alongside it. [17:03] The last person who uploaded the package is the default assignee for each merge. We sometimes call this the "touched it last" method - you touched it last, it's yours! [17:03] You must always contact the last uploader before doing a merge; please don't just run down the list and submit lots of merges for sponsorship. [17:03] This is a convention to try to avoid duplicate work. You may also often find that the assignee for a merge has a reason for not just going ahead and merging (perhaps some other package needs to be adjusted), so always talk to them first. [17:03] That said, people often welcome help with their merge workload as long as they're told about it, so don't be shy about asking. [17:03] We expect all packages to have been merged at least once by Debian Import Freeze (see https://wiki.ubuntu.com/ReleaseSchedule) and after that point we don't actively try to keep the merge lists short. [17:04] After Feature Freeze, you have to have a good reason for doing a merge, not just "it was on the list", so expect to be asked searching questions by your sponsor if they can't see why you bothered. :-) [17:04] HOW [17:04] I'm going to go through the same example in two different ways. Firstly, I'm going to use Bazaar, the revision control system used for (among other things) a good deal of Ubuntu development. Secondly, I'm going to do things the old-fashioned way. [17:04] Bazaar is really much better at dealing with merges, since that's one of the core functions of a revision control system! For the example here, it doesn't make so much difference, but it gets more obvious with more complicated packages. [17:04] The Bazaar workflow isn't so extensively covered in MOTU documentation, so I'm going to spend a bit more time on it. [17:04] However, we're still in the process of rolling this out for all packages, and it doesn't quite all work yet. Sometimes you need to fall back to the old-school method to get your work done. [17:05] Don't worry too much about having to do this; the automatic imports will catch up even if you do your work outside Bazaar. [17:05] But first: [17:05] THE TAO OF MERGING [17:05] 1. Keep Ubuntu changes as small as possible. If Debian fixes the same bug in a different way, use their fix and discard ours unless it's clearly better in some way. [17:05] 2. Send changes upstream or to Debian whenever possible. We don't really want to maintain big divergent patches in Ubuntu if we can avoid it; unless things are truly Ubuntu-specific, it's always better to pass them up so that the rest of the free software world can use our improvements too. You can use the 'submittodebian' script to help with this. [17:05] 3. Sync with Debian whenever possible. When following these directions, if you find that there are no Ubuntu changes left, then stop! Request that the package be synced instead: https://wiki.ubuntu.com/SyncRequestProcess [17:05] 4. Write good changelogs that explain what changes we're still carrying in Ubuntu. This makes it easy to look at a package and quickly see how the Ubuntu version differs. [17:06] Any questions before I dive into our first example? [17:06] Shout if I'm going too fast. [17:07] 17:06 QUESTION: what do background colours in MoM mean? [17:07] It's odd that this isn't documented anywhere ... [17:07] (at least as far as I can see) [17:07] Anyway, the colours refer to the Priority field of the package. [17:08] Red is required, sort of orange/yellow is important, light green is standard, mid-green is optional, dark green is extra. [17:08] This is just a heuristic to try to sort more important packages to the top of the list. [17:08] It doesn't refer to the importance of the *merge*, which can't be determined automatically, but it helps. [17:09] (I think I might have the precise colour/priority mapping a little wrong, but you get the idea!) [17:09] OK, I'll carry on. [17:09] BAZAAR [17:09] I'm going to use a simple merge that's currently outstanding as an example: ipmitool. [17:09] Look at https://merges.ubuntu.com/universe.html and (if it hasn't been merged yet by the time you read this) you'll see ipmitool there, with Chuck Short's name against it as the last uploader. [17:09] Normally, you can access current branches for Ubuntu and Debian packages at lp:ubuntu/SOURCE or lp:debian/SOURCE respectively, where SOURCE is the source package name. [17:10] (You can use 'bzr lp-open' to look at these in a web browser, too.) [17:10] These are special aliases that expand to five-level names; for instance, lp:ubuntu/ipmitool is currently lp:~ubuntu-branches/ubuntu/lucid/gnu-fdisk/lucid. This breaks down as (owner, distribution, release, source package, branch name). [17:11] err, s/gnu-fdisk/ipmitool/ obviously! Sorry, error in my prep ... [17:11] Debian branches currently expand to .../debian/squeeze/..., since for the Lucid development cycle we're merging from Debian testing, not unstable. This may change in future. To get branches corresponding to unstable, use lp:debian/sid/SOURCE. [17:11] In order that the transcript of this talk will continue to be useful for some time to come, I've taken copies of the current state of the Ubuntu and Debian branches for ipmitool, and pushed them to Launchpad, using my own Launchpad username as the owner. Anyone can push whatever they like this way, as long as it meets the Launchpad terms of use. === l is now known as Guest68800 [17:11] lp:~cjwatson/ubuntu/lucid/ipmitool/udw [17:11] lp:~cjwatson/debian/squeeze/ipmitool/udw [17:11] BAZAAR: STARTING THE MERGE [17:11] Let's prepare to do our example merge. [17:11] Make a new directory and cd into it. Type 'bzr init-repo .', which should respond with a few lines starting "Shared repository with trees (format: 2a)". This is optional, but it means that any branches we create under here will share common storage for their revisions, which saves you both disk space and network bandwidth when you have several branches with shared history. [17:12] Fetch the branches we want to merge like this: [17:12] bzr get -r7 lp:~cjwatson/ubuntu/lucid/ipmitool/udw ubuntu [17:12] bzr get lp:~cjwatson/debian/squeeze/ipmitool/udw debian [17:12] (Normally, of course, this would be lp:ubuntu/ipmitool etc., and we pick a specific revision of the Ubuntu branch here because the next revision has the results of the merge.) [17:13] If you've used Bazaar before, you may be reaching for 'bzr merge' about now. bzr-builddeb provides a 'bzr merge-package' command, which we're going to use instead. I'll explain the difference later on. [17:13] Let's try merging the Debian changes into the Ubuntu branch. Bazaar will automatically start from wherever the two branches you're working on diverged; you don't need to tell it "merge from 1.8.11-1 up to 1.8.11-2". [17:13] $ bzr merge-package ../debian [17:13] Text conflict in debian/changelog [17:13] Text conflict in debian/control [17:13] Text conflict in debian/patches/series [17:13] 3 conflicts encountered. [17:13] The merge resulted in 3 conflicts. Please resolve these and commit the changes with "bzr commit". [17:13] BAZAAR: CONFLICTS [17:14] That was easy, wasn't it? Shame about the conflicts. Type 'bzr status' and you'll see what this has left in your working tree. Incidentally, you can get detailed help on any Bazaar command using 'bzr help COMMAND'. [17:14] (I'll pause for a bit here to let anyone following along catch up with the commands) [17:15] 17:15 i'm getting 'bzr get lp:~cjwatson/debian/squeeze/ipmitool/udw debian [17:15] 17:15 sorry, bzr: ERROR: unknown command "merge-package" [17:15] SevenMachines: You need to install the 'bzr-builddeb' package. [17:15] 17:01 <@cjwatson> To follow along with this talk, you should install the bzr, bzr-builddeb, and ubuntu-dev-tools packages. Make sure that bzr is version 2.0 or better; karmic's is fine. [17:18] presentation syndrome here, just fixing up the branch :-) [17:20] I've fixed the broken example Ubuntu branch now, so try again if you had trouble earlier. [17:21] so, carrying on ... [17:21] Looking at 'bzr status', this has changed four files, only one of which was entirely without incident (the new file debian/patches/passwd_option). Let's look at each of the three conflicts. I normally do debian/changelog last, since it's the summary of everything else I've done. [17:21] In each file with a conflict, you'll see "<<<<<<<", "=======", and ">>>>>>>" markers. These are placed each time Bazaar finds a part of the file that's changed on both sides of the merge. [17:21] The section between "<<<<<<<" and "=======" shows that part of the file in the current branch, and the section between "=======" and ">>>>>>>" shows that part of the file in the branch you're merging from. [17:21] You're expected to remove the markers once you've resolved the conflict. [17:21] Edit debian/control and you'll see markers around Maintainer and Build-Depends lines. Bazaar has left some files around that you can use to figure out what the change from the base revision on each side was: [17:22] diff -u debian/control.BASE debian/control.THIS [17:22] diff -u debian/control.BASE debian/control.OTHER [17:22] So in fact just the Maintainer lines changed on the Ubuntu side, and only the Build-Depends line changed on the Debian side. We can safely take the XSBC-Original-Maintainer and Maintainer lines from our side and the Build-Depends line from the Ubuntu side. Bazaar errs on the side of caution when changes are very close together in a file like this. [17:23] Save this and move on to debian/patches/series. Here we have a real conflict: one line was added on the Ubuntu side, and a different line on the Debian side. [17:23] However, if we look at the patch files in debian/patches/ that these lines are referring to, we can see that they touch totally different files and do completely different things, so we should just keep both. [17:24] (In my sample merge, I did this by moving the Ubuntu patch below the Debian one, so that all the Ubuntu work was "on top" at the end. In this case it isn't really important though.) [17:24] Now for debian/changelog. This will get more automatic in future, but for now you usually just get a big conflict with the Ubuntu changelog on one side and the Debian changelog on the other. Edit this so that the changelog entries come in version order (1.8.11-1ubuntu1 is less than 1.8.11-2, so it should come further down the file. [17:25] Now that we've gone through all the files, we can tell Bazaar that we've done so. Type 'bzr resolve'. (You normally don't need to tell it which files you've resolved; it will look at all the conflicted files and see if any conflict markers are still there.) In this case it says "All conflicts resolved" and we can be happy; otherwise we might need to go back for another look. [17:25] CHANGELOG [17:25] We're done now, right? Er, not quite. We still need to write a changelog entry for our merge. You can use 'dch -i' to create a skeleton one. [17:25] The style of this new changelog entry is important. It should describe all the important changes that are still present in Ubuntu after merging from Debian. [17:25] You don't need to list details that are intrinsic to it being an Ubuntu upload; don't clutter up changelogs with comments about Maintainer field changes, for instance. [17:26] You don't necessarily need to list any changes that you've dropped (if they've been merged into Debian, say) unless there's something particularly interesting about this. [17:26] Normally, you should try to focus on the *functional* changes ("Add widget creation ability") rather than painstakingly listing every file that's changed. The revision control system can tell people about the latter if they really care. [17:26] If the previous merge changelog entry matches whatever your personal standards of clarity are, then you can just copy and paste it. In this case (with due respect to the previous merger, who seemed to have a complicated job on his hands!), I chose to write my own: [17:26] ipmitool (1.8.11-2ubuntu1) UNRELEASED; urgency=low [17:26] * Merge from Debian testing. Remaining changes: [17:26] - Add Dell-specific commands. [17:26] -- Colin Watson Fri, 29 Jan 2010 12:59:16 +0000 [17:27] (there were some more blank lines in there, lost in the process of pasting into IRC; fill them in mentally) [17:27] If there are any merge bugs in Launchpad, remember to close them here, using the "(LP: #NNNNNN)" syntax. [17:27] BAZAAR: FINISHING OFF [17:27] Have a look at your changes to make sure they're sensible. 'bzr status' shows a summary. 'bzr diff' shows the detailed patch you're about to commit, relative to what's currently in Ubuntu. You might also want to check the resulting Ubuntu changes relative to what's in Debian; for that, use 'bzr diff --old ../debian'. [17:28] Of course there's lots more stuff you can do here - you can use the full power of the revision control system. See online documentation for more. [17:28] All is well, so we can commit. The changelog says UNRELEASED, so this is marked as a work in progress, but we might as well record what we've done. [17:28] bzr commit -m 'merge from Debian 1.8.11-2' [17:28] Bazaar won't let you commit if there are still unresolved conflicts, which is a great protection against accidents. [17:29] Note that Bazaar doesn't commit merges automatically if they succeed; you still have the opportunity to look over them and make sure you're happy before actually changing your branch. [17:29] Let's now try building our package. Install the build-dependencies if you need to, and then type 'bzr bd' (short for builddeb). (This is like debuild, and in fact you can use debuild if you're careful and know what you're doing, but 'bzr bd' is a bit smarter about some details of Bazaar branches.) [17:29] Have a look at the top of the output. You'll notice that we never downloaded ipmitool_1.8.11.orig.tar.gz, but it finds it anyway because James Westby is a GENIUS. [17:29] Actually, the automatic package imports store enough data in each branch to be able to reconstruct the original source tarball. They use 'pristine-tar' for this, which is quite space-efficient. [17:30] 'bzr merge-package', and its relatives, 'bzr import-dsc' and 'bzr merge-upstream', take care of details like this, which is why it's worth using them rather than plain 'bzr merge'. [17:30] (They also make sure that there's something in the history representing each upstream release. If you want the details, look at 'bzr log -n0'.) [17:30] Now, as it happens, my package fails to build due to some horrible disagreement between autoconf and libtool. But dealing with autotools problems is a subject for another talk! [17:30] If you need to fix something like this, you can do so in a separate commit from the main merge; that way people can easily see the new changes you've made in the history. Make sure to document any new changes like this in debian/changelog. [17:31] Let's pretend it all worked, and I want to build a package for upload to Ubuntu (or perhaps to a PPA). [17:31] Run 'dch -r' to finalise the changelog, and 'bzr bd -S -- -v1.8.11-1ubuntu1' to build a source package. [17:31] The '-v1.8.11-1ubuntu1' bit says that you want all the changelog entries since 1.8.11-1ubuntu1 to end up in the .changes file. This means that people following along with the lucid-changes mailing list will get complete information about what changed, rather than just the relatively uninformative merge changelog entry. [17:32] If there's a new upstream version not already in Ubuntu, you'll need the -sa option as well to upload the .orig.tar.gz. [17:32] Assuming this works, you can look at the result in the parent directory. I'd recommend using 'debdiff' to compare your source package both to the last version in Ubuntu and to the version in Debian that you're merging. You don't need to be too obsessive about this, but a quick debdiff check has caught a lot of basic errors in the past. [17:32] 17:32 cjwatson: [QUESTION]: What was the repo-init thing for at the beginning? [17:33] 'bzr init-repo .' sets up a shared repository. This means that, instead of having to store all the revisions for the Ubuntu branch and all the revisions for the Debian branch separately, you can store them in the common repository since actually several of them are just the exact same revisions. [17:34] It also means that you don't have to download those revisions twice, which saves a couple of megabytes. If your connection to the Internet is anything like mine, you might value this! [17:34] (carrying on) [17:34] If it all works, then 'debcommit -r' (this commits and tags), and upload! [17:34] You can push stuff to personal branches on Launchpad for review using 'bzr push lp:~YOURUSERNAME/ubuntu/lucid/SOURCE/BRANCH-NAME', and set up a merge proposal. [17:35] Using the merge proposal, you can generate debdiffs for bug reports in case your sponsor prefers that. [17:36] I have more links on this sort of stuff for further reading at the end, but any questions on the Bazaar section of this session before I carry on? [17:36] 17:36 [QUESTION]: How can I haXX0r bzr to work like git when using bzr log. (It does the same horrible thing as svn, showing the first revisions instead of the recent ones and backscrolling is not always possible) [17:36] sebner: I'm not sure I understand your first problem, as bzr log shows the most recent revisions first [17:36] as does git log [17:37] but you can do 'bzr log --forward' if you want to change that [17:37] if you want a pager, | less :-) [17:37] It's often helpful to use 'bzr log -n0', which shows all merged revisions as well. [17:42] also 'bzr alias' is a generally useful thing to know about, for when you want to change a command's default options, or even add a new command that's more to your liking. [17:42] 17:42 I usually do "bzr ci" and "bzr mark-uploaded" instead of "debcommit". Should I switch to debcommit or doesn't it matter? [17:43] geser: debcommit saves you from having to type commit messages again in many cases. Aside from that, right now in practice they're equivalent. [17:44] If you work with lots of different revision control systems, debcommit acts as a partial abstraction layer, which I find moderately useful. But it's mainly avoiding having to type the same thing into the changelog and the commit log editor that I find useful. [17:45] 17:43 [QUESTION]: How many % of the archive is already usable with such branches and actually being used currently [17:46] I don't have a percentage figure (maybe jml does, or james_w if he's watching?), but coverage has got to the point where if you're comfortable with the workflow it's worth trying. [17:46] http://package-import.ubuntu.com/failures/ has a log of current import failures. [17:47] (which is a bit longer than I remember, I wonder if there's some systemic problem right now) [17:47] cjwatson, Last time james_w told me it was in the high 90s. [17:47] the main thing people are likely to run into is that it doesn't handle some cases of dpkg v3 source packages right now. I expect this will be fixed pretty soon. [17:47] Anyway, I'd better move on now as I have 13 minutes left. [17:47] OLD-SCHOOL [17:47] It turns out that it's kind of hard to import lots of versions of 15000-odd packages from two different distributions and get all the bits lined up properly. Who'd have thought? [17:47] Eventually this will settle down, but for now you'll still need to do things by hand every now and then. [17:48] merges.ubuntu.com can help with this. https://merges.ubuntu.com/i/ipmitool/REPORT shows the results of an automatic merge, and you'll see that there were a few conflicts, basically just what we went through above. [17:48] You can use 'grab-merge ipmitool' to get all the files. This gives you an 'ipmitool' directory with lots of files in it, including an 'ipmitool-1.8.11-2ubuntu1' subdirectory with the best that merge-o-matic could manage. [17:48] As before, you should go through and resolve the conflicts. There's no equivalent to 'bzr resolve', though also no protection against accidentally leaving conflicts around; you have to keep track of this yourself. [17:48] merge-o-matic has merged the changelogs for you, but you still need to write a changelog entry, as before. Make sure to change the changelog trailer line to your name and e-mail address rather than "Ubuntu Merge-o-Matic ", or risk embarrassment! [17:48] Type '../merge-buildpackage' when you're done. This is like the 'bzr bd -S' bit above. Then unpack the source package somewhere and check that it builds. [17:49] Please use debdiff to make sure your changes against both Debian and Ubuntu make sense. This is much more important when you aren't using Bazaar, because you can't use 'bzr diff' to check each individual change you're making, and it's possible to leave conflicts in by mistake. [17:49] To get a sponsor to look at this, you'll need to generate debdiffs against both Debian and Ubuntu, attach them to a merge bug, and subscribe either ubuntu-main-sponsors or ubuntu-universe-sponsors as appropriate. There's more detail on this in the MOTU wiki area. [17:50] And remember: if you're actually going to ask for sponsorship for this merge, you should still check with the previous uploader, even though I used it as an example for this session! [17:50] FURTHER READING [17:50] For more details on merge proposals, see https://wiki.ubuntu.com/DistributedDevelopment/Documentation/Merging, and https://wiki.ubuntu.com/DistributedDevelopment/Documentation for general docs on using Bazaar for Ubuntu packaging. [17:50] For general advice on merging (particularly "old-school"), see https://wiki.ubuntu.com/UbuntuDevelopment/Merging, which has more detail than I could fit into this session. [17:50] FUTURE [17:50] Ultimately, we want to get to the point where every upstream has a Bazaar import, every Debian package has a Bazaar branch matched up with that import, and every Ubuntu package has a Bazaar branch matched up with both of those. [17:50] The closer we get to this, the easier it will be to merge code between upstream, Debian, and Ubuntu. We have this for a few select packages already: I handle grub2 and openssh this way and it's lovely. [17:51] If you want to help get us there for more packages, please join https://lists.ubuntu.com/mailman/listinfo/ubuntu-distributed-devel. [17:51] Thank you for following along, and happy merging! [17:51] Any questions? [17:51] 17:51 [QUESTION]: Are there any consequences when using bzr to work on a package, then another(?) developer merges some new versions/revisions by hand and then you decide to merge the newest version again with bzr? [17:51] The automatic import script is reasonably clever (although it could be improved). [17:52] If it tries to import and finds that there are more revisions beyond the last thing it did, it imports, but moves the "conflicting" revisions aside and files a bug on the 'udd' project about them. [17:52] The main thing that's lacking from this right now is good notification to the people responsible for those changes. [17:52] But at least nothing is lost. [17:53] If you make changes in bzr and *do* upload them, then as long as you tag your upload the automatic importer will take that as evidence that that's a good representation of that version. [17:54] So if I uploaded 1.8.11-2ubuntu1 from the ipmitool example above and pushed my changes to lp:ubuntu/ipmitool, and then somebody else uploaded 1.8.11-2ubuntu2 without using bzr, that would all work fine - the automatic import would work on top of my changes. [17:54] 17:51 QUESTION: With all the tools that exist today. Is it significantly easier to merge and patch Debian packages? I have a feeling that aspiring maintainers may be overwhelmed by the multitude of "bzr action" commands, along with the traditional "dpkg" tools. [17:55] So, there's always a learning curve, and it's certainly a bit difficult in a transitional period when you have to learn two sets of tools. [17:55] However, hardly any serious upstream project works without revision control. [17:55] So I think it's quite justifiable to try to move Ubuntu to having consistent revision control - in fact I think the end result will be much less confusing. [17:56] My experience is that once you've acquired basic familiarity with the relevant revision control tools, merging and patches is much, much less time-consuming, and the error rate is much lower. [17:57] I also hope that ultimately it will be easier to build ways to encourage aspiring developers this way. When you get right down to it, having to send repeated versions of debdiffs around isn't all *that* great either ... [17:59] Thanks again. If you have other questions, feel free to ask me directly or on #ubuntu-devel or #ubuntu-motu. [17:59] I'll hand over now to Jonathan Lange, a gentleman and a scholar, who's going to be talking about launchpadlib. [17:59] cjwatson, why thank you [18:00] as before, please stop me if I go too fast, or hassle me if I go too slow [18:00] You might know already, but pretty much no matter what kind of Ubuntu development you are doing, you'll have to interact with Launchpad [18:00] Interacting with Launchpad is fun and all, but sometimes you'll want a computer to do the interaction for you [18:00] Say you want to suck out some of the data and make a pretty graph [18:00] or you want to build a site like http://qa.ubuntu.com/ [18:00] This session should help you do that... [18:00] Before we begin, you should install the 'python-launchpadlib' package now. [18:01] Confirm that it works by running: [18:01] $ python [18:01] and then [18:01] >>> import launchpadlib [18:01] >>> launchpadlib.__version__ [18:01] you should get output like: [18:01] '1.5.1' [18:01] if it's an earlier version, then you need to either update the package, upgrade to a newer version of Ubuntu, or find the PPA. [18:01] A moment for those installing the package [18:01] Moment over. [18:01] This session is going to have four parts: theory, example, gotchas and future. [18:02] = 1. Theory = [18:02] The Launchpad developers implemented an API for three reasons: [18:02] 1. To let you get at your data [18:02] 2. To allow you to do project-specific policy stuff [18:02] 3. To watch people do cool things we would never have thought of. [18:02] (I'm a Launchpad developer, hence the 'we') [18:02] We decided to implement the API using something called RESTful Architecture [18:02] http://en.wikipedia.org/wiki/Representational_State_Transfer [18:03] This means that Launchpad's APIs are actually language neutral [18:03] in theory, you can write code to control Launchpad in any language you want [18:03] without screenscraping! [18:03] You do HTTP requests with operations like GET, POST, PUSH and DELETE and send and receive JSON content that's described by a WADL file [18:03] WADL == http://en.wikipedia.org/wiki/Web_Application_Description_Language [18:03] Which is all nice and wonderful but you don't really have to care about it, because there's also a Python library [18:03] called "launchpadlib" [18:04] (have you installed it yet?) [18:04] If you don't care at all about Python, now's the time to stop following this session and go to https://help.launchpad.net/API instead [18:04] Because I'm about to go into the example. [18:04] = 2. Example = [18:04] You can follow along from this example by getting the branch at lp:~jml/+junk/bugstats [18:04] You do that by running 'bzr branch lp:~jml/+junk/bugstats' [18:04] The way to follow along is to change into that branch, and then run 'bzr revert -r 1' [18:04] and then when I say "Next revision", do the same thing with "-r 2" instead [18:04] and so on [18:05] bzr revert -r1 [18:05] The branch contains a single file 'bugstats.py' [18:05] If you look at that file in your favorite text editor, you'll see that it's very very simple [18:05] It imports sys, defines a main function that does nothing, and then runs that main function. [18:05] Go ahead and run it now [18:05] $ python bugstats.py [18:05] It should do absolutely nothing, fairly quickly [18:05] (at the speed of PYTHON!) [18:05] OK. Next revision [18:06] bzr revert -r2 [18:06] (sorry alt-tab fail) [18:06] Have a look at this version of bugstats.py. You might need to reload it in your editor. [18:06] This is an extremely simple launchpadlib script [18:06] It logs in to launchpad and prints out the title of bug number one [18:06] I'll break down exactly what the script does in a moment. [18:06] But first, you should run the script. [18:06] $ python bugstats.py [18:06] When you run it, an authorization page will open up in your web browser [18:07] This is very important, this is how your Launchpad web credentials get applied to the application [18:07] It's done using oauth, which I don't understand. [18:07] http://oauth.net/ and http://en.wikipedia.org/wiki/OAuth are probably good places to start though. [18:07] For now, pick "Read non-private data" [18:07] Then, switch back to your terminal and press enter. [18:07] The script should then print the title of bug number one. [18:07] Run the script again [18:07] Notice that launchpadlib has cached your credentials [18:08] launchpad = Launchpad.login_with(APP_NAME, SERVICE_ROOT, CACHE_DIR) [18:08] ^^^ that's the line of code what did it [18:08] if you look at the script... [18:08] you'll see I've imported 'os' and 'sys', which are standard Python modules. [18:08] I've also imported 'Launchpad' and 'STAGING_SERVICE_ROOT' from launchpadlib [18:08] Then I've defined an application name, a caching directory and a service root [18:08] APP_NAME = 'jml-bug-stats' [18:08] CACHE_DIR = os.path.expanduser('~/.launchpadlib/cache') [18:08] SERVICE_ROOT = STAGING_SERVICE_ROOT [18:08] There's nothing special about the names of the variables, I've just made them ALL CAPS to hint that they are constants [18:08] APP_NAME is the name of the application. launchpadlib & Launchpad use this as a marker for authorization. You authorize an application based on its *name*. [18:09] Go to https://staging.launchpad.net/people/+me/+oauth-tokens and search for "jml-bug-stats" [18:09] you'll only find it if you actually ran the script [18:09] if you have run the script, you should find it there, saying when you authorized it and what you authorized it to do [18:09] You could revoke the authorization if you wanted to, but you shouldn't do that just now [18:09] Anyway, that 'jml-bug-stats' is the app name used in the script. [18:10] SERVICE_ROOT is _which_ Launchpad.net instance to use [18:10] does everyone know about staging.launchpad.net, edge.launchpad.net and so forth? [18:10] ... [18:10] that's a yes. [18:10] Today, we're using staging. Testing against staging is a good idea, since it's impossible to mess up your live production data by messing with staging. [18:10] CACHE_DIR is the place where launchpadlib stores cached credentials and cached json objects [18:11] It's worth having a poke around in it sometime [18:11] most apps use ~/.launchpadlib/cache [18:11] for reasons that escape me [18:11] If you run ls -l ~/.launchpadlib/cache/api.staging.launchpad.net/credentials/ you should see a file called 'jml-bug-stats' [18:11] That file contains the cached credentials for this app [18:11] If you delete it, you'll have to re-authorize the application [18:11] moving on to the script proper. [18:11] The main() function has us logging into Launchpad and printing a bug title [18:11] login_with is a handy convenience function that logs in with an application name, but looks in the cached credentials first to see if you've already logged in. It returns an instance of 'Launchpad' [18:11] 'launchpad' is an object with a bunch of pre-defined top-level collections, and is the starting point of any launchpadlib app. [18:12] https://help.launchpad.net/API/launchpadlib#The%20top-level%20objects will list all of them for you [18:12] Here we use 'bugs', get the bug with id '1' and print its title. [18:12] $ python bugstats.py [18:12] Microsoft has a majority market share [18:12] Easy [18:12] Now for something a bit more useful [18:12] Next revision [18:12] bzr revert -r3 [18:12] $ python bugstats.py [18:12] Please specify a project and a username. [18:13] $ python bugstats.py ubuntu jml [18:13] Jonathan Lange has had 2 bugs fixed on Ubuntu [18:13] it shows the number of bugs someone has had fixed [18:13] useful, huh? [18:13] take a look at the code [18:13] It's got a work-around for a bug in launchpadlib to get the length of a returned collection. [18:13] I don't really understand why the bug isn't fixed yet, since it's got to bite almost everyone who writes a non-trivial launchpadlib application. [18:13] Anyway, this script is more advanced than the last one. [18:14] look at ... [18:14] pillar = launchpad.projects[pillar_name] [18:14] "Pillar" is Launchpad developer jargon for a distribution, project or project group. e.g. ubuntu, gnome-do or gnome [18:14] you can try running the script with your username and fave project [18:14] The script takes the pillar name from the command line, along with a bug reporter name, finds all of the 'fix released' bugs and then prints out a friendly message. [18:14] reporter = launchpad.people[reporter_name] [18:14] fixed_bugtasks = pillar.searchTasks( [18:14] bug_reporter=reporter, status=['Fix Released']) [18:15] If I run it with this: [18:15] $ python bugstats.py launchpad-code jml [18:15] I get: [18:15] Jonathan Lange has had 164 bugs fixed on Launchpad Bazaar Integration [18:15] To me, the most interesting thing about this script (apart from the cool data) is "how did I figure out to call 'searchTasks'?" [18:15] Well, each of the Launchpad instances has generated API documentation at +apidoc [18:15] e.g. https://staging.launchpad.net/+apidoc/ [18:15] or e.g. https://edge.launchpad.net/+apidoc/ [18:15] I happen to know a bit about the Launchpad object model, and knew I'd need to get a bunch of "bug tasks" [18:16] A bug task is that row in the table that has an assignee, status, importance etc. A bug can have many bug tasks. [18:16] I went to the API documentation page and had a look around for something that would return a list of bug tasks. [18:16] I found "searchTasks", and then gave it a try and it worked [18:16] The API documentation also told me that people have display_name attributes and that projects do too. [18:16] Note that the API documentation is *not* launchpadlib documentation. It's generic REST API documentation. [18:16] That means you often need to translate from the abstract REST docs into concrete Python. It's not that hard. [18:16] Anyway the script is pretty simple [18:16] QUESTION: does python-launchpadlib also clean up the cache of old unused files? [18:16] geser, No, it does not. [18:17] geser, as far as I'm aware, there's absolutely no functionality in launchpadlib for removing cache files under any circumstances [18:17] The next revision is something a little bit more complex [18:17] bzr revert -r4 [18:17] This script does almost exactly the same thing, except it tells you how successful the reporter was as a percentage of bugs fixed over bugs filed [18:18] The new code is the total_bugtasks line, which finds all bugs of any status [18:18] fixed_bugtasks = pillar.searchTasks( [18:18] bug_reporter=reporter, status=['Fix Released']) [18:18] total_bugtasks = pillar.searchTasks( [18:18] bug_reporter=reporter, [18:18] status=[ [18:18] "New", [18:18] "Incomplete", [18:18] "Invalid", [18:18] "Won't Fix", [18:18] "Confirmed", [18:18] "Triaged", [18:18] "In Progress", [18:18] "Fix Committed", [18:18] 'Fix Released']) [18:18] zoiks! [18:18] (I thought I had my newlines done differently) [18:19] I had to specify each status manually, because 'searchTasks' defaults to only finding open bugs [18:19] Then there's some code to calculate a percentage and print it out nicely [18:19] percentage = 100.0 * length(fixed_bugtasks) / length(total_bugtasks) [18:19] print "%s is %.2f%% successful on bugs in %s" % ( [18:19] reporter.display_name, percentage, pillar.display_name) [18:19] Let's try running it! [18:19] $ python bugstats.py ubuntu jml [18:19] Jonathan Lange is 22.22% successful on bugs in Ubuntu [18:19] $ python bugstats.py launchpad-code jml [18:19] Jonathan Lange is 56.16% successful on bugs in Launchpad Bazaar Integration [18:20] Again, you can try it with yourself, or with a friend, or with cjwatson [18:20] That's all I have for the example. [18:20] = 3. Gotchas = [18:20] There are quite a few things that can trip you up with the Launchpad API [18:20] We've already bumped into a couple of them: it's got bugs. [18:20] https://bugs.edge.launchpad.net/launchpadlib/ for more info on that [18:21] The second is that even though it does have documentation, it's not always easy to apply to what you need. [18:21] (wtf, "Colin Watson is 79.65% successful on bugs in Ubuntu"!) [18:21] I'm going to pimp http://help.launchpad.net/API again, since there really is a fair chunk of good documentation there. [18:21] https://help.launchpad.net/API/Examples is good, as is https://help.launchpad.net/API/launchpadlib [18:21] However, the docs often aren't up to scratch. [18:22] There is only one way for them to get better [18:22] People like your good selves must ask questions, get answers, and then edit the help.launchpad.net wiki. [18:22] Another gotcha is error messages. [18:22] Because launchpadlib is a very, very thin wrapper over a generic RESTful client library, if ever you get an exception raised, it's going to be really unhelpful. [18:22] https://help.launchpad.net/API/Examples#Get%20a%20useful%20error%20message%20from%20launchpadlib shows the work-around. [18:22] I think I filed a bug about that. [18:23] hmm. [18:23] there's another gotcha, which is *performance* [18:23] For a lot of the things you probably want to do, you'll end up writing code that looks like this: [18:23] for thing in bunch_of_things: [18:23] thing.do_something_on_launchpad() [18:23] Code like this is really really slow [18:23] It'll do an HTTPS request for each 'thing' [18:23] We'd like to have some way of reducing that load, but we don't have any good answers yet [18:23] Only two more gotchas left :) [18:23] Not everything that's in Launchpad itself is exposed via the API. [18:23] Sorry. [18:23] It's generally either really, really easy to expose stuff over the API or almost impossible. [18:24] If the thing you want falls into the first category, you can probably patch Launchpad yourself. [18:24] In any case, *file a bug*. Everything that's not exposed over the API is a bug. [18:24] Last gotcha: testing launchpadlib apps is hard [18:24] jkakar has done some work on this recently [18:24] but I haven't had a chance to look at it. [18:24] That's it on the gotchas: bugs, docs, errors, potato programming, unexposed methods, testing [18:25] = 4. Future = [18:25] There are plenty of other examples of launchpadlib apps out there [18:25] bughugger uses launchpadlib (https://launchpad.net/bughugger) [18:25] quickly has some templates for using launchpadlib (https://launchpad.net/quickly) [18:25] The code that puts branches in https://code.launchpad.net/ubuntu is done entirely with launchpadlib (we talked about those branches last session!) [18:25] There's also a stack of projects that are part of a group called 'lpx' that you can find at https://launchpad.net/lpx [18:25] and at http://help.launchpad.net/API/Uses there's even more stuff [18:25] If ever you need help, ask on #launchpad or #launchpad-dev on freenode or send an email to launchpad-users@lists.launchpad.net [18:26] That's it from me. [18:26] Questions? [18:26] Cool ideas for launchpadlib programs? [18:26] General complaints about Launchpad that I can respond soothingly to? [18:27] By "complaint", I of course meant "suggestion for improvement" [18:27] QUESTION: so, Python plays a HUGE part in Ubuntu, no? Other scripting won't feel left out? [18:27] A lot of Ubuntu stuff is written in Python. [18:28] As I mentioned earlier, you don't *have* to use Python to control Launchpad, but it makes it a lot easier. [18:28] QUESTION: Can you make more examples for python-snippets happen? [18:29] jonobacon, I can point you at https://help.launchpad.net/API/Examples again, I guess :) [18:29] QUESTION: Is there a way to access two JSON values in one "call"... I.e. launchpad.people[reporter_name].latitude gets the latitude -- is there a way to also get the longitude at the same time? [18:30] kamalmostafa, I'm fairly sure that if you get the object first, then subsequent attribute access doesn't do a separate webapp call. [18:30] so... [18:30] reporter = launchpad.people[reporter_name] [18:30] reporter.latitude, reporter.longtitude [18:30] QUESTION: is there a need to worry about python 3.0 breaking something? [18:30] vocx, wrt launchpadlib or wrt Ubuntu more generally? [18:31] vocx, launchpadlib is a Python 2 application. It hasn't been tested with Python 3. [18:32] vocx, I'm not the launchpadlib maintainer, but I tend to think of python3 as a completely different language. if a program works on both 2 and 3 it's a happy accident [18:33] vocx, no plans to port to 3 yet. [18:33] vocx, I guess we'd start doing that when Ubuntu stops providing Python 2 [18:34] are there any other questions? [18:34] QUESTION: Can we convince jonobacon to use metal umlauts in his name so my friends can go back to calling me Jono? === jml is now known as joneaux === joneaux is now known as jml [18:37] Last chance for questions folks [18:37] remember you can get the code for the example by 'bzr branch lp:~jml/+junk/bugstats' [18:37] and that the folk on #launchpad-dev are helpful and friendly and want more people doing stuff with launchpadlib [18:38] ok folks [18:39] don't mind the dead time on Radio Ubuntu Dev Week, Kubuntu Junior Jobs will be up in 20 minutes [18:39] have a great weekend [19:03] Hiya [19:04] Ready for the Papercuts session? [19:05] I'm going to guess that anyone wanting to sit on in this session is here by now, so... [19:06] Hi, I'm Mackenzie, and I'm a MOTU. I was asked this morning to cover this session for Celeste since she has school, so I'm going off of her notes [19:06] This session is on KDE Junior Jobs and *buntu Papercuts (or paperkuts ) [19:07] So first off, if you don't know yet, Kubuntu is a version of Ubuntu that uses KDE for its desktop environment instead of GNOME [19:08] Most development happens upstream at KDE (kde.org) and then the Kubuntu developers package up each upstream release [19:09] We try to stick closely to upstream, as giving back to the KDE is a good thing, and having to maintain a bunch of patches is a bad thing [19:09] (or at least a not-fun thing) [19:10] One thing we do because users seem to like it and it helps KDE get extra testing is package up pre-releases for KDE [19:10] For example, KDE SC 4.4 RC2 is currently in one of the (many) Kubuntu PPAs [19:10] (more info can always be found at kubuntu.org) [19:11] A number of the Kubuntu developers also write patches which then get submitted upstream to KDE [19:11] and then those new features end up in whatever the next final release is for KDE [19:12] If you're interested in getting started contributing to Kubuntu and KDE, then bug fixes, small patches, papercuts, small improvements on existing features, and other junior jobs are all a GREAT way to get started [19:14] For Karmic, the Hundred Papercuts project was started in Ubuntu, and Kubuntu had a share of them [19:14] (see: https://launchpad.net/hundredpapercuts ) [19:15] The goal is to fix 100 papercuts per release, or in the case of Kubuntu (as it's a smaller team (can I add, "and KDE's already awesomer than GNOME"?)), 10 papercuts [19:16] A papercut is defined as "a trivially fixable usability bug that the average user would encounter in default installation of Ubuntu or Kubuntu Desktop Edition" [19:17] Ok well, that's the surface goal [19:18] The REAL goal is to fix all those little annoyances that pile up until the desktop becomes unusable or at least a pain in the rear [19:19] For example, a task may require that you click 10 times among 3 different windows, and well, if you only have to do that once every few months, that's not a big deal [19:19] but if you have to do that 50 times per day... [19:19] It gets old fast ;) [19:19] Anyway, Kubuntu tries to deal with 10 paperkuts per release, and we try to get the patches for these paperkuts accepted in upstream KDE as well [19:20] Because, again, maintaining patches is much less fun than writing them [19:21] Some of the past Kubuntu paperkuts were cases where text was a little too technical for an end-user and had to be changed, or in the Kickoff menu the user's icon was showing next to the search box instead of the user's name [19:22] Here are a list of Kubuntu's papercuts from Karmic & Lucid: https://bugs.launchpad.net/hundredpapercuts/+bugs?field.searchtext=kubuntu&orderby=-importance&search=Search&field.status%3Alist=NEW&field.status%3Alist=INCOMPLETE_WITH_RESPONSE&field.status%3Alist=INCOMPLETE_WITHOUT_RESPONSE&field.status%3Alist=CONFIRMED&field.status%3Alist=TRIAGED&field.status%3Alist=INPROGRESS&field.status%3Alist=FIXCOMMITTED&field [19:22] .status%3Alist=FIXRELEASED&assignee_option=any&field.assignee=&field.bug_reporter=&field.bug_supervisor=&field.bug_commenter=&field.subscriber=&field.omit_dupes.used=&field.omit_dupes=on&field.has_patch.used=&field.has_cve.used=&field.affects_me.used=&field.tag=&field.tags_combinator=ANY [19:23] (and apparently not all of the kubuntu ones were tagged...) [19:25] I suspect Celeste had links already arranged for seeing past and present Kubuntu papercuts, but I don't have them, so... [19:26] here's some more that say kde but dont say kubuntu: https://bugs.launchpad.net/hundredpapercuts/+bugs?field.searchtext=kde&orderby=-importance&search=Search&field.status%3Alist=NEW&field.status%3Alist=INCOMPLETE_WITH_RESPONSE&field.status%3Alist=INCOMPLETE_WITHOUT_RESPONSE&field.status%3Alist=CONFIRMED&field.status%3Alist=TRIAGED&field.status%3Alist=INPROGRESS&field.status%3Alist=FIXCOMMITTED&field [19:26] .status%3Alist=FIXRELEASED&assignee_option=any&field.assignee=&field.bug_reporter=&field.bug_supervisor=&field.bug_commenter=&field.subscriber=&field.omit_dupes.used=&field.omit_dupes=on&field.has_patch.used=&field.has_cve.used=&field.affects_me.used=&field.tag=&field.tags_combinator=ANY [19:26] Anyway, moving on... [19:26] If you think you've found a papercut, submit it as a bug to Launchpad [19:27] Mark it as bug both against the "hundredpapercuts" project and the specific package in Kubuntu if you know it [19:28] If you would like to fix one of those papercuts you see up there but you need some help ^ join #kubuntu-devel and [19:28] er... and we'll help you out [19:29] OK, so that's papercuts. I mentioned something called "Junior Jobs" at the start too [19:30] Maybe you've seen bugs tagged "bitesize" in Launchpad, or you might know about Daniel Holbach's Harvest project to show low-hanging fruit for new developers [19:30] Junior Jobs are KDE's version of that same idea [19:30] And I'm being told in -chat that I should point out that "job" is like "volunteer job" in case you're thinking you can get money for it. Because you won't. [19:32] QUESTION: link for the harvest project? (i am google challenged at the moment) [19:32] Harvest can be found at http://daniel.holba.ch/harvest [19:32] There are plans to make it prettier [19:34] By the way, my computer is currently telling me that opening the "sourcepackage list" page on Harvest while having ~100 other tabs open in Firefox is an idea to which it is opposed. You've been warned. [19:35] OK, so...Junior Jobs. The KDE techbase (one of the KDE wikis) page for Junior Jobs is here: http://techbase.kde.org/Contribute/Junior_Jobs [19:36] As you can see, KDE separates its Junior Jobs by sub-project, so you can see just KMail or just Kopete or whatever's available jobs [19:37] Or you can see all of the KDE Junior Jobs here: https://bugs.kde.org/buglist.cgi?keywords=junior-jobs&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&cmdtype=doit [19:38] Earlier this question came up and I held it til reaching the Junior Jobs part... [19:38] QUESTION: some bugs marked as Junior Jobs don't sound easy, like implementing a new KIO slave, how come they are marked as Junior Job? [19:39] Now, I don't have a lot of involvement with upstream KDE like Celeste does, so she'd have a better answer than I do, but I wouldn't be surprised if there was a bit of mentorship in there somewhere [19:40] I also don't think Junior Jobs are supposed to be aimed at "I've never written code before" but rather "I can code...kind of...but I've never worked on such a big project before" [19:40] And a lot of the Papercuts are quite a bit more advanced than "I've never written code before" too, so... keep that in mind [19:42] Nightrose: do you have a better answer to "some bugs marked as Junior Jobs don't sound easy, like implementing a new KIO slave, how come they are marked as Junior Job?" [19:43] Oh yeah, let me introduce Nightrose, aka Lydia [19:43] She's the Amarok lead, I believe [19:44] jep :) [19:44] so people said some of the junior jobs are hard [19:44] there are two reasons for this: [19:45] 1) the person who marked it as a junior job didn't know the program very well and didn't know how hard it actually is [19:45] 2) the person who marked it is having a hard time judging how hard a particular task is [19:45] neither is really nice but it happens [19:45] we try to keep them at junior level as wel as we can of course :) [19:46] Nightrose: can they be un-marked as JJs? [19:46] yes of course - tell me or other people in #kde-bugs [19:46] Great! Thank you :) [19:46] you're welcome :) [19:47] Feel free to thwap me if I say anything wrong/stupid between now and 15 minutes :) [19:48] maco, Nightrose: is anyone in particular responsible for reporting PaperKuts to KDE? I mean something like Bug #510219, marked as tiriaged but not linked to any of KDE bugs, it's safe for me to report that upstream and link it to LP? [19:48] Go right ahead :) [19:49] QUESTION: If I want to patch KDE progressbar animation smoothness, where would I start? The oxygen theme? (I've patched it locally before :) ) [19:49] Neither Nightrose nor I know know to answer this one, so I guess now's the time to note that on this IRC server there is #kde-devel, and they would likely have an answer [19:51] And Mamarok is pointing out that Nightrose is release manager, not lead. oops! [19:51] Anyway, time to start wrapping up [19:52] So the benefits to participating in Junior Jobs or Papercuts are that you get a chance to test out your skills in a *real* project, not those silly things the teachers make you write at school [19:52] You get a chance to gain some rapport with the rest of the project so that as your skillset grows, they know and trust you [19:52] You end up witha more usable desktop, which is always great [19:53] programming, why hasn't it caught with enough strength? Do women like C++? [19:53] bah [19:53] QUESTION: if Qt (C++) is supposedly hundreds of times better than GTK+ (C) for GUI programming, why hasn't it caught with enough strength? Do women like C++? [19:54] Honestly, the reason I know how to do C/GTK+ programming and not C++/Qt is that my school taught C, not C++ [19:54] and I haven't gotten around to learning C++ [19:55] In either case, PyGTK and PyQt (and PyKDE) exist, so even so, learning C/C++ is not a requirement to participation [19:55] And I'm just not going to answer that women...C++ part. People use what they like, regardless of gender. [19:55] there are also bindings for scripting languages [19:55] so you can do cool stuff in ruby or java script [19:56] This does bring up the point that on top of learning just Python or C++, there are libraries you need to learn to work in the KDE world, so Junior Jobs / Papercuts give you a chance to build on top of your base programming knowledge if you just know Python or C++ [19:57] Any other quick questions in the 3 minutes we have left? [19:58] QUESTION: Does everybody know that KDE+Kubuntu will rule the world? [19:58] Yes, but whether they're willing to admit it is another thing entirely [19:59] also, Qt/C++ allows to do shorter code, the Qt framework is very powerful <-- good point. you'll find you can do a lot of painful things very easily as you get into KDE programming [20:00] OK, time's up here. Hope everyone's all excited to get cracking on these bugs [20:00] Bye! [20:00] thanks everyone for coming and maco for rocking :) [20:01] Thanks for your help, Lydia [20:02] OK. That means it's time for Interpreting Stacktraces :) [20:03] I get distracted with -classroom and -classroom-chat, and really prefer interactive discussions, so I encourage anyone to ask questions in this channel at any time (I prefer to be interrupted) [20:05] As an example, we're going to look at a crash in dot. Anyone wanting to follow closely would benefit from getting a local copy of the cairo and graphviz sources (because we'll be looking at them later) [20:05] Either karmic or lucid sources should be OK. [20:07] A stacktrace is the overview of the current function call stack for a program, and is extremely useful when determining why a crash happens. [20:07] Thanks pleia2 :) [20:07] welcome :) [20:08] When a program executes, the various function calls and instructions in the program are run, typically in some sort of order, which we can see from the source code. [20:08] In most programs, there is a main() function, which controls the entire program. In executing it, otehr functions will be called to do various things. [20:09] These functions will then call other functions, and so on, in a nested fashion. [20:10] Each function called is placed on the top of the stack when it is called, and when it, in turn, calls another function, that function is placed on the top of the stack. [20:11] As a result, at any point, the function on the top of the stack is the currently executing code, and the rest of the stack contains all the nested functions needed to unwind to get back to the operating system starting the program. [20:12] An example stacktrace (and the one we'll use for debugging today) is http://launchpadlibrarian.net/37459596/Stacktrace.txt [20:13] The stack is commonly described in terms of frames. Frame #0 is the currently executing function, Frame #1 the function that called that function, etc. In our example, Frame #8 is main() which was called by the operating system when starting the program (sometimes you can see this, depending on the stacktrace) [20:14] At each Frame, the stacktrace contains the address of the function, the name of the function, the values of (most of) the arguments to the function, and often some avtive variable values in the vicinity. [20:14] < vishalrao_vbox> QUESTION: who/how generates a textual stacktrace from, say, a core dump? [20:15] Well, there's lots of ways to do that :) The two most common ways to generate stacktraces as used for crashes in Ubuntu are with gdb and apport. [20:15] < michae28> QUESTION : what is vicinity ? [20:16] "vicinity" is a state of being near in space or relationship. Things in the same vicinity are close to each other. [20:16] Could also be nearby, surrounding, etc. [20:16] < vishalrao_vbox> QUESTION: can you briefly mention the commandlines for gdb and apport to generate the stacktraces? [20:17] The process of generating a stacktrace with gdb is described at https://wiki.ubuntu.com/Backtrace [20:17] For apport, there are three ways to do it, all dependent on the apport-retracer infrastructure. [20:18] The first being to enable apport crash tracking, which automatically uploads the crash information to launchpad and files a bug when a crash happens. [20:18] The second being to use apport-bug to file a bug with a previously produced .crash report [20:19] The third being to use apport-retrace manually to collect information. [20:19] If the details in the crash report are uploaded to launchpad, the apport-retracers will typically use them to generate textual stacktraces with debugging information. [20:20] So, by using the stacktrace, we can see exactly what the program is doing at the time the stacktrace is taken. [20:21] In our example, the program started, did some stuff which resulted in a call to gvRenderJobs(), which did something and called emit_graph(), which did something and called emit_background(), and so forth. [20:21] < vishalrao_vbox> QUESTION: if i try to generate a backtrace in gdb and it just shows numbers instead of symbols, how do i get it to show me the function names etc? [20:22] To determine the parts that aren't described, we'll need to review the source code along with the stacktrace. [20:23] For most programs, the debugging symbols have been stripped out into ddebs. These contain mappings between the function call addresses and the code. [20:23] I can never find the right wiki page that explains how to install them, but it should be navigable from the links in the /topic of #ubuntu-bugs (or maybe someone else can dig it up and share) [20:24] The example stacktrace I've shown comes from Bug #503503 [20:24] Bug 503503 on http://launchpad.net/bugs/503503 is private [20:24] * persia fixes that [20:24] Right. Now bug #503503 should be public [20:24] Launchpad bug 503503 in graphviz "dot crashed with SIGSEGV in cairo_set_dash()" [Medium,New] https://launchpad.net/bugs/503503 [20:25] This bug was filed using apport, which I find much easier to search. If you're looking for other crash bugs, using the apport-crash tag is great way to get a list from which to work. [20:27] The title of the bug tells us that there was a segmentation fault when calling the function cairo_set_dash(). These tend to be my favorite sort of crash bugs, because they are usually fairly easy to track down. [20:27] http://en.wikipedia.org/wiki/SIGSEGV has a little more information about segmentation faults. [20:28] Other than the title, the rest of the bug report is mostly uninteresting at this point. Depending on what we find, we may want to investigate using some of the other provided information (for instance, if we're crashing in translations, the fact that it's reported with de_LU.UTF8 is important) [20:29] Well, there's one other interesting thing, actually, which is the package against which the bug is filed. This tells us which package we need to get source from in order to interpret the stacktrace. [20:31] Also, reviewing the stacktrace, one might notice that the source file identified at frame #0 is /build/buildd/cairot-1.8.8/src/cairo.c rather than some local file. This notation is used to identify code from other packages. In this case, it's the cairo package (version 1.8.8), so that's why we wanted to download graphviz and cairo sources earlier (and I'll now assume that you've all done that) === vishalrao_web is now known as vishalrao [20:32] The first step when reviewing a stacktrace is to find somewhere interesting to start. One could always just look at frame #0 where the crash is actually happening, but this is rarely enough context to actually understand the bug. [20:33] Alternately, one could start from the very bottom of the stack, but usually the first several calls are far too general, and it's easy to get frustrated or distracted reading that much source. [20:33] It's never possible to know the right point in advance, but I usually pick something near the middle, preferably something that has a lot of vairable references defined. [20:35] So in this case, frame #4 looks like a sensible place to start. From here, we'll read up to frame #0 to understand things. If the problem has already happened at frame #4, we may end up backing up (perhaps even to frame #0) to fix it, but at least we'll understand the targets to search when we look at the more general code. [20:36] So, frame #4 is the gvrender_box call at line 851 of gvrender.c . Since there are no funny pathnames, this is in the graphviz source. [20:36] I usually use `find . -name ${SOURCE} -print` from within the source directory to quickly identify the right file. [20:37] Running `find . -name gvrender.c -print` shows ./lib/gvc/gvrender.c [20:37] Please open that file in your favorite text editor [20:38] At line 851 is a gvrender_polygon call, which is giving us trouble. Unless we've previously worked with this source, we probably don't know what this means, although the name may help us guess. [20:38] So, it's best to scroll up to the beginning of the function that is calling gvrender_polygon() and read down again to line 851 to get some understanding. [20:39] The top of the function is at line 840, and the entire function consists of setting the values of variable A (type pointf) based on values from variable B (type boxf). [20:40] So in our call, we are just passing through the job pointer and the filled boolean, along with A and a number. [20:41] Next, we look at frame #3, which is at line 812 of gvrender.c [20:42] Again, we scroll up to the beginning of the function (at line 805), and read down. We know the inputs from the last function we read, so we can understand this a bit better. [20:44] The function assigns an engine from the job, apparently succeeds (because of the if), apparently confirms the job has the GVRENDER_DOES_TRANSFORM flag set, and calls gvre_polygon using all the same values that were passed in previously. [20:44] Moving to frame #2, we need to switch source files, to gvrender_pango.c [20:44] THis is in ./plugin/pango\gvrender_pango.c [20:45] Line 277 is in the cairogen_polygon function, which isn't quite the name that was called, but seems to take the same inputs we had previously. [20:46] Between the start of the function and the call in the stacktrace, we see only that *obj, *cr, and i are defined (and *obj and *cr are initialised). [20:47] We then call cairogran_set_penstyle with job and cr. Looking at the stacktrace, we can see that job is optimised out (but had been0x90945d0 in previous calls, so is probably the same) [20:47] And cr is 0x0. [20:48] since we know that cr is a pointer to a variable of type cairo_t, it shouldn't have a value of 0 (this is a null pointer). [20:48] Which probably means that cairo_t *cr = (cairo_t *) job->context; failed. [20:49] Moving to frame #1 is just moving to line 235 [20:50] Here the function sets *obj again, and based on the value of *obj, selects a way to call cairo_set_dash(). In our case, it's the neither a dashed nor a dotted pen. [20:50] But we pass dashed anyway :) [20:51] For frame #0, we need to look at the cairo source code. This is in src/cairo.c (it's easier to tell with foreign source files) [20:51] Looking at line 1033, and up to the start of the funtion, we can see that we're right at the beginning. [20:52] Before doing anything else real, the code checks the status of cr. Since cr is a 0, the expected structure isn't present, so cr->status isn't valid, which causes the segfault. [20:52] This is another thing to fix,because it's best for a library not to crash, even when the wrong data is passed. [20:53] < vocx> QUESTION: are stack traces really important nowdays? I feel like much development is done now in programming languages such as Python and C#/Mono, which use their own runtime, and so don't "crash" in the traditional way, and don't produce a stacktrace. [20:53] So, after reading the stacktrace, we've identified two things to fix, either one of which would solve the bug. [20:54] 1) test to make sure one has a valid value for cr in cairogen_polygon(), and 2) put an exception handler around the status check in cairo_set_dash() [20:54] < vocx> QUESTION: in your experience, where are the crashes most often found? The program itself, or the supporting libraries, like Gtk+, Qt, glib, cairo, poppler, etc.? [20:55] Python produces something called a Traceback, which is essentially the same as a stacktrace, except presented in the opposite order (frame #0 is at the bottom). [20:55] < michae28> QUESTION : does it mean that the real value cannot be displayed ? [20:55] But the vast majority of system libraries end up being written in compiled languages, so if there is a crash in a library, a stacktrace is likely interesting (even if the call comes from python or mono bindings) [20:56] I've yet to find a crash that couldn't be worked around by type checking, value checking, return code checking, or exception handling in client code. [20:57] But many crashes *also* expose an issue with the underlying library (as we saw in this case, where both graphviz and cairo could use code improvements). [20:58] When the value is opimised out, it usually means that the value isn't relevant in some way, or is redundant. In our example case, the value for job was passed a couple times, and then dropped. We could still look at older uses, but it no longer mattered. [20:58] < SevenMachines> [QUESTION] Often you see argument memory addresses cropping up in stacktraces, is there a good way to get more information in the stacktrace on the actual object on the heap that was passed? [20:58] Not really. I tend to try to assemble a mental model of the object by passing through several frames. [20:59] If the intial guess for starting was wrong, one sometimes needs to go back further to understand the data being passed. [20:59] But most of the time, crashes seem to be from a miscommunication between the library author and the application author, where one is expecting something different than what the other is providing. [21:00] And these tend to be obvious (like the one we examined, where the code never checked to see if a valid value was being passed to cairo, and when cairo couldn't complete the request, didn't trap the return) [21:01] Whether SIGSEGV is the best thing for cairo to return is a different question, but that it wasn't checked doesn't help. [21:02] cairo should probably have trapped the SIGSEGV, and returned someting with _cairo_set_error, and graphviz should have checked the value of _cairo_set_error (as well as having checked to make sure cr was a valid pointer before using it) [21:03] Are there more questions? I seem to be out of time, but there's no following sessions, so I'm happy to keep answering questions for a bit. [21:04] < michae28> QUESTION : to have all this stack informations, the program have been compiled with -g option ? [21:05] I actually don't know. I've gotten stacktraces just using `gcc foo.c -o foo`, but this may have been from some default options that were set. [21:07] Well, thanks everyone for attending. Feel free to catch me in #ubuntu-bugs if you're digging through any traces and have questions in the future. [21:08] And thanks a lot for participating in Ubuntu Developer Week. I hope some of you will be presenting next time :) [21:08] Pendulum: Thanks especially for forwarding questions. [21:09] persia: you're welcome :) Thank you for presenting :) === luis__lopez is now known as luis_lopez