/srv/irclogs.ubuntu.com/2010/01/28/#ubuntu-classroom.txt

ecantodate -u01:22
cjohnstonecanto: you need to do that in the command line01:25
cjohnston@now01:25
ubottuCurrent time in Etc/UTC: January 28 2010, 01:25:1601:25
ecantocjohnston thanks. (:01:25
=== ecanto is now known as dmesg
=== dmesg is now known as ecanto
=== tobias is now known as Guest12445
* jcastro taps on the mic15:47
* dholbach looks for the technicians to fix the feedback loop15:49
=== dholbach changed the topic of #ubuntu-classroom to: Ubuntu Classroom || Support in #ubuntu || https://wiki.ubuntu.com/Classroom || https://wiki.ubuntu.com/Packaging/Training || Upcoming: Mon 25 Jan - Fri 29 Jan 2010: https://wiki.ubuntu.com/UbuntuDeveloperWeek || Run 'date -u' in a terminal to find out the UTC time | Ask questions in #ubuntu-classroom-chat
=== tobias is now known as Guest11086
dholbachWELCOME EVERYBODY TO DAY 4 OF UBUNTU DEVELOPER WEEK!15:59
dholbachIf you don't know why you're here and what's going on, check out https://wiki.ubuntu.com/UbuntuDeveloperWeek :-)15:59
dholbachQuestions all go to #ubuntu-classroom-chat and please prefix them with QUESTION so they stick out!16:00
dholbachif you're uncomfortable asking questions in English, please head into one of the channels listed at the end of https://wiki.ubuntu.com/UbuntuDeveloperWeek16:00
dholbachthere will be people who will translate questions and answers for you if necessary (consider helping out yourself, please :-))16:00
dholbachOK, enough organisational mumbo-jumbo!16:01
dholbachI'm here with the amazing Jorge O. Castro, jcastro!16:01
jcastrowoo hoo!16:01
jcastrowe have been preparing real hard for this session, hope you like it!16:01
=== godzilla is now known as Guest53616
dholbachAnd together we'll talk about Adopting an Upstream! Why it's fun, necessary and makes the world a better place.16:02
dholbachjcastro: What's an Upstream?16:02
jcastrothat's a good question16:02
jcastrofirst, when you get an ubuntu CD it comes with a bunch of great software16:02
jcastrothings like Firefox, Openoffice, GNOME, KDE, etc.16:02
jcastrowhat Ubuntu does as a distribution is take all those things, assemble them into one operating system, and then ship16:03
jcastroso, these projects, we call them upstream, like in a river16:03
jcastroand distributions like us are downstram16:03
jcastroand derived distributions like Mint would be downstream from us16:03
dholbachso that's like all the software authors of those projects?16:03
jcastroworking with upstreams and downstreams is a critical part of ubuntu16:03
jcastroright!16:03
dholbach(I hope I encourage YOU ALL to ask questions too, I asked the first ones myself... :-))16:03
jcastroso, for example, it's critical for us to be able to work with upstreams like Firefox to ensure that we're shipping something users will love16:04
jcastroso for example this week in #ubuntu-mozillateam you'll see our Ubuntu teams working with people from Mozilla16:04
dholbachSo there's millions of Ubuntu users and there's thousands of Upstream projects... looks like being there for both huge groups is quite an undertaking16:04
jcastroso there's a bunch of cross boundary work going on there that some people don't see16:04
jcastroright, especially when you're trying to fix a problem! But we'll show you how to do that when we get there16:05
jcastroyou'll see that sometimes putting a bug in the right place that we can be a service to upstreams when it comes to testing.16:05
jcastroand when we fix problems it's of course our duty to make sure that those fixes get back upstream so that they can improve the overall quality of their project16:06
jcastroand of course, the other half is ensuring that when upstream fixes bugs that we get those out to users, because at the end of the day that's what it's all about16:06
jcastroso16:06
jcastroI have been working on some wiki pages to help people get started16:06
jcastrohttps://wiki.ubuntu.com/Upstream16:07
jcastroIt's unreasonable to expect every upstream author to know in detail how ubuntu works16:07
jcastrosome are content just making their software16:07
dholbachand the other way around :)16:07
jcastroso I've put together a little cheat sheet here for them (you can help improve this too if you find mistakes)16:08
jcastroso that they can have one place to find important things, like when we freeze, what our security policy is, etc.16:08
jcastroand also give them information on how things are going on the ubuntu platform16:08
jcastroso if you wanted to find out about notify osd or messaging indicators, I've listed those there16:08
jcastronow16:09
jcastroone thing we've all been working on is a little program to give upstreams an "in" in the distro16:09
jcastrothis would be a person that does know how Ubuntu works16:09
jcastroand is passionate about that specific piece of software16:09
jcastroand wants to work on it in Ubuntu but also be there for the upstreams to answer their questions, be an information source, and be there when things go wrong16:10
jcastrowe call this Adopt a Package16:10
jcastrodholbach: want to go into that for a little bit?16:10
dholbachsure16:10
jcastrohttps://wiki.ubuntu.com/BugSquad/AdoptPackage16:11
dholbachand https://wiki.ubuntu.com/Upstream/Adopt16:11
dholbachso to Adopt an Upstream can mean a couple of things16:11
dholbachthe most important one being that you act as a tie betwen Ubuntu and that upstream project16:11
dholbachyou can answer questions for people on that project, you know what's going on there, you know what's going on in Ubuntu16:12
dholbachan easy example for "knowing what's going on" is: Upstream wants to ship a new feature release 2 weeks before the new Ubuntu release comes out16:12
dholbachin that case you can talk to them and make it clear that it's hard to get that new feature release into Ubuntu because Ubuntu is already almost frozen16:13
dholbachyou can help with that kind of misinformation and help with the coordination early and explain what to do16:13
dholbachjcastro and I will talk about the release cycle in more detail later on16:13
dholbachanother thing you can work on is bug reports16:14
dholbachas we said before Ubuntu exposes great software to millions of users16:14
dholbachof course these users occasionally run into problems16:14
jcastroand they might not know what an upstream is!16:14
dholbachexactly16:14
dholbachso it's our job to triage those bugs, debug them, get as much information as possible and forward them to the upstream maintainers16:14
dholbachbecause they are in the best position to work on the bug effectively16:15
dholbachif we can fix it that's great, then we'll forward the patch to upstream16:15
jcastrooh, so we can be good filters you mean?16:15
dholbachexactly16:15
jcastrowe can weed out all the junk bugs so upstreams can concentrate on the ones with the best debugging info, descriptions, etc.16:15
dholbachI've heard we have great tools for finding duplicates and dealing with crashes?16:15
dholbachjcastro: maybe we should explain first what "to triage" means16:16
jcastroyes.16:16
dholbachyou wanna do it? :)16:16
jcastrohttps://wiki.ubuntu.com/Bugs/HowToTriage/16:16
jcastrosure!16:16
jcastroso when users report bugs16:16
jcastrothey go into this big pile16:17
jcastroto triage a bug means to subdivide that pile from one huge unmanageable mess to smaller piles16:17
jcastroand as the bug continues on in it's lifecycle it will end up in the right pile16:17
jcastroso, we might start with a big pile16:17
jcastrobut then we have smaller piles, kernel, desktop, printing, etc.16:17
jcastroand then those get smaller16:18
=== tobias is now known as Guest96094
jcastrountil you have a package, like say, nautilus.16:18
jcastrobug triagers are people who sort the bugs in the right pile16:18
dholbachthen we might be able to get the bug confirmed, make sure we know in which release the bug occurs16:18
jcastrothe great thing about this is that you can do this without being too technical16:18
dholbachthen find the right steps to reproduce it16:18
jcastrothese days we have tools that do a good job of guessing what pile something should go in16:18
jcastrobut we also need to try to reproduce the bug so we can confirm it16:19
jcastrothis involves following what the reporter did16:19
jcastroso if the report is "clicking on this button breaks printing"16:19
dholbachhttps://help.ubuntu.com/community/ReportingBugs has a bit more detail about how this "guessing" works16:19
jcastrothen usually you try it, and see if you see the problem too16:19
jcastroalso, remember that we have millions of users16:19
dholbachthe better we isolate the issue, the less work the upstreams have, they can concentrate on fixing the bug :-)16:20
jcastroI find that most times bugs sitting in the big pile have already been reported, so you can do a bunch of good just marking things as duplicates (if they are indeed duplicates)16:20
dholbachright16:20
dholbachalso there's bugs with crash reportsf16:20
=== tobias is now known as Guest76403
dholbachUbuntu has a fantastic machinery that gets as much debug information about those crashes as possible16:21
dholbachautomatically16:21
jcastrohttps://wiki.ubuntu.com/Apport <--- here are pictures of what it looks like16:21
dholbachso what was a painstaking job before (https://wiki.ubuntu.com/Backtrace) is a lot easier now16:21
dholbachthe end result is that we can say in function do_something() in line 45 of file bla/something.c the whole thing crashed16:22
dholbachplus other things that developers might want to know :)16:22
dholbachgo and see Emmet Hikory's session on Friday about "Interpreting stacktraces" if you want to know more :)16:22
jcastroare these important to send to upstreams?16:22
jcastrothey look important!16:23
dholbachholy cow yes!16:23
dholbachwith all this information it should be a bit easier for upstream developers to find the cause for the crash and fix it16:23
dholbacha crash in most cases means: the program is gone, it stopped working, unsaved work, etc you know what it's like16:23
dholbachsometimes these crashes happen in special circumstances that didn't happen for the upstream developers when they tested it16:24
dholbachin almost every discussion I was part of upstreams were happy about that kind of conversations and grateful for detailed bug reports16:24
dholbachif you have questions about how to get started with bugs and everything check out https://wiki.ubuntu.com/Upstream/Adopt and talk to the fine people in #ubuntu-bugs16:24
jcastrook, so apport finds this and reports this to launchpad, what's the next step?16:25
dholbachthe Launchpad machinery will do its magic and add more debug information to the bug report16:25
dholbachthe next step would be trying to confirm the issue16:25
dholbachif you can confirm it and maybe add some more details to what happened, you can have a look and see if it was already reports in the upstream bug tracker16:26
dholbachif it was, see if you can add more information to the bug16:26
dholbachif it wasn't report it16:26
dholbachsometimes it's useful to have a look and see if upstreams have some kind of "debugging information" documented somewhere16:26
dholbachfor some of them it will be something like "start the program with --debug option" or something16:27
dholbacha lot of that kind of information is listed at https://wiki.ubuntu.com/DebuggingProcedures and you should add info for your upstream project if you have any :)16:27
dholbachalso Launchpad has a great feature: you can link the upstream bug to the Ubuntu bug, right?16:28
jcastroyeah16:28
jcastrolet me show you about that16:28
=== godzilla is now known as Guest30844
jcastroactually, give me a minute to find a bug16:29
jcastrodholbach: do a dance!16:29
* dholbach puts on some music and does the funky Upstream-Bug-Linking dance16:29
jcastrohttps://wiki.ubuntu.com/Bugs/Upstream16:29
jcastrook so here is some documentation, depending on the bug16:30
jcastrohowever, in general, you can just click "Also affects project" in launchpad, and paste in the bug url from the other bug tracker16:30
jcastrohttps://wiki.ubuntu.com/Bugs/Watches16:30
jcastrothey looks like this16:30
jcastroso you see there, on the top example, there's the  bug in ubuntu, and the bug in the upstream project's bug tracker16:30
jcastroin this case linux kernel bug 1091116:30
jcastrothese are useful because with certain bug trackers16:31
jcastrolike mozilla's bugzilla, we can do neat things like syncing comments between the 2 bug trackers16:31
jcastrohttps://bugs.edge.launchpad.net/ubuntu/+source/notify-osd/+bug/50139316:32
jcastrohere is a good example of both ubuntu and mozilla developers working on a bug for example16:32
jcastrohowever, just linking the bug can help16:32
jcastrobecause it gives everyone a place to gather discussion around a bug16:32
jcastroand especially for new users that might not know how things work16:33
jcastrowhat other information can we help upstreams with dholbach?16:33
jcastrotell me about this schedule16:33
dholbachanother fine thing you can do is: plan a Bug Day with your Upstream: invite them to https://wiki.ubuntu.com/UbuntuBugDay - triage bugs together, give people some coaching with that particular software - once you're good friends with your upstream, sky's the limit16:33
dholbachalright... release schedule!16:34
jcastroupstreams ask me all the time about the schedule16:34
jcastrobut sometimes I don't know what means what!16:34
dholbachhave a look at https://wiki.ubuntu.com/ReleaseSchedule16:34
dholbachit shows our current release cycle16:34
dholbachyou can see how it goes from green in the beginning of the 6 months cycle to red at the end16:35
dholbachgreen doesn't mean "it's all good, everything works" :-)16:35
dholbachit rather means "everything's allowed from a developer point of view"16:35
dholbachso we start with setting up the build tools in the beginning, plan features at UDS and merge with Debian (more on merges, syncs and Debian in a bit :-))16:36
dholbachat some stage we hit feature freeze, that's where we plan to have most of the feature in the distro16:37
jcastroXazax | why is the release cycle for upstream projects important?16:37
dholbachdoesn't mean they have to be all perfect16:37
dholbachXazax: will get to that in a sec16:37
dholbachbut it means that they have to be there and be test-able :)16:37
dholbachso we move from feature development to fixing16:38
dholbachand stabilisation16:38
dholbachthe later it gets in the release cycle the more conservative we get16:38
dholbachto upload a small patch that fixes a crash 3 weeks before release is probably fine16:38
dholbachbut to upload a GIANT new release with n+1 new features will probably get you in trouble with the release managers16:38
dholbachJorge and I worked on a cheatsheet that makes it easier to understand what is allowed at which stage of the release cycle to ease the planning and coordination somewhat: http://people.canonical.com/~dholbach/cheatsheet.pdf16:39
dholbachthat's linked from https://wiki.ubuntu.com/Upstream/Adopt too16:39
dholbachI hope that answers Xazax's question somewhat.16:39
jcastroi would like to chime in on his question16:40
dholbachsure16:40
jcastrowith things like a Long Term Support release it's critical for us as a downstream distro to communicate our release schedule16:40
jcastrowe sync our schedule with GNOME16:40
jcastroso, we're kind of lined up16:40
jcastrosome upstreams want to know when they should release to have their software in ubuntu16:41
jcastroso they can make a release, or decided to skip an ubuntu release, etc.16:41
jcastroso, when we're at UDS16:41
jcastroand we're talking to upstreams we make decisions on things dependent on release cycles16:41
jcastroso it might be "well, that feature won't be ready in time, so we'll go with version 1.x instead" or something16:42
dholbachthat sounds very reasonable16:42
dholbachwhatever we can't fix during the release time, we have to fix after the release... jcastro: do you know how that works?16:42
jcastroyes16:42
jcastroit's a big source of confusion16:43
jcastroso let's talk about Stable Release Updates16:43
dholbachI think it all started with something like this: http://blog.somekool.net/images/img_4232.jpg16:43
jcastrohttps://wiki.ubuntu.com/StableReleaseUpdates16:43
jcastrodoh!16:43
dholbachshall I tell the story quickly before you move on?16:43
jcastroyes!16:43
dholbachok16:43
dholbachso in the very early days of Ubuntu we uploaded a couple of fixes (they all were upstream already) to the xserver to a stable release16:44
dholbachthat means that users who had installed the release (and not the development version) got those fixes16:44
dholbachthe developer had tested them all, they were upstream fixes and everything seemed good16:44
dholbachthe problem was that a certain percentage of our users (x% of some millions) suddenly had a broken Xserver16:45
dholbachwhich resulted in people like my dad having to wrestle with: http://blog.somekool.net/images/img_4232.jpg16:45
dholbachso we realised that we need to be more conservative with fixes like that16:45
dholbachthat's where SRUs originate from16:46
dholbachjcastro: so how does this all work now?16:46
jcastrohttps://wiki.ubuntu.com/StableReleaseUpdates16:46
jcastrowe have these16:46
jcastrodon't worry, it only looks scary!16:47
jcastrothe key point to remember here when talking to upstreams16:47
jcastrois that really bad bugs should be communicated to distros16:47
jcastroyou see this all the time on like planet gnome16:47
jcastro"wow, we found a bad bug in gstreamer, distros should ship this fix: $url" or something16:48
jcastroas you hang out and talk with upstreams16:48
jcastroat some point they will have a critical bug that will need to be fixed16:48
jcastroso usually you can take ownership of that, talk to the ubuntu maintainer, and communicate the needs that way16:48
jcastrosometimes upstreams fix small bugs16:48
kfogeldhasenan: thanks16:48
jcastroand of course those are good16:49
kfogelwhhooops16:49
kfogeldholbach: thanks16:49
* kfogel watches out for nick completion16:49
jcastrobut it can be frustrating to an upstream when the fix doesn't get into an SRU16:49
jcastroit's just one of those things where the fix needs to be weighed with the risk16:49
dholbachhttps://wiki.ubuntu.com/StableReleaseUpdates is pretty good at explaining what kind of fixes we want and which make sense16:50
jcastroIn general I think we do a good job here, but if an upstream still wants new crack in the distro, we have things like PPAs and backports16:50
jcastrothat's also an area where you can contribute16:50
jcastromany ubuntu contributors set up and run PPAs as a service to upstreams for apps people love16:50
dholbachhttp://people.canonical.com/~dholbach/cheatsheet.pdf should give you an overview over what to do in which case16:50
jcastrothat is highly encouraged, and a good way to learn packaging if you want to start the  road to becoming an ubuntu developer16:51
jcastrowe only have 5 minutes left, so let's talk about debian for  a bit16:51
dholbachone of our most important upstreams is Debian16:52
dholbachand we inherit a lot of packages and lots of great work from Debian developers16:52
dholbachusually it works like this: if a package is unmodified in Ubuntu and we're before DebianImportFreeze (Check the release schedule again), it gets "synced" automatically16:52
dholbachwhich means that the package in Ubuntu will get overwritten with the source that is in Debian right now (and rebuilt)16:53
=== zen is now known as Guest90818
dholbachif it's modified in Ubuntu, we need to figure out if we can drop out changes (then we'll ask for a sync)16:53
dholbachand if we can't drop our changes, we need to merge the changes semi-manually16:53
dholbachhttps://wiki.ubuntu.com/UbuntuDevelopment/Merging explains how the merging works and which tools we use16:54
dholbachcommon scenarios for differences between Ubuntu and Debian are:16:54
dholbach - we're in different parts of our release cycle and we decide to ship a newer version16:54
dholbach - new improvements we want to try out in Ubuntu (launchpad integration of gnome apps, new indicators, new notifications, etc.)16:55
dholbachand lots of other small things because of different things we support and not support16:55
dholbachbut generally the idea is: the more we can have in sync with Debian, the better16:55
dholbachit means less merging, less maintenance hassle and a common code base to look at16:55
dholbachso whatever is suitable in terms of patches to forward to Debian, we do forward16:56
dholbachhttps://wiki.ubuntu.com/Debian/Bugs has more details on that16:56
jcastrowhew16:56
jcastrothat was alot of info!16:56
jcastroand only one question, so either we were really great or really bad!16:56
jcastro\o/16:57
dholbachthat's the great thing about working on a certain piece of software is you get to know: lots of users (and make them happy with fixes), the upstream maintainers, lots of great Ubuntu developers that work with you and maintainers of others distros too16:57
dholbachyou not only make the world a better place by working on making software better for everybody, but you also get to know a lot of great people AND learn something new :)16:57
dholbachone page you should definitely bookmark is: https://wiki.ubuntu.com/Upstream/Adopt :)16:58
dholbachany final questions?16:58
dholbachjcastro: any final words? :)16:58
jcastronope, thanks for coming everyone!16:58
dholbachthanks everybody - you ROCK!16:59
* ogasawara fades in17:00
dholbachnext up is Leann Ogasawara who will talk to us about "Kernel patches"!17:00
ogasawaraHi Everyone!  Welcome to the Kernel Patches Session.17:00
ogasawaraMy name is Leann Ogasawara and I'm a member of the Ubuntu Kernel Team.17:00
ogasawaraIf you have any questions, please post them to #ubuntu-classroom-chat prefixed with QUESTION:17:00
ogasawaraOne of the biggest issues we face as a team is the large volume of bug reports we receive against the kernel.17:01
ogasawaraOne possible way to lend a helping hand is submitting patches to fix these bugs.17:01
ogasawaraSubmitting a kernel patch might seem like a daunting task, but hopefully after today's session it won't seem so intimidating.17:01
ogasawaraThere are five main items I'd like to cover in today's talk:17:01
ogasawara1) Choosing bugs to patch17:01
ogasawara2) Patch submission process17:01
ogasawara3) Walk through an actual example17:01
ogasawara4) Reasons for not applying a patch17:01
ogasawara5) Getting Help17:01
ogasawaraI should mention that the Ubuntu kernel team's ideal scenario is to have little to no divergence from the upstream linux kernel.17:02
ogasawaraIf a kernel patch will benefit Ubuntu users, it'll likely benefit all.17:02
ogasawaraThis is why it is important to make sure patches get submitted upstream.17:02
ogasawaraAlso, keeping the delta we have between our kernel and the upstream kernel as small as we can makes it much much easier to maintain the kernel from our end.17:02
ogasawaraAs such, the Ubuntu kernel team's preferred policy is for all patches to be submitted and accepted into the upstream kernel before pulling them into the Ubuntu kernel.17:03
ogasawaraSo how does this happen?17:03
ogasawaraLet's begin with our first talking point.17:03
ogasawara== Choosing bugs to patch ==17:03
ogasawaraIdeally we want to isolate good bug candidates that could easily be resolved if a patch were applied.17:03
ogasawaraA good approach might be to tackle the low hanging fruit first, ie bugs with patches already attached.17:03
ogasawaraLaunchpad has the ability to search for kernel bugs with patches attached.17:04
ogasawarahttps://bugs.edge.launchpad.net/ubuntu/+source/linux/+bugs?field.has_patch=on17:04
ogasawaraAs I had mentioned previously, due to the large volume of bugs, there are times when bugs are filed with patches attached to fix an issue but they unfortunately get lost in the noise.17:04
ogasawaraIf we have additional volunteers trying to keep and eye on these types of quick fixes, it would be much appreciated.17:04
ogasawaraEven just getting these types of bugs into a triaged state would be a great help.17:05
ogasawaraIf anyone is interested in getting involved, ping me after the session and I'be be happy to help get you started.17:05
ogasawaraMany times we see a reporter will open a bug and mention the issue can be fixed with a patch that exists upstream alread.17:05
ogasawaraSince the patch is already upstream, it's a simple process for a kernel developer to cherry pick the fix back into the Ubuntu kernel.17:05
ogasawaraThat is one example of how patches get pulled from the upstream kernel into the Ubuntu kernel.17:06
ogasawaraHowever, not all bugs with patches can be resolved so easily.17:06
ogasawaraSometimes a bug will have a patch attached but the patch itself has not been submitted/applied upstream nor to the Ubuntu kernel.17:06
ogasawaraThese are the types of patches we want to focus on getting merged upstream and back into the Ubuntu kernel, assuming they are a valid fix.17:06
ogasawaraIt's helpful to inquire with the patch author about the nature of the patch.17:07
ogasawaraIs the patch just a workaround for the issue but does not address the root cause?17:07
ogasawaraWas the patch only meant for debugging purposes to isolate the issue?17:07
ogasawaraWe have to keep in mind that not all patches will be the proper fix.17:07
ogasawaraIf the patch is a band aid and not a proper fix, it shouldn't be applied.17:07
ogasawaraOn the other hand, if the patch author just needs assistance with submitting the patch, hopefully the information I talk about next will help.17:08
ogasawaraIf anyone ever has a situation where they have a question regarding a patch they've seen or personally written, please don't hesitate to contact the kernel team.17:08
ogasawaraWe're usually in the #ubuntu-kernel IRC channel on FreeNode and obviously also closely watch the Ubuntu kernel team mailing list.17:08
ogasawaraI'd like to take a second here to pause and field any questions before we move onto discussing the patch submission process.17:08
ogasawaraIf there are no questions, we'll just move right along . . .17:09
ogasawaraNavaneeth> QUESTION: Patches applied on ubuntu kernel are sent back to upstream?17:09
ogasawaraNavaneeth: indeed we actually strive to push the patch upstream first, before applying to Ubuntu17:09
ogasawaraNavaneeth: that might not always be the case so after each release, we review our delta from upstream and work to get the non-ubuntu specific patches pushed up17:10
ogasawara== Patch Submission Process ==17:11
ogasawaraFirst we need to confirm the patch does indeed resolve the issue.17:11
ogasawaraIf you yourself can confirm the issue is resolved with the patch, that's perfect.17:11
ogasawaraOtherwise, we need to work with whomever has reported the issue and have them confirm the patch fixes the problem.17:11
ogasawaraOnce we have confirmation the fix is valid, we're ready to send the patch upstream.17:12
ogasawaraIf the bug the patch fixes happens to be reported in Launchpad, for completeness sake, the patch can be uploaded as an attachment to the bug report.17:12
ogasawaraWhen uploading the patch, be sure to select the "This attachment is a patch" option.17:12
ogasawaraNow, lets go through preparing the patch to submit upstream.17:12
ogasawaraUpstream has this process clearly documented at the following link.17:12
ogasawarahttp://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob_plain;f=Documentation/SubmittingPatches17:12
ogasawaraI'll highlight some of the more important bits below . . .17:13
ogasawara1. Know who/where to submit the patch.17:13
ogasawara   This can be done by examining the MAINTAINERS file in the linux kernel tree17:13
ogasawara   http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=MAINTAINERS17:13
ogasawara2. Be sure to create the patch against the upstream kernel source, not the Ubuntu kernel source.17:13
ogasawara   http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git17:13
ogasawara   Note that some subsystems maintain their own git trees.17:14
ogasawara   If this is the case, create the patch against the subsystem's tree.17:14
ogasawara   The location of the subsystem's tree can also be found in the MAINTAINERS file17:14
ogasawara3. Clearly describe what the patch is fixing.17:14
ogasawara   Also be sure to break large patches up into small logical pieces.17:14
ogasawara   A good rule of thumb is each patch should fix one specific issue.17:15
ogasawara4. Be sure to note the version of the kernel the patch applies to.17:15
ogasawara   When submitting a patch upstream, the patch should apply cleanly to the latest version of the upstream kernel available.17:15
ogasawara5. Make sure the patch adheres to the kernel's coding style.17:15
ogasawara   http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob_plain;f=Documentation/CodingStyle17:15
ogasawara  If you run scripts/checkpatch.pl, this should quickly detect any coding style violations.17:15
ogasawara6. Make sure to maintain full provenance of the patch by signing off on the patch.17:16
ogasawara   Signing off on the patch allows others to see the full history of who's written/reviewed the patch.17:16
ogasawara   Signing off is done by simply adding the "Signed-off-by:" line to your patch.17:16
ogasawara7. Send the patch as plain text in the email.17:16
ogasawara   Do not attach the patch.17:17
ogasawara   It's quicker to review a patch that's already present in the body of the email rather than having to download and open an attachment.17:17
ogasawara   Your email client should provide a way to inline the text directly from the patch file into the body of the email.17:17
ogasawara   Additionally, plain text allows others to respond and annotate their feedback directly in the context of the patch.17:17
ogasawara   Be careful if you just cut and paste as this might have negative affects like switching tabs to spaces and therefore violating the kernel coding style.17:17
ogasawara   Also, be careful that your email client doesn't mangle the patch by line wrapping the patch.17:18
ogasawara8. Prefix the subject of the email with "[PATCH]"17:18
ogasawara   This allows people to immediately know this is a patch being submitted.17:18
ogasawara9. Don't give up.  Be persistent :)17:18
ogasawara  If the patch is not immediately applied there are usually reasons.17:18
ogasawara  Take suggestions constructively and fix up the patch if necessary.17:19
ogasawara  Patches might go through a few rounds of reviews and iterations before being accepted.17:19
ogasawara  If there is no response or feedback after submitting a patch, don't be afraid to submit it again.17:19
ogasawaraEventually the patch should hopefully receive the required Ack's from upstream and get applied.17:19
ogasawaraOnce the patch is applied upstream it will automatically make it's way into the Ubuntu kernel upon the next rebase.17:20
ogasawaraIf the patch should be considered for a Stable Release Update to a previous kernel release, the patch must come via the upstream stable tree.17:20
ogasawaraIn order for a patch to be accepted into the upstream stable tree, the patch must meet certain criteria.17:20
ogasawaraThe patch should be relatively small in size (less than 100 lines of code).17:20
ogasawaraThe patch must fix a real issue, no hypothetical use case fixes.17:20
ogasawaraThe patch must already exist in Linus' tree upstream.17:21
ogasawaraFor a full list of criteria, please refer to the following:17:21
ogasawarahttp://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/stable_kernel_rules.txt17:21
ogasawaraSubmitting a patch to the upstream stable tree is as easy as sending the patch in an email to stable at kernel.org17:21
ogasawaraAlternatively, when originally submitting a patch upstream, one can add a "CC:" line under their "Signed-off-by:" line.17:21
ogasawaraFor a more detailed explanation of sending a patch to upstream stable, ssee the stable_kernel_rules.txt file referred to above.17:22
ogasawaraOnce a patch has been submitted upstream, I usually like to add a reference to the upstream thread from the bug report.17:22
ogasawaraThis allows anyone wanting to track the current status of the patch to read and follow along with the thread upstream.17:22
ogasawaraAgain, if any patch author needs helps submitting a patch upstream, don't hesitate to ask those on the kernel team for help.17:22
ogasawaraI'm going to pause once more to field any questions.17:23
ogasawaramirsal> QUESTION: What about using git to produce patches ?17:23
ogasawaramirsal: of course, that's an excellent way to generate your patch17:23
ogasawaramirsal: for those not familiar with git, the command it 'git format-patch'17:23
ogasawaraNavaneeth> QUESTION: Will this session covers debugging kernel source code and fixing a bug? If not, is there any helpful materials available online?17:24
ogasawaraNavaneeth: I'm going to walk through and example of a bug that was fixed and the patch pushed upstream17:24
ogasawaraNavaneeth: it likely won't go as in depth into the debugging process as you'd like, I'll point you to helpful materials after the session17:25
ogasawaravishalrao_vbox> QUESTION: Do you @ubuntu have a hardware testing lab of sorts? For example can you test SSD support as you can see LP #502219 ?17:25
ogasawaravishalrao_vbox: we do have access to hardware we maintain in a lab17:25
ogasawaravishalrao_vbox: I do not know off the top of my head about the hw in the bug you note, but I'll take a look after the session17:25
ogasawaraany other questions?17:26
ogasawaraok, we'll move along17:26
ogasawara== Example of Submitting a Patch Upstream ==17:27
ogasawaraI thought it would be a good idea to walk through an actual bug whose patch was sent upstream.17:27
ogasawaraLets take a look at https://bugs.launchpad.net/ubuntu/+source/linux/+bug/36668217:27
ogasawaraThis bug was about a system hanging on reboot.17:27
ogasawaraThis particular bug was fixed by creating a patch to add a reboot quirk for this particular system.17:27
ogasawaraThis patch would be beneficial not only for Ubuntu users but all users who had this hardware.17:28
ogasawaraAs such, this was a good patch candidate to send upstream.17:28
ogasawaraFrom reading the report, you can see the original bug reporter was able to confirm the patch fixed the issue.17:28
ogasawaraI, the submitter, carefully read the upstream SubmittingPatches document and made sure to adhere to the items outlined in that document.17:28
ogasawaraLet's look at the actual email I posted:17:29
ogasawarahttp://lists-archives.org/linux-kernel/27263461-x86-asus-p4s800-reboot-quirk.html17:29
ogasawara1) I tried to make sure I had a clear and well written description.17:29
ogasawara   I made sure to clearly state what the issue was and what it is the patch was fixing.17:29
ogasawara   I provided system information to help identify hardware that this patch would impact.17:29
ogasawara   I made sure to note that the bug reporter had tested and confirmed the patch resolves the issue.17:29
ogasawara   Additionally, I explained how and why it is I crafted the patch the way I did.17:30
ogasawara2) I made sure to follow the upstream kernel coding style17:30
ogasawara3) As you can see in the link, I inlined the patch within the body of the email17:30
ogasawara4) "[PATCH]" was prefixed in the subject line of the email17:30
ogasawara5) I examined the MAINTAINERS files to see that I should send the patch to the three subsystem maintainers (Thomas Gleixner, Ingo Molnar, H. Peter Anvin) and the x86 mailing list.  I also CC'd LKML for good measure.17:31
ogasawara6) I also saw from the MAINTAINERS file that they had their own linux-2.6-x86.git tree so I made sure my patch cleanly applied to the tip of this tree.17:31
ogasawara7) As a final task, I made sure I signed off on the patch by adding my "Signed-off-by:" line.17:31
ogasawaraThe one thing that I failed to do was mention the version of the kernel this should be applied to.17:32
ogasawara:/17:32
ogasawaraThankfully the patch was accepted and applied even with this slight oversight.17:32
ogasawarahttp://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4832ddda2ec4df96ea1eed334ae2dbd65fc1f54117:32
ogasawara^^ there's the patch in it's upstream form17:32
ogasawaraAdditionally the maintainer CC'd upstream stable when applying this patch.17:32
ogasawaraAs a result we have already had the patch come back to Karmic via the 2.6.31.9 upstream stable kernel.17:33
ogasawaraThis is the typical scenario of how a patch goes upstream first and then makes it's way back into the Ubuntu kernel.17:33
ogasawaraThere are obviously exceptions that are sometimes made.17:33
ogasawaraIf a patch is for example a Critical bug fix, the Ubuntu kernel team may opt to temporarily carry the patch while it's going through the upstream submission process.17:33
ogasawaraThe patch must still adhere to the usual patch submission policy and procedures.17:34
ogasawaraThere are also cases where the patch is Ubuntu specific and therefore does not make sense being submitted upstream.17:34
ogasawaraFor example, https://bugs.launchpad.net/ubuntu/+source/linux/+bug/39351717:34
ogasawaraThis was an Ubuntu specific issue where we failed to completely remove a driver.17:34
ogasawaraIf the patch is an Ubuntu specific patch, just send it to the Ubuntu kernel team mailing list.17:34
ogasawaraAdditionally opening a bug in Launchpad to track the issue would also be good (and required when we go to fix the issue)17:35
ogasawaraLet's quickly pause again here for questions.17:35
ogasawaraOtherwise I'll keep going17:35
ogasawaraOK, lets keep moving17:36
ogasawara== Reasons for not applying a patch ==17:36
ogasawaraIf it isn't good enough for upstream it likely isn't good enough for us.17:36
ogasawaraThat's not 100% true, but the basic idea is that if the patch is not in upstream, that generally means the patch is not likely ready for mass consumption.17:36
ogasawaraUbuntu's kernel is not a testing ground for experimental features.  We need stability.17:37
ogasawaraAs I mentioned earlier, maintaining patches in our tree is not an easy task if we have a large delta of divergence between our tree and the upstream tree.17:37
ogasawaraIf we have a small delta to rebase, it makes maintaining the kernel much simpler.17:37
ogasawaraAlso, if the code has deviated from what's upstream, it's hard to get any additional help from the upstream developers to debug any issues that may arise.17:37
ogasawaraThere could also be security repercussions by carrying custom patches that are not upstream.17:38
ogasawaraThe patch could contain potential security vulnerabilities, which we would likely never hear about since the code isn't part of the stock vanilla kernel and routinely being examined.17:38
ogasawaraPatching stock code could also introduce bugs.  Adding bugs is bad.17:38
ogasawaraIt also might be that the patch is not against a new enough kernel.17:39
ogasawaraThe issue and fix may not be relevant against the actively developed kernel.17:39
ogasawaraWe also have to be careful about patches that may have a broad reaching impact.17:39
ogasawaraEven though a patch may fix an issue for one person, it may regress 10 others.17:39
ogasawaraFinally, the simplest explanation for why a patch might not be applied is that the patch might not be a legitimate patch which should be carried.17:40
ogasawaraLike I mentioned earlier, band aid's and hacky workarounds will not be applied wholesale.17:40
ogasawaraSo what happens now if a patch was not accepted???17:40
ogasawaraThere's usually a good reason why a patch wasn't accepted and it's usually explained in a response to the patch submission email.17:40
ogasawaraIf there are suggestions for improvements that need to be completed before a patch will be accepted, make the improvements and resubmit.17:41
ogasawaraMost patches go through this type of review process and will need to be modified and re-submitted a few times before they are accepted.17:41
ogasawaraAs I mentioned before, don't give up.17:41
ogasawaraIn the end, there will however still be patches that never make it upstream nor into Ubuntu.17:42
ogasawaraAn alternative if someone so chooses would be to roll their own kernel with the patch applied.17:42
ogasawaraAnyone should be able to do this by following the kernel compile guide17:42
ogasawarahttps://help.ubuntu.com/community/Kernel/Compile17:42
ogasawaraNote that building and booting your own custom kernel is done purely at the users own risk17:43
ogasawaraNext week we're looking to clean up this Kernel/Compile guide to be more user friendly and easier to follow.17:43
ogasawaraI was going to pause once more in case there are any additional questions, otherwise I'll start to wrap it up17:44
ogasawaravishalrao_vbox> QUESTION: after you submit a patch, how do you get notified whether it was accepted or rejected?17:44
ogasawaravishalrao_vbox: typically you've receive an email from the maintainer that the patch has been applied17:44
ogasawaravishalrao_vbox: otherwise they'll likely send feedback on what needs to be fixed up with the patch17:45
ogasawaraNavaneeth> QUESTION: Do you add new features to Ubunutu kernel without upstream having it? If yes, can you list out a feature like that?17:45
ogasawaraNavaneeth: we typically try to refrain from doing such a thing17:45
ogasawaraNavaneeth: again, it's that whole pain point of maintaining something out of tree17:46
ogasawaraanything else?17:46
ogasawaravishalrao_vbox> QUESTION: what is this "SAUCE" we see mentioned in some ubuntu kernel changelogs?17:46
ogasawaravishalrao_vbox: those are the Ubuntu specific patches17:46
ogasawaravishalrao_vbox: those ones will likely never go back upstream as they don't make sense to go back upstream17:47
ogasawaravishalrao_vbox> ogasawara: S.A.U.C.E. stands for? (acronym?)17:47
ogasawaraheh, I don't think it's actually an acronym in our usage of it, if it is I don't know what it stands for :)17:48
ogasawaramy understanding it implies it our "special sauce" patches17:48
ogasawaraanything else?17:48
ogasawaravishalrao_vbox> yes, i figured, i was wondering if its all uppercase for a reason :)17:49
ogasawarait's uppercase so it's easy for us to spot and search against in the logs17:49
ogasawarawe try to examine all our sauce patches each release and figure out why we have them and if they are still needed17:49
ogasawaraok, lets move on to the last item17:50
ogasawara== Getting Help ==17:50
ogasawaraI'd like to remind anyone that if you need assistance or have any questions regarding a patch, need a patch to be reviewed, or need help getting the patch submitted upstream, the Ubuntu kernel team would be happy to help.17:50
ogasawaraPlease contact us through the kernel team mailing list or in the #ubuntu-kernel IRC channel on FreeNode.17:50
ogasawaraIf you need to know the kernel team mailing list address, refer to our wiki.ubuntu.com/KernelTeam17:51
ogasawaraAlso, most of what we covered today I'd previously documented at https://wiki.ubuntu.com/KernelTeam/KernelPatches17:51
ogasawaraI've also started graphing some trends for bugs with patches attached:17:51
ogasawarahttp://qa.ubuntu.com/reports/ogasawara/csv-stats/bugs-with-patches/linux/17:52
ogasawaraIt would be great to see if we can drive the number of bugs with patches attached down to 0.17:52
ogasawaraWe've already made this a focus of previous kernel team bug days, but any additional help is appreciated.17:52
ogasawaraAnd one last shameless plea. . . if anyone is interested in getting involved but just doesn't know where to start, let me know!17:52
ogasawaraI'll be glad to help get you started.17:53
ogasawaraAnyways, thanks again to all for listening.  I'll finish to fielding the remaining questions.17:53
ogasawaraas time permits :)17:53
ogasawaravocx> QUESTION: what percentage of bug reports filed against the kernel are invalid? I'm under the impression that a lot of new users incorrectly file bug reports against the kernel, which contributes to much "noise".17:53
ogasawaravocx: it is true that the kernel does get a large amount of bugs that are not valid against the kernel, but they are still valid in a sense that it's an issue against a different package17:54
ogasawaravocx: I can't quote an exact number unfortunately17:54
ogasawaravocx: but we do appreciate the community triage help on making sure the bug finds it's way to the proper package17:55
ogasawaravocx> QUESTION: what percentage of patches are rejected?17:55
ogasawaravocx: I'd say a very small percentage of patches are outright rejected17:55
ogasawaravocx: probably less than 5%?17:55
ogasawaravocx: If an issue is legitimate it can stay open17:56
ogasawaravocx: patches are always welcome :)17:56
ogasawaravocx> QUESTION: how much experience do you need to be able to submit a patch to the Linux-freaking-Kernel?17:56
ogasawaravocx: you will need to have a general understanding of the kernel to know that the patch is correct17:57
ogasawaravocx: but it's not rocket science :)17:57
ogasawara<ecm123> QUESTION: I've heard the Nouveau driver was going to be included in in lucid's kernel, however lucid will not use the 2.6.33 kernel in which this driver is included by default, does that mean the ubuntu kernel team will maintain the driver all by itself in lucid?17:57
ogasawaraecm123: yes there are talks/works to have this backported and available17:58
ogasawaraanything else?17:59
ogasawara1min . . .17:59
ogasawaraNavaneeth> QUESTION: As promised, can we have the online materials for debugging kernel source?17:59
ogasawaraof course, give me a few minutes to gather the links and I'll post it to ubuntu-classroom-chat so not to run over into the next session17:59
ogasawaraok, that's it for me18:00
ogasawarathanks everyone!18:00
* ogasawara hands off to bdmurray 18:00
* bdmurray takes the mic18:00
bdmurrayHi, my name is Brian Murray and I'm a member of the Ubuntu QA team.18:01
bdmurrayI'm here today to talk about how you can get higher quality bug reports about packages that you care about.18:01
bdmurrayOne way you can do this is by writing an apport hook for your particular package.18:02
bdmurrayLet's start off by talking about what apport is.18:02
bdmurray Apport is a system which intercepts crashes right when they happen, in development releases of Ubuntu, and gathers useful information about the crash and the operating system environment.18:02
bdmurrayAdditionally, it is used as a mechanism to file non-crash bug reports about software.18:02
bdmurrayThis allows us to define what software we want to receive bug reports about and what information will be included in those bug reports.18:03
bdmurrayLet's look at a sample apport bug report - http://launchpad.net/bugs/416701.18:03
bdmurrayThe bzr package does not have an apport hook but some useful information is still collected.18:03
bdmurrayWe have the architecture, the release being used, the package version and the source package name.18:04
bdmurrayAdditionally, in the Dependencies.txt attachment we have information about the versions of packages upon which bzr depends.18:04
bdmurrayAre there any questions so far?18:04
bdmurrayOkay, so while all of that can be helpful an apport hook for a package allows us to gather specific information for a package.18:06
bdmurrayFor example, consider a bug report about usplash.  usplash has a dedicated configuration file, located at "/etc/usplash.conf", and this would be something quite helpful in debugging a usplash bug report but not very useful in other package bug reports.18:06
bdmurrayApport looks for package hooks in "/usr/share/apport/package-hooks/" on the local system for ones named after the package for which they will be used.18:06
bdmurrayLooking in "/usr/share/apport/package-hooks/" lets take a look at the usplash hook - with the filename usplash.py.  I've also pastebin'ed the hook to http://pastebin.ubuntu.com/364661/.18:07
bdmurrayThe package hooks are written in python.18:07
bdmurrayWe can see that the usplash.py hook imports the apport.hookutils module - "from apport.hookutils import *".18:07
bdmurrayhookutils is a collection of readymade and safe functions for many commonly used things.  There are functions for attaching a file's contents, getting a command's output, grabbing hardware information and much more.18:08
bdmurrayThis package hook is using 'attach_file_if_exists' and 'attach_hardware'.  'attach_file_if_exists' is pretty self explanatory but what does attach_hardware include?18:08
bdmurrayLet's look at the hookutils module to find out.  You can use "python -c 'import apport.hookutils; help(apport.hookutils)'" or you can view it using codebrowse - http://bazaar.launchpad.net/~apport-hackers/apport/trunk/annotate/head%3A/apport/hookutils.py.18:09
bdmurrayThe 'attach_hardware' function starts at line 72.18:09
bdmurrayAs we can see it adds a wide variety of hardware information to a bug report which can be quite useful for some packages like the kernel and usplash!18:10
bdmurrayHaving the apport package hooks has reduced the amount of bug "ping pong" necessary to get information out of a bug reporter and having these convenience functions reduces the amount of work it takes to write a package hook.18:11
bdmurrayIn addition to 'attach_hardware' and 'attach_file_if_exists' other functions include: 'attach_conffiles', 'attach_dmesg', 'attach_alsa', 'command_output', 'recent_syslog', 'pci_devices' and 'attach_related_packages'.18:12
bdmurrayIn the event that you have a group of packages that would benefit from a shared convenience function, please file a bug about apport and include the function you'd like added.18:13
bdmurrayAre there any questions so far?18:13
bdmurraySo, back to the usplash hook, we can see that the usplash configuartion file is added like so "attach_file_if_exists(report, '/etc/usplash.conf', 'UsplashConf')".18:15
bdmurrayThis means that a bug reported about usplash using apport should have an attachment named 'UsplashConf' and it will contain the reporter's usplash.conf file.18:15
bdmurrayLooking at http://launchpad.net/bugs/393238 we can see this actually isn't the case.18:16
bdmurrayBecause usplash.conf is only 4 lines it ends up getting put into the bug description.  However, most items end up getting added as attachments in Launchpad.18:16
bdmurrayFor example, lspci-vnvn.log or BootDmesg.txt18:17
bdmurrayLet's take a look at another package hook for apport.18:17
bdmurrayThe totem hook is particularly interesting as it is utilizes interactive questions - which is a new feature in apport.18:18
bdmurrayYou can see how this works by executing "ubuntu-bug totem", but please don't actually report the bug! ;-)18:18
bdmurrayMore detailed information regarding how to use the hook user interface can be found in the python help for the available functions: "python -c 'import apport.ui; help(apport.ui.HookUI)'".18:19
bdmurrayThe totem hook asks questions and runs tests to determine if the bug report is related to alsa, pulseaudio or codecs in gstreamer.18:20
bdmurrayIt then sets the affected package appropriately.18:20
bdmurrayThe interactive hook greatly reduces the amount of triaging work required (as questions are asked before the bug is reported instead of after) and helps make the initial bug report much more complete.18:21
bdmurrayOh, here's a link to the totem hook - http://pastebin.ubuntu.com/364672/18:22
bdmurrayAre there any questions regarding the material I've covered so far?18:23
bdmurrayNow that we know a lot of what hooks can do, lets talk about how to write one.18:25
bdmurrayAfter the Karmic Ubuntu Developer Summit I compiled a list of packages that had recently received a fair number of bug reports and subsequently might benefit from an apport package hook.18:26
bdmurrayThat list can be found at https://wiki.ubuntu.com/QATeam/Specs/IncreaseApportCoverage.18:26
bdmurray< yltsrc> QUESTION: where i can find hooks for all default ubuntu18:27
bdmurray                applications?18:27
bdmurrayyltsrc: they will be installed on your system in "/usr/share/apport/package-hooks".  Each hook is distributed with the package it is used for instead of being distributed with apport.18:28
bdmurrayThis allows developers to add hooks to their own package and not having modify 2 packages.18:28
bdmurray< qense> QUESTION: Is there a nice table showing what packages have and18:29
bdmurray               what haven't got Apport hooks?18:29
bdmurrayqense: there is a likely incomplete list at https://wiki.ubuntu.com/Apport/PackageHooks18:30
bdmurrayI'll update it soon though18:30
bdmurrayBack to writing an apport hook - Let's take rhythmbox from that list and write a simple apport hook for it.18:31
bdmurrayThe easiest way of writing and testing a package hook is to put one in "/usr/share/apport/package-hooks" named after the appropriate package.18:31
bdmurrayI'll create one called "source_rhythmbox.py".18:32
bdmurrayWe'll import hookutils from apport and os, then in the add_info function we'll add the rhythmdb.xml file, if it exists, and gconf settings for rhythmbox.18:34
bdmurrayThe hook as written looks like http://pastebin.ubuntu.com/262850/.18:34
bdmurrayIts really only 2 lines of code but now we'll have some potentially useful information in every rhythmbox crash or bug report,18:35
bdmurrayAfter I've put this file in "/usr/share/apport/package-hooks" I can test it using "ubuntu-bug".18:36
bdmurrayAfter running "ubuntu-bug rhythmbox", apport presents the user with a dialog asking them if they want to send the problem report.18:37
bdmurrayIn this dialog box we can see the complete contents of the report and if our collected information was attached.18:38
bdmurrayI see a key named rhythmdb.xml which contains the same information as the one on my system and a key named GconfRhythbox which contains my gconf settings for rhythmbox.18:39
bdmurrayThat's really all there is to writing and testing an apport hook!18:39
bdmurrayIn the event that you write a hook for a package that you can not upload or need help getting sponsored, please report a bug about the package missing a hook.18:40
bdmurrayThen add the hook as a patch (or a merge proposal) and subscribe me, brian-murray, and the appropriate sponsor's team to the bug report.18:40
bdmurrayI'll work to ensure that it gets uploaded.18:41
bdmurrayAnother thing to consider is that a hook isn't just useful for bug reports going forward,18:41
bdmurrayit could actually help you out with your existing bug reports!18:42
bdmurrayFor example, if you write a hook for your package right now and get it included in Lucid you could then have bug reporters execute 'apport-collect' and the number of the bug they've reported.18:43
bdmurrayThis will then use the package hook to include the information you want in the already reported bug.18:43
bdmurrayAre there any more questions about writing apport package hooks?18:44
bdmurrayAnother way to get more detailed bug reports is by setting the bug filing guidelines for packages in Launchpad.18:47
bdmurrayThese are presented when someone files a bug via the web interface at Launchpad.18:48
bdmurrayFor example if you were to file a bug about ffmpeg at https://bugs.edge.launchpad.net/ubuntu/+source/ffmpeg/+filebug ... you would be presented with the package's bug filing guidelines - http://people.canonical.com/~brian/tmp/package-bug-filing-guidelines.png.18:48
bdmurrayThis particular package's bug guidelines asks for specific information that would be rather challenging to gather with an apport hook.18:49
bdmurrayThe bug reporting guidelines for ffmpeg can be set at https://edge.launchpad.net/ubuntu/+source/ffmpeg/+edit.  The url will be similar for any other package18:50
=== z is now known as Guest44291
bdmurrayIn the event that you don't have the ability to set the guidelines for a package you care about for some reason, please let me know and I'll be happy to get them set for you.18:50
bdmurrayI see there are some questions!18:51
bdmurray< barcc> QUESTION: can i use apport hook for a project not included in ubuntu but hostet on launchpad?18:51
bdmurraybarcc: possibly.  you might look at the ubuntuone-client hook as an example.18:52
bdmurrayIn particular the following lines18:52
bdmurray    if not apport.packaging.is_distro_package(report['Package'].split()[0]):18:52
bdmurray        report['ThirdParty'] = 'True'18:52
bdmurray        report['CrashDB'] = 'ubuntuone'18:52
bdmurray < vocx> QUESTION: are debug symbols required to be installed before calling apport? what are debug symbols used for?18:53
bdmurrayNo they are not required, an incomplete (w/o debugging symbols) is uploaded to Launchpad and the the retracer takes care of installing the debug symbols and retracing the bug for you18:54
bdmurrayYou could install the debugging symbols your self if you wanted to manually run gdb and get some detailed output about a crash18:54
bdmurray< barcc> QUESTION: is it possible to test apport hooks against lauchpad staging?18:55
bdmurraybarcc: I believe so. If you look at /etc/apport/crashdb.conf there might be a line like #'staging': True18:57
bdmurrayYou could comment that out and then report a bug.18:57
bdmurrayHowever, I've found the dialog that apport presents before filing a bug to be sufficient18:58
bdmurrayAre there any more questions?18:58
bdmurrayIf you need any further help the apport code is very well documented and there are a few wiki pages about it - https://wiki.ubuntu.com/Apport and https://wiki.ubuntu.com/Apport/DeveloperHowTo.  Additionally, you can find me in the ubuntu-bugs channel.  Thanks!18:58
bdmurrayOkay, thanks everyone and have a great day!19:00
jelmerThanks!19:05
jelmerHello everybody!19:05
jelmerI'm Jelmer Vernooij, one of the Bazaar developers and an occasional contributor to Debian and Ubuntu19:06
jelmerI'll be leading the next class about packaging with Bazaar19:06
jelmerFor this class you will need the bzr-builddeb package19:07
jelmerToday we'll have a look at packaging branches on Launchpad, building packages from a branch and making changes to a packaging branch.19:09
jelmerIs everybody here familiar with Bazaar, or should I give a quick introduction to it as well?19:10
jelmerGreat, let's dig into obtaining a packaging branch19:11
jelmerAs of a couple of releases ago, Launchpad supports packaging branches19:11
jelmerYou can find the packaging branches for a particular package by clicking on "Branches" when viewing a source package on Launchpad19:11
jelmerFor example, https://code.edge.launchpad.net/ubuntu/+source/tdb contains the packaging branches for the 'tdb' package19:13
jelmerThese branches are different from the upstream branches that live at http://code.launchpad.net/<project>, and contain upstream19:14
jelmerQUESTION: can you clarify what a package branch is, and how it's different from a regular branch19:14
jelmerA package branch is a bzr branch that contains a source package, i.e. the upstream including any changes that have been made to it and the debian/ directory19:15
jelmerOther than the contents there isn't anything special about a packaging branch19:16
jelmerhttps://code.edge.launchpad.net/ubuntu/+source/tdb lists all of the Ubuntu packaging branches, but James also imports the Debian archive19:17
jelmerfor example, you can have a look at https://code.edge.launchpad.net/debian/+source/tdb which contains the Debian packaging branches19:17
jelmer QUESTION: how do you keep the code in a project branch and it's associated package branch in sync?19:17
jelmerYou can use the "bzr merge-upstream" package to merge in new upstream tarballs19:19
jelmerThis command will also take care of setting the right tags, etc19:19
jelmerBut before we get ahead of ourselves..19:20
jelmerLet's check out the tdb package and try to build it19:20
jelmerIf you're familiar with bzr this should be no surprise to you:19:20
jelmer$ bzr branch lp:ubuntu/tdb tdb-lucid19:20
jelmerAfter this, you should be able to go into the branch and run "bzr builddeb" (or "bzr bd" for short)19:21
jelmerthis will export the current working tree and try to build it19:21
jelmerQUESTION: What is the standard naming convention of a bzr ? lp:~ for some and it's lp:<version>/<project> for some..19:22
jelmerFor upstream branches, it is always ~OWNER/PROJECT/NAME19:22
jelmerfor packaging branches, it is ~OWNER/DISTRO/SERIES/PACKAGE/NAME19:23
jelmerbut there are some abbreviated names available - if SERIES is the development series, you can get by by just specifying the DISTOR and the PACKAGE19:23
jelmerQUESTION:is there a way to search the lp bzr from cli?19:24
jelmerThere is no way to query the lists of branches on Launchpad using the bzr cli at the moment19:25
jelmerMainly because nobody has had the time to add it yet, patches to add such support would certainly be welcome :-)19:26
jelmer(It should also be possible to run "bzr bd lp:ubuntu/tdb", but I haven't tried that in a while)19:26
jelmernow that we've built the package, let's have a look at making some changes19:27
jelmerThe idea is that in the future it will be possible to upload a new version of package simply by pushing to lp:ubuntu/<packagename>19:27
jelmerwe're not quite there yet, at the moment you will still have to manually build the sourcepackage and upload it.19:28
jelmer(upload it using dput, that is)19:29
jelmerThere are importer scripts, run by james_w, that update lp:ubuntu/<package> to match whatever has been uploaded using ftp.19:29
jelmerQUESTION: my build failed because it couldn't sign the package19:29
jelmeryou can use "bzr bd -- -uc -us" to skip the signing, as I assume most of you won't have access to my private GPG key ;-)19:29
jelmerQUESTION: Do ubuntu-stable-release updates work the same way, except one proposes a merge instead of attaching a diff to a bug?19:30
jelmerI'm not familiar with the ubuntu-stable-release process, can somebody else tell perhaps?19:31
jelmerQUESTION: If I want to create a new package branch for a package not yet in Ubuntu, where should I put it?19:31
jelmerThat's a good question - at the moment it is not possible to push a new branch for a package that doesn't exist in Ubuntu yet19:32
jelmerSo at the moment you will have to wait until the first version of your package has been uploaded before you can push your branches19:32
jelmerSupporting pushing before the upload is something that is on the todo list of the launchpad developers.19:33
jelmerLet's have a look at making a change and preparing an upload.19:34
jelmerLet's make a dummy change, perhaps fixing the outdated docs?19:34
jelmer$ echo "Don't panic." > docs/README19:34
jelmerNext, we should of course update the changelog:19:34
jelmer$ dch -i "Fix the documentation. "19:35
jelmerWhen we would like to commit this change, the only thing we have to do is run "debcommit"19:35
jelmer$ debcommit19:36
jelmerdebcommit will create the commit in Bazaar and will automatically figure out the correct commit message based on the changes to the changelog19:37
jelmerNext, we should be able to build the source package that we'd like to upload19:37
jelmere.g. "bzr bd -S" (-S for source package)19:37
jelmerQUESTION: why is debcommit separate from the bzr- builddeb commands?19:38
jelmerdebcommit is part of the debian developer scripts, and works for a variety of version control systems19:38
jelmerin newer versions of bzr-builddeb you can also use just "bzr commit"19:39
jelmerand bzr will fill in a suggested commit message, similar to the one debcommit uses19:39
jelmeronce you have uploaded the package and are happy with it, you should tag the version in bzr by running "bzr mark-uploaded"19:40
jelmer"bzr tags" should list all of the existing tags19:40
jelmerthe tags should all you to easily navigate all of the versions of a package using bazaar19:42
jelmerAn easy way to browse the history is by using "bzr viz" from the bzr-gtk package19:43
jelmerAnother command that is provided by the bzr-builddeb package is "bzr import-dsc"19:43
jelmerThis command allows you to import existing tarballs that have been published in the past19:44
jelmerit is the main engine behind the importer scripts that create the branches owned by ~ubuntu-branches19:44
jelmerbzr-builddeb also includes two commands for merging changes into your packaging branch: import-upstream and import-package19:45
jelmerimport-upstream allows you to import a new upstream version into your package - you specify a tarball and a version string and it will take care of updating your packaging branch and update a new entry to the debian changelog19:46
jelmers/update/add/19:46
jelmerand s/import-upstream/merge-upstream/, obviously - sorry19:46
jelmermerge-package allows you to merge from another packaging branch19:46
jelmerfor example, if you need to merge changes from a debian packaging branch you can use merge-package19:47
jelmeramong other things, this will take care of merging debian/changelog in a smarter way than "bzr merge" does19:47
jelmerIs everybody keeping up so far?19:47
jelmermerge-package should no longer be necessary after the next bzr release, when "bzr merge" will just Do The Right Thing.19:48
jelmerThat concludes what I wanted to talk about - are there any more questions or would you like me to expand on anything?19:49
jelmerQUESTION: I noticed multiple .deb packages were made, does a package branch create more than one package?19:50
jelmerA package branch is like a versioned source package - like a source package multiple binary packages can be created from it19:51
jelmerQUESTION: are there some good resources for someone new to debian packaging to better understand the structure and process?19:52
jelmerYou might want to read the log from the getting started session: https://wiki.ubuntu.com/MeetingLogs/devweek1001/GetStarted19:53
jelmerThere are also some good resources on the wiki and in the Debian developer corner19:54
jelmerQUESTION: years ago, I think I read 'bazaar' and 'bzr' were two different, closely related programs, maybe forks. Is this true nowadays? Is 'bazaar' exactly the same as 'bzr'?19:55
jelmerThe bazaar project has had two different incarnations: "baz" (written in C, derived from arch) and "bzr" (written in Python, from scratch)19:55
jelmerbaz used to own the package name "bazaar" but has been removed from the archive now, "bzr" is the current app that we work on. The "bzr baz-import" command can import from old repositories.19:56
jelmer(The developers that used to work on baz all work on bzr these days)19:58
jelmerAny other questions? Feature requests? Rotten tomatoes?19:59
jelmerQUESTION: unrelated, but is there a bzr plugin like mercurial queues?  I know about loom, but it doesn't let change the order or patches, etc20:00
jelmerThere is also bzr-pipeline, which is similar to but not entirely unlike looms.20:01
jelmerI'm not sure if it supports reordering of patches, but you might want to check it out.20:02
jelmerThanks for your attention, happy hacking!20:02
* kfogel claps for jelmer20:02
kfogelAFAIK, I'm teaching the next class.  Should I wait for some official signal to start? :-)20:03
jelmerThanks Karl :-)20:03
jelmerI don't think there is a chair at the moment20:03
kfogeljelmer: did dholbach or someone lead you in?  (I don't see any record of it...)20:04
jelmerThe next speaker up is Karl Fogel; he works on Launchpad and will introduce you to the wonderful world of Launchpad development!20:04
kfogelIndeed!20:04
kfogelThank you, Jelmer.20:04
kfogelHi, everyone.  To start with, I am by no means the world's greatest expert in lp development.20:04
kfogelI have only recently started doing it.20:04
kfogelThat said, I'm happy to help you get started too -- at least it's fresh in my mind!20:04
kfogel:-)20:04
kfogel  The intended audience is people who use Launchpad -- especially Ubuntu maintainers, but not limited to them -- and see things they might want to improve in Launchpad.  Some users who have already contributed to Launchpad are listed here:20:05
kfogelhttps://dev.launchpad.net/Contributions20:05
kfogelYou too can be listed on that page :-).20:05
kfogel(That list is automatically updated, so if you hack Launchpad, your name will eventually show up there too.)20:05
kfogelFor this class, you should have a web browser open.  You should have a little familiarity with Bazaar or some other decentralized version control system, plus basic comfort with Python and HTML -- but you do not need to be an expert in any of these things.20:05
kfogelI hope that by the end of the session you will feel like you can contribute an improvement to Launchpad whenever you see something that needs fixing.20:05
kfogelThis isn't going to be a write-a-change-in-realtime kind of session, because there's too much to tell you about and I want to keep things moving.  Instead, the idea is that you would keep the transcript of this session around, and come back to it later for a closer look (especially at the examples) if/when you're ready to start writing your own changes.20:06
kfogelNote that much of whath I say here will be stuff you can also find in the dev.launchpad.net wiki.  But the wiki can be a little daunting.  I hope this narrative presentation will give a useful overview of how things go.20:06
kfogelGETTING LAUNCHPAD20:06
kfogelYou may want to start downloading the Launchpad source code if you don't have it already (although it's not really necessary for what we're going to talk about today, it's just good to have so you can explore around).20:06
kfogelNow, normally, the "right" way to obtain the Launchpad source code is to follow the instructions at https://dev.launchpad.net/Getting .20:06
kfogelBut that's actually a somewhat non-trivial process, and involves running a script (I'll explain more later).  So for now, if you just want to get the code fast, so you can explore it during this session, you can download some pre-packaged, compressed Bazaar repositories I've made for you :-).  (But note that when you actually start hacking on Launchpad, you'll want to go back and follow the instructions at https://dev.launchpad.ne20:07
kfogelt/Getting .)20:07
kfogelSo...20:07
kfogelTo avoid overload an any one server, let's do it this way: if your family name starts with the letters "A-M", you can start the download from here:20:07
kfogelhttp://www.red-bean.com/kfogel/lp-hacking/lp-repos.tar.gz20:07
kfogelAnd if your family name starts with the letters "N-Z", get it from here:20:07
kfogelhttp://people.canonical.com/~kfogel/lp-hacking/lp-repos.tar.gz20:07
kfogel(How do you like my load-balancing algorithm?  I'm thinking of patenting it!)20:07
kfogelJust kidding.  I sure hope you're all on slow connections, though :-).20:07
kfogelAnyway, when you unpack it with20:07
kfogel    tar zxvf lp-repos.tar.gz20:07
kfogelyou'll get a new subdirectory named lp-repos, and inside that will be a .bzr subdirectory and a branch named "devel".  "devel" is where the Launchpad sources are.  To actually build and run Launchpad, you need a bunch of other dependencies -- all of which is described at (you guessed it) https://dev.launchpad.net/Getting .20:08
kfogel 20:08
kfogelAt this point, I will pause, both for questions, and so people who want to can start download20:08
kfogeldownloading.20:08
kfogelNote it is not really necessary to have the sources for this talk.  I will give you pointers to all examples.20:08
kfogelAnyone there? :-)20:08
* kfogel waits20:08
kfogel(or say something in #ubuntu-classroom-chat if you can't speak here)20:09
kfogelHeh.  I'll keep going, since the transcript will be useful.  If anyone has a question at any point, please just speak up here or in #ubuntu-classroom-chat.20:09
kfogelRUNNING A LOCAL DEVELOPMENT LAUNCHPAD INSTANCE20:10
kfogelBasically, do what https://dev.launchpad.net/Running says .  I won't actually try to get your instance running during this class, since there are so many people and we have other stuff to cover.  But do note a couple of things:20:10
kfogelAt one point in the setup, you run a script as root.  Yes, that's terrible and awful.  But you can look at the script first :-).  The reason to do that is that a launchpad development instance runs on your local box but using the hostname "launchpad.dev" -- to test stuff, you'll point your browser at URLs that start like this:20:10
kfogel     https://launchpad.dev/20:10
kfogel     https://bugs.launchpad.dev/20:10
kfogel     https://code.launchpad.dev/20:10
kfogel     https://blueprints.launchpad.dev/20:10
kfogel     https://translations.launchpad.dev/20:10
kfogel     https://answers.launchpad.dev/20:10
kfogel     https://lists.launchpad.dev/20:11
kfogelThose would all be running on your local box during development.20:11
kfogelSo the setup scripts modify your /etc/hosts (and a few other files, I think) to take care of this all automatically.20:11
kfogelThe other thing is that if you use PostgreSQL, the scripts will blow any data you have in there.  If that's a problem, just run it in a virtual machine.20:11
kfogelSo, that's how you get it and set it up to run -- just do what that page says.20:11
kfogelAnd understand why it's so complicated!20:12
kfogelGETTING HELP20:12
kfogelThe most important thing to realize is, doing Launchpad development is primarily about communications, not coding.  You do not need mad coding skills, you just need to be comfortable talking to people about your proposed bugfix / enhancement / new feature.20:12
kfogelQUESTION: is there a choice as to which DB you can run it on20:12
kfogelANSWER: not right now, AFAIK.  It's tied to PostgreSQL.20:13
kfogelExcept for really trivial changes (typo fixes and such), most of your time will be spent communicating with other developers, and writing the automated tests for the change.  The actual time writing the change is often the smallest part of it.20:13
kfogelSo even before I tell you how to get the source code, I'm going to tell you how to get help -- how to find the right people to talk to!20:13
kfogelStart here:20:13
kfogeldev.launchpad.net/Help20:13
kfogeljoin the mailing list launchpad-dev {AT} lists.launchpad.net20:14
kfogelAnd use these two IRC channels here on freenode;20:14
kfogel#launchpad-dev and #launchpad-reviews (for reviewing changes you've submitted)20:14
kfogelthe first channel is the main one for conversation about Launchpad development.20:14
kfogelIt is not to be confused with #launchpad, which is for *usage* of Launchpad20:14
kfogelNext thing is:20:15
kfogelWHAT TO WORK ON?20:15
kfogelMost likely, your own usage of Launchpad will drive what you're interested in improving.  But if you want to get an idea of what we think needs fixing, take a look at https://dev.launchpad.net/FixBugs20:15
kfogelHowever, the usual way things work is that you, as a user of Launchpad, run into something that you think should be fixed, and you fix it.20:15
kfogelSo our list of existing bugs is interesting, but not necessarily the driving force for community developers (do check there to see if your bug has already been filed, though).20:16
kfogelHOW TO START TO WORK ON SOMETHING20:16
kfogelYou'll need three key things: a bug, a branch, and a merge proposal.20:16
kfogelIf there isn't already a bug filed for what you want to do, then discuss the proposed change first, in #launchpad-dev or on the launchpad-dev {AT} lists.launchpad.net mailing list.  Once there is general agreement, file a bug describing what you plan to do.  (If it's a new feature, there may be a Blueprint involved too.)20:16
kfogelSo, let's assume that by one route or another, you have a bug filed now.20:17
kfogelThe next step is to roughly describe your proposed solution to an experienced Launchpad developer  -- this is known as the "pre-implementation call", although20:17
kfogelit can also be an IRC chat session instead of a phone call.20:17
kfogelOnce you've got the basic design agreed on (which is usually a pretty quick process), you make a branch.20:18
kfogelA "branch" is equivalent to a patch -- it's how you submit a change to the project.  In order to get the dependencies set up right, I recommend starting one with 'rocketfuel-branch'20:18
kfogel  $ cd MY_LP_BRANCHES20:18
kfogel  $ ls20:18
kfogel  devel db-devel stable db-stable20:18
kfogel  $ utilities/rocketfuel-branch 123456-improve-fish20:18
kfogel  <<... watch output fly by ...>20:18
kfogel  $ ls20:18
kfogel  123456-improve-fish devel db-devel stable db-stable20:18
kfogel  $20:18
kfogel 20:18
kfogelBy the way, if you're wondering what that "devel", "db-devel", "stable", "db-stable" thing is,20:19
kfogelthe answer is here:20:19
kfogelhttps://dev.launchpad.net/Trunk20:19
kfogelBasically, Launchpad has four trunks, instead of one trunk.  There's stable vs devel, and there's db-changes vs no-db-changes.20:19
kfogelIt's all explained on that page.20:19
kfogel95% of the time, you'll be working against 'devel', so when I say "trunk", that's what I mean.20:19
kfogelIn your branch, edit the code and use Bazaar as you normally would.  Make as many commits as you want!20:20
kfogelIt's okay to make lots of small commits.  This is all just in yuor local branch.20:20
kfogelYou should also push the branch up to launchpad, so others can see it.20:20
kfogeljust type 'bzr push' inside the top level of your new branch20:21
kfogelbzr will do the right thing20:21
kfogeland you'll get a branch visible at some place like this:20:21
kfogelhttps://code.launchpad.net/~your_name_here/launchpad/123456-improve-fish20:21
kfogelNote the bug number in the branch name -- this is a convention.  It can go at the beginning or the end, but it's very handy to have it in there.20:21
kfogelYou should also link the branch *to* the bug.20:21
kfogelIf you go to the branch page, there will be a link for that.  Do it immediately, so anyone who20:22
kfogelvisits the bug can see it is being worked on.20:22
kfogelYou might also want to mark the bug's status as "in progress".20:22
kfogelIn a moment, I'll digress into talking about what you actually do to develop.20:22
kfogelBut first, let's assume you're done with your branch, and you want to submit it for review.20:23
kfogelFirst make a merge proposal, in the usual way (there's a link on the branch page for that).20:23
kfogelI recommend going into #launchpad-reviews and seeing who the on-call reviewer is20:23
kfogeland entering them as a reviewer, if they agree.  Or if you're already talking to another lanuchpad developer about the change, they may be available to review it.20:23
kfogelIf your change involves a DB schema change, then click "extra options" on the merge proposa page and put "db" for review type.20:24
kfogelIf it involves visible UI changes, then put "ui" for review type.20:24
kfogel(You can submit to different reviewers for different types of reviews -- ask the developers you're working with who the appropriate people might be.)20:24
kfogelbrief pause for questions...20:25
kfogelokay, continuing20:25
kfogelLaunchpad development is very test-driven.20:25
kfogelMost changes of any size (except maybe for trivial typo fixes and stuff) need automated tests to accompany them.20:26
kfogelThe testing system looks complicated, but don't worry, it's actually complicated.20:26
kfogelThere.  That was comforting, right?20:26
kfogelIt's not so bad.  There are three basic kinds of tests: doc tests, story tests, and windmill (javascript/ui) tests.20:26
kfogelRunning "bin/test -v -t bug.txt"  runs the doc test lib/lp/bugs/doc/bug.txt20:27
kfogelbin/test -v -v -t test_bugtask runs20:27
kfogellib/lp/bugs/browser/tests/test_bugtask.py20:27
kfogel(for example again, and this is all from inside the top of "devel", by the way)20:28
kfogeland bin/test -v -v -t patches-view.txt20:28
kfogelruns tests lib/lp/bugs/stories/patches-view/patches-view.txt .20:28
kfogelI won't go into depth about how those tests work, since the best way to learn them is just to look at the examples there already.  Basically, they are a way to test both the Python-level interfaces you may have added, and a way to test browser behavior (the story tests actually simulate a browser)20:29
kfogelfor more on these, see lib/canonical/launchpad/pagetests/README.txt20:30
kfogeland lib/canonical/launchpad/pagetests/REFERENCE.txt20:30
kfogelBy the way, since you run tests at the command line, the MOST USEFUL TRICK IN THE WORLD is this:20:30
kfogelin the code, you can do the standard python debugger thing:20:31
kfogel        import pdb20:31
kfogel        pdb.set_trace()20:31
kfogel(that's in a .py file somewhere)20:31
kfogeland then when you run your tests, when you get to that spot, you'll be right at an interactive debugger.20:31
kfogelIt is an incredible timesaver.  Highly recommended.20:31
kfogelanother trick is, in the story tests, you'll see how when you show browser page contents, there is a certain output expected -- it's just the raw text (with HTML tags stripped out) from the page, with whitespace all folded20:32
kfogelSo if you want to see the output you're actually getting, just put a bunch of blank lines where the output would be expected, and you'll get a nice diff showing what the browser put out instead20:33
kfogelOkay, now really on to some examples, which I hope will be good references.20:33
kfogelEXAMPLES20:33
kfogelI'm going to use two examples from code changes I happened to make recently.20:34
kfogelI think these are actually fairly clean examples of two types of changes you might find yourself having to make.20:34
kfogelThe first is "What does making a change to the DB schema look like?"20:34
kfogelHere's a branch that makes a very small change to the schema (and it landed recently, I believe):20:34
kfogelhttps://code.edge.launchpad.net/~kfogel/launchpad/509194-506514-bug-heat-db-fixes20:34
kfogelNote the two bug numbers both in the branch name.20:34
kfogel(of course, if there had been many bugs, I would have not done that, or would have had an overarching master bug)20:35
kfogelI'll pause so people can take a look at that code.20:35
kfogelNote how the SQL file we changed was database/schema/patch-2207-27-0.sql.  When the change first started, the file we added and edited was:20:36
kfogeldatabase/schema/patch-2207-99-0.sql20:36
kfogelFor complicated, historical reasons, DB changes come in distinct SQL files, and the "99" convention tells the DB merge person "fit this one in wherever you have the next slot".20:37
kfogelSo by the end, when we merged, we were assigned "27".  But when we were working, it was "99".20:37
kfogel("we" is Abel Deuring and myself, btw -- he's adeuring in IRC)20:37
kfogelThat change went into the db-devel branch, of course, and so our merge proposal was targeted to that.20:37
kfogelRegarding merge proposals, there are two good wiki links about them (thanks to ajmitch for these):20:38
kfogelhttps://dev.launchpad.net/PatchSubmission20:38
kfogelhttps://dev.launchpad.net/CoverLetters20:38
kfogelA "merge proposal cover letter" is the sort of summary description of the change, that helps the reviewer know what they're looking at and how to test it.20:39
kfogelIt is important to give the reviewer the context they need to properly review the change.20:39
kfogelThere will be some more about that in the next example,20:39
kfogelwhich is about making a UI change.20:39
kfogelThis next example comes from https://bugs.edge.launchpad.net/malone/+bug/50601820:40
kfogelwhich is about making a new "+patches" view available (you put "+patches" on the end of certain Launchpad URLs, and you get a listing of patches available for, say, that source package, or project, or whatever).20:40
kfogelThe code branch is here:20:40
kfogelhttps://code.edge.launchpad.net/~kfogel/launchpad/506018-patch-report20:40
kfogelAnd the merge proposal is here:20:40
kfogelhttps://code.edge.launchpad.net/~kfogel/launchpad/506018-patch-report/+merge/1818120:41
kfogelThat's a terrific example of what you can expect from launchpad code review, by the way (above).20:41
kfogelNote how the merge proposal describes the change, makes it clear to the reviewer how to test it.20:41
kfogelAnd the bug itself contains a screenshot (http://launchpadlibrarian.net/38192596/screenshot-2010-01-21_rich_popup.png) so the reviewer knows what to look for.20:41
kfogel  <PAUSE FOR QUESTIONS>20:42
kfogelOkay, so there are two more things I want to talk about.20:42
kfogelThe first is, how does a change actually land?20:42
kfogelThe second is just some standard Launchpad development "gotchas" that tend to bite newbies.  Maybe I can save you some time by telling you about them now!20:43
kfogelHOW TO LAND A CHANGE20:43
kfogelWell, right now, once your branch has passed review (and note that review is something *all* Launchpad developers get, including full-time experts)20:44
kfogelan existing Launchpad developer has to land it.  What they'll do is use the Bazaar PQM plugin:20:44
kfogelhttps://edge.launchpad.net/bzr-pqm20:44
kfogeland run a command like this:20:44
kfogel   $ bzr pqm-submit -m "[r=REVIEWER_NICKNAME][ui=none] Description of change here..."20:44
kfogelinside a branch with your changes.20:45
kfogelYour commits will be landed, even though they were gated through by someone else (and by the PQM -- "Patch Queue Manager" system -- which does some build sanity checks before putting the change on trunk.20:45
kfogel)20:45
kfogelAfter that, your name will show up at https://dev.launchpad.net/Contributions , within a day or so :-).20:46
kfogelTo see what other people's submit messages and commit messages look like, I highly recommend running 'bzr log -n0 > log-n0.out' in one of the four trunk branches, say, "devel".20:46
kfogelIt gives you a good sense for how development goes.20:46
kfogelOkay, I'll pause for a moment before launching into the final section of this class...20:47
kfogel  any questions?20:47
kfogelOkay, it's time for...20:47
kfogelSTANDARD LAUNCHPAD DEVELOPMENT GOTCHAS20:47
kfogelWatch out for 'make schema' -- it will blow away any test data you generated while using your instance.20:47
kfogelSo how do you save previously-generated test data?  Easy:  'make newsampledata'20:47
kfogellike this:20:48
kfogel    $ pwd20:48
kfogel    ...../lp-branches/devel/database/sampledata20:48
kfogel    $ ls -l current* newsampledata*20:48
kfogel    -rw-r--r-- 1 kfogel kfogel 1635602 2009-12-07 14:11 current-dev.sql20:48
kfogel    -rw-r--r-- 1 kfogel kfogel 1583524 2010-01-18 09:01 current.sql20:48
kfogel    -rw-r--r-- 1 kfogel kfogel 1712790 2010-01-18 09:54 newsampledata-dev.sql20:48
kfogel    -rw-r--r-- 1 kfogel kfogel 1583524 2010-01-18 09:54 newsampledata.sql20:48
kfogel 20:48
kfogelthat file, newsampledata-dev.sql, contains the sample data.20:48
kfogelThis is very useful for your reviewers, too!  Save it, attach it where they can use it, so they don't have to generate this data themselves.20:48
kfogel 20:48
kfogelWho are the test users to use in your "launchpad.dev" instance?20:49
kfogellog in as "test@canonical.com" for a standard test user (I think the password is "test")20:49
kfogeland log in as "foo.bar@canonical.com" for an admin-privs user (same pw I think)20:49
kfogel 20:49
kfogelHmm, I'll start numbering the tips now, so you know where the boundaries are.20:49
kfogelTip 3: if things aren't working, you should check the "launchpad.log" file in the top level of your branch20:50
kfogelthat is, when you do a "make run" and then visit the launchpad.dev instance in your browser,20:50
kfogelyour code changes may or may not have the effect you expected.  If they don't have the effect you expected, the answers are often to be found in launchpad.log.20:50
kfogelAlso, /var/log/postgresql/postgresql-8.3-main.log has all your DB queries20:51
kfogel 20:51
kfogelTip 4: Visiting foo.launchpad.dev for the first time may bring up a cert failure thing.  Just accept the cert.20:51
kfogel 20:51
kfogelTip 5: You don't need to restart on a template change (a .pt file).  You DO need to restart on a .py file change.20:51
kfogelThese templates are Zope templates, by the way.20:51
kfogelIf you're new to Zope (I am!) then http://www.owlfish.com/software/simpleTAL/tal-guide.html is your friend.20:51
kfogelAnd we use the Yahoo User Interface (YUI) library for javascript.20:52
kfogelIf you're new to that, see20:52
kfogelhttp://developer.yahoo.com/yui/3 and http://developer.yahoo.com/yui/3/api/module_event.html20:52
kfogel 20:52
kfogelTip 5: terminology.  You may be used to seeing "project" to mean a software program.20:52
kfogelBut inside the code, "project" means "project group", and "product" means what you normally think of as a project.  E.g, firefox is a "product" object in the code.20:53
kfogelWatch out for confusion.  Yes, we're sorry.  No, it's too late to change it now - that would be a massive string-replace :-).20:53
kfogel 20:53
kfogelTip 6: use staging.launchpad.net to test behaviors.  the database gets reset every night or so, so you can't hurt anything.20:53
kfogel 20:53
kfogelTip 7: most of your page UI will be defined by .pt (template) files, for example see lib/lp/bugs/templates/bugtarget-patches.pt20:54
kfogel(the new file added by that 506018 branch I referred to earlier).20:54
kfogelIn a template file, "context/foo" accesses the model, whereas "view/foo" accesses the view.  If you already know Zope, you probably know that.  For the rest of us, it's a pretty basic thing.20:55
kfogel    Also, in the code, such as in a View class (like "BugsPatchesView(LaunchpadView):"), self.context also accesses the model.20:55
kfogel 20:55
kfogelTip 8: we observe an "XXX" convention.  If you leave an XXX comment in the code, meaning "this isn't quite right, but I'm going to leave it for now so I can just finish this feature", then the deal is, file a bug about the XXX, and go back and mark the XXX with your name, the date, and the bug number.20:56
kfogelFor example: "# XXX Jill Random 2010-01-28 bug=123456  We really should use a database query here instead of looping over the objects in Python."20:56
kfogel 20:57
kfogelQUESTION: what is, or what was the deal with open sourcing Launchpad, exactly? To the average user, and many experienced ones, Launchpad is not software, it's just a web page.20:57
kfogel 20:57
kfogelInteresting question.20:57
kfogelCouple of reasons:20:57
kfogelOne, many people become more willing to use Launchpad, and invest time & data into it, if they feel that they are not locked in -- that is, no matter what happens, the source code is open so it can't be lost.20:58
kfogelWe heard from people that they didn't want to host their free software on a proprietary system.  We did want them to use it, so we solved it by making the system not proprietary :-).20:58
kfogelThe second reason is that, although it is a web service, it's one that has a very technically skilled user base, and there's no reason they shouldn't be able to fix problems when they see them.20:59
kfogelSo we're doing something a bit unusual: forming a development community around a piece of software that runs as a web service, but forming the community around that actual service -- around Launchpad.net itself.20:59
kfogelThe code is open, but we try to shepherd all changes onto the running service as quickly as we can.21:00
kfogelWe have a monthly release cycle, and changes become visible on edge.launchpad.net even sooner for beta testers.21:00
kfogelQUESTION: why are there only 14 people outside Canonical with registered contributions?21:00
kfogelANSWER: because one of them is William Grant, who seems to actually about 10 people himself? :-)21:00
kfogelNo, seriously, I think the answer is that Launchpad is complex, and it takes people a while to get up to speed.21:01
kfogelIt's not clear to me whether 14 is too high or too low.  I hope it goes up, of course; but we didn't know what to expect when we open sourced.21:01
kfogelRemember also that we only open sourced six or seven months ago!21:01
kfogelI think that's it.21:01
kfogelI hope this helped those who might consider hacking on Launchpad.  It's been a pleasure; find me in #launchpad-dev if ever have questions of course.21:02
NahseiHello23:45
NahseiI have some questions... can someone help me please?23:45

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!