<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Coffee on the Keyboard &#187; web dev</title>
	<atom:link href="http://coffeeonthekeyboard.com/tag/web-dev/feed/" rel="self" type="application/rss+xml" />
	<link>http://coffeeonthekeyboard.com</link>
	<description>by James Socol</description>
	<lastBuildDate>Mon, 06 Feb 2012 23:33:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/>		<item>
		<title>SUMO in Q2</title>
		<link>http://coffeeonthekeyboard.com/sumo-in-q2-563/</link>
		<comments>http://coffeeonthekeyboard.com/sumo-in-q2-563/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 21:28:13 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[kitsune]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[sumo]]></category>
		<category><![CDATA[waffle]]></category>
		<category><![CDATA[web dev]]></category>

		<guid isPermaLink="false">http://coffeeonthekeyboard.com/?p=563</guid>
		<description><![CDATA[At the end of 2010, I issued a challenge to my team: deploy support.mozilla.com continuously by the end of 2011. So, as we move into the last part of Q1, how are we doing, and what&#8217;s next? So Far This quarter we&#8217;ve managed to completely break free from our old svn repository. All our code [...]]]></description>
			<content:encoded><![CDATA[<p>At the end of 2010, I issued a challenge to my team: <a title="The future of SUMO development" href="http://coffeeonthekeyboard.com/the-future-of-sumo-development-511/">deploy support.mozilla.com continuously</a> by the end of 2011. So, as we move into the last part of Q1, how are we doing, and what&#8217;s next?</p>
<h3>So Far</h3>
<p>This quarter we&#8217;ve managed to completely <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=616703">break free from our old svn</a> repository. All our <a href="https://github.com/jsocol/kitsune">code is in git</a> now. This has simplified our deployments significantly. We&#8217;ve also <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=616702">moved a bunch of code</a> from difficult-to-maintain RewriteRules into the product and made it easier to manage.</p>
<p>We&#8217;ve still got some work to do on JavaScript unit tests and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=625376">moving our crontab into version control</a>, but these are both on track for this quarter, we just have to make sure we make the time.</p>
<p>Overall, I think we&#8217;ve done pretty well so far this quarter. I would give us a B, and we can still get to an A if we can tackle JS tests and crontabs.</p>
<h3>Coming Up</h3>
<p>The two things I&#8217;d like to see next are <strong>faster cycles</strong> and moving toward a <strong>more CD friendly</strong> way of building things. There are two challenges these help address.</p>
<p>Faster release cycles will get us thinking about managing time and planning work when releases aren&#8217;t centered around a big piece of functionality. Instead of starting with a big thing and picking a set of little things to lump in with it, we&#8217;ll need to balance fixing little things with work on bigger features.</p>
<p>By the beginning of June, I want us to <strong>release every week</strong>, whether there&#8217;s something big or not.</p>
<p>CD also presents a new challenge for big features: how do you deal with code that isn&#8217;t completely ready yet?</p>
<p>There are a couple of ways of handling this. One is to use longer-lived feature branches. That works pretty well for desktop software like Firefox where you can hand someone a binary and say &#8220;test this.&#8221; But it&#8217;s a challenge with a web app because, unless we move our staging environments around all the time, it blocks QA from testing something until it&#8217;s not only ready but, in fact, <em>already on production</em>.</p>
<p>A better solution is to use feature flags to hide new functionality until it&#8217;s ready. In this model, everything lives on the same branch (you still do feature branches for bug fix/review and for those times something does need to live a little longer before merging) and all staging servers—and eventually production—run the same code, but with a different set of flags turned on. You can turn a feature on in production after it&#8217;s been verified on stage.</p>
<p>This isn&#8217;t easier. It means structuring code differently, thinking about a new set of constraints. It&#8217;s what we should do.</p>
<p><em>W</em><em>e will screw up</em>, probably a couple of times, before we get this down. That&#8217;s why we should start now, when our mistakes will be confined to staging servers.</p>
<p>In Q2 I want us to <strong>stop using the &#8216;next&#8217; branch</strong> and start using <a title="Introducing Waffle for Django" href="http://coffeeonthekeyboard.com/introducing-waffle-for-django-541/">Waffle</a> to control features until they&#8217;re ready.</p>
<p>Not everything needs to hide behind a flag: small bug fixes obviously don&#8217;t. This may be giving us a window into what QA is like under CD: big things are manually tested before we turn them on, but little fixes, already verified by the developer and reviewer, make it through to production without manual intervention from QA.</p>
<p>We also need to start planning time to remove flags and dead code once a feature has shipped. That is part of the development cost of a feature, and will hopefully be offset by reducing the time it takes to get something to production once it is ready.</p>
<h3>Big Changes</h3>
<p>While Q1 has been about a larger set of smaller, more concrete and isolated changes, Q2 is going to be about a smaller set of much bigger changes.</p>
<p>Q1 was about changing our code. Q2 is about changing our thinking.</p>
<p>I&#8217;m excited about diving into these challenges. I can&#8217;t wait for Q2.</p>
]]></content:encoded>
			<wfw:commentRss>http://coffeeonthekeyboard.com/sumo-in-q2-563/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Django Fixtures with Circular Foreign Keys</title>
		<link>http://coffeeonthekeyboard.com/django-fixtures-with-circular-foreign-keys-480/</link>
		<comments>http://coffeeonthekeyboard.com/django-fixtures-with-circular-foreign-keys-480/#comments</comments>
		<pubDate>Wed, 29 Sep 2010 21:50:00 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[web dev]]></category>

		<guid isPermaLink="false">http://coffeeonthekeyboard.com/?p=480</guid>
		<description><![CDATA[If you create a nice, perfectly normalized database, you (probably) won&#8217;t ever run into circular foreign keys (when a row in table A references a row in table B that references the same row in table A). In the real world, this happens pretty regularly. The most common situation is a &#8220;current&#8221; or &#8220;last&#8221; denormalization. [...]]]></description>
			<content:encoded><![CDATA[<p>If you create a nice, perfectly normalized database, you (probably) won&#8217;t ever run into circular foreign keys (when a row in table A references a row in table B that references the same row in table A).</p>
<p>In the real world, this happens pretty regularly. The most common situation is a &#8220;current&#8221; or &#8220;last&#8221; denormalization. You don&#8217;t really want to do a subquery with a sort every time you want to know the latest post in a forum thread, or current revision of a wiki page.</p>
<p>The problem—one we&#8217;ve been dealing with since <a href="http://coffeeonthekeyboard.com/the-evolution-of-sumo-339/">we decided to rebuild SUMO</a>—is that trying to load data with circular foreign keys produces a &#8220;chicken and the egg&#8221; situation: since each row depends on the other, neither can be loaded first.</p>
<p>(This is part of a bigger problem with MySQL, which is that it lacks deferred foreign key checks.)</p>
<p>The solution to this is to temporarily disable foreign key checks while you load in data. It&#8217;s not hard, but Django is so far <a href="http://code.djangoproject.com/ticket/3615">unwilling</a> to do it.</p>
<p>Well, now we get the chance to see if their concerns are realistic: with <a href="http://github.com/jbalogh/test-utils/commit/ce0e9643ea3b38373823e04d8c2e5f2dc2de5665">the latest commit</a> to <a href="http://jeffbalogh.org/">Jeff Balogh&#8217;s</a> <a href="http://github.com/jbalogh/test-utils">test-utils</a> package for Django, we&#8217;re disabling foreign key checks during fixture loading.</p>
<p>Both <a href="http://support.mozilla.com/">SUMO</a> and <a href="https://addons.mozilla.org/">AMO</a> have had to do some acrobatic hackery to get around the limit. This solution is definitely a filthy hack, but it&#8217;s contained in a single, small place, rather than spread throughout test cases in multiple projects.</p>
<p>Suggestions for improving this hideous monkey patch are welcome, but in the meantime I&#8217;ll be removing the gross parts from <a href="http://github.com/jsocol/kitsune">Kitsune</a> that we needed to work around this.</p>
]]></content:encoded>
			<wfw:commentRss>http://coffeeonthekeyboard.com/django-fixtures-with-circular-foreign-keys-480/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>So You Wanna Help Mozilla?</title>
		<link>http://coffeeonthekeyboard.com/so-you-wanna-help-mozilla-316/</link>
		<comments>http://coffeeonthekeyboard.com/so-you-wanna-help-mozilla-316/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 00:45:22 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[amo]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[sumo]]></category>
		<category><![CDATA[support]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[web dev]]></category>
		<category><![CDATA[webdev]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://coffeeonthekeyboard.com/?p=316</guid>
		<description><![CDATA[A common theme we heard in responses to our web developer survey was: &#8220;I wish I could help Mozilla, but I&#8217;m just a web developer.&#8221; Well, fellow web ninjas, you can put your skills to work with Mozilla and help make the web a better place. Our web projects are open, just like Firefox, and [...]]]></description>
			<content:encoded><![CDATA[<p>A common theme we heard in responses to our <a href="http://hacks.mozilla.org/2009/11/web-developer-survey-update/">web developer survey</a> was: &#8220;I wish I could help Mozilla, but I&#8217;m just a web developer.&#8221;</p>
<p>Well, fellow web ninjas, you <em>can</em> put your skills to work with Mozilla and help make the web a better place. Our web projects are open, just like Firefox, and we&#8217;d love your help!</p>
<p>If you&#8217;re a web developer and want to help Mozilla and Firefox users while working on sites that see millions of visitors every day, follow me through the jump and I&#8217;ll show you around our shop and introduce you to the tools we use.<span id="more-316"></span></p>
<h3>Our Projects</h3>
<p>Mozilla Web Dev is responsible for pretty much every web site at Mozilla, from <a href="https://addons.mozilla.org/">Addons</a> to <a href="http://support.mozilla.com/">Support</a> to <a href="http://www.mozilla.com/">Mozilla.com</a> to <a href="http://www.spreadfirefox.com/">Spread Firefox</a>. We also take care of web services like the <a href="https://wiki.mozilla.org/AUS">Application Update Service</a>, <a href="https://wiki.mozilla.org/PFS2">Plugin Finder Service</a> and the <a href="https://wiki.mozilla.org/Socorro">Crash Report Beacon</a>.</p>
<p>Almost all of our code (everything except Socorro—the crash report beacon—I think) is available on <a href="http://viewvc.svn.mozilla.org/vc/">svn.mozilla.org</a>. You can browse around the server and see the source right now. It will all basically run on the standard LAMP (where P is PHP or Python) stack.</p>
<h3>Our Tools</h3>
<p>The control center of web development at Mozilla is <a href="http://bugzilla.mozilla.org/">Bugzilla</a>. All our work takes the form of &#8220;bugs&#8221; here. A &#8220;bug&#8221; is not necessarily a problem with the software. A new feature or a software update would also be called a &#8220;bug.&#8221; I&#8217;ll talk about the life-cycle of a web development bug below.</p>
<p>IRC is just as important as Bugzilla. Both our staff and our contributors are geographically diverse, and IRC gives us a good way to coordinate and talk to each other around the globe. If you&#8217;re new to IRC, <a href="https://addons.mozilla.org/en-US/firefox/addon/16">ChatZilla</a> is an easy place to start. Most projects have their own channel on <a href="http://irc.mozilla.org/">irc.mozilla.org</a>, like <a href="irc://irc.mozilla.org/sumo">#sumo</a> for Support and <a href="irc://irc.mozilla.org/amo">#amo</a> for Addons. We&#8217;re also usually in <a href="irc://irc.mozilla.org/webdev">#webdev</a>.</p>
<p>As web developers, are chief weapon is HTML. HTML and CSS. HTML, CSS, and JavaScript. <em>No one expects the&#8230;</em> (Sorry.) On the front-end, we chiefly work in HTML, CSS, and JavaScript, and occasionally other technologies like XML. On the back-end, nearly all of our projects are in PHP or Python.</p>
<p>For version control we mostly use Subversion, though git (and git-svn) has gained a bunch of ground lately. (Addons will be <a href="http://micropipes.com/blog/2009/11/17/amo-development-changes-in-2010/">moving to git</a> sometime next year.)</p>
<p>To work on your own computer, you&#8217;ll probably need to set up Apache, MySQL, and PHP or Python. <a href="http://www.apachefriends.org/en/xampp.html">XAMPP</a> can be incredibly helpful here. Working on Linux (or Mac OS) is usually easier than Windows, and closer to our server environment. A tool like <a href="http://www.virtualbox.org/">VirtualBox</a> will let you run a Linux virtual machine on most other operating systems. It&#8217;s a little slower but switching back and forth is easy. I&#8217;ll try to write about my local development set up soon.</p>
<h3>Our Workflow</h3>
<p>Let&#8217;s go over the life of a bug. This is a little long-winded.</p>
<p>A bug is born either when someone describes a problem or when we decide to add a new feature. (Every project has its own way of doing the latter.) Sometimes our Web <abbr title="Quality Assurance">QA</abbr> team finds problems, sometimes community members do. Then the bug is created, or filed, usually by the person who discovers it—that could be you!</p>
<p>Once a bug has been filed, possibly after some discussion of the best way to fix it, a developer—and that could be you, too—will &#8220;take&#8221; the bug, accepting responsibility for fixing it. Fixing a bug means changing the application in some way: changing a behavior, adding a localization, etc.</p>
<p>When the developer believes they&#8217;ve fixed the problem in their copy, they generate a patch (Subversion&#8217;s &#8220;diff&#8221; command is useful). They then upload that patch as a new attachment, and request review (r?) from someone else. Who does the review will depend on the project and how busy everyone is. If you&#8217;re not sure who to ask, ask in IRC.</p>
<p>The patch will either get an r+ or an r-. An r+ means it&#8217;s good to go, and it can usually be checked in to Subversion (unless there are reasons to wait). An r- means there&#8217;s something wrong. This can range from a patch containing some extraneous data to a patch not solving the problem, and an r- almost always includes a description of the problem.</p>
<p>When a patch with a positive review (r+) gets checked in to Subversion, the developer will include the revision in the bug and change it from <em>new</em> to <em>resolved: fixed</em>. In a few minutes, the change will appear on a staging server that&#8217;s updated frequently with the latest code. Our Web QA staff and contributors will test the bug, compare expected to actual behavior, and with either <em>reopen</em> the bug, if it&#8217;s not fixed, or set the status to <em>verified</em>. Then the bug is considered done. Verified bugs rarely reopen.</p>
<p>Once all the bugs for a milestone are done, we &#8220;freeze&#8221; the source against new commits while Web QA does a final check that everything is in good shape. When QA signs off on the current code, we push the new version onto our production web servers.</p>
<p>So that&#8217;s the life of a bug, from filed to production. When it gets to production, your code can be seen or used by millions of people every day.</p>
<h3>Join Us</h3>
<p>So if you&#8217;re a web developer and want to help Mozilla and Firefox, head over to Bugzilla or IRC and get started. We hope to see you soon!</p>
]]></content:encoded>
			<wfw:commentRss>http://coffeeonthekeyboard.com/so-you-wanna-help-mozilla-316/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

