Ayende @ Rahien

Refunds available at head office

The most amazing demo ever

I was giving a talk yesterday at the Melbourne ALT.Net group, the topic of which was How Ayende’s Build Software. This isn’t the first time that I give this talk, and I thought that talking in the abstracts is only useful so much.

So I decided to demonstrate, live, how I get stuff done as quickly as I am. One of the most influential stories that I ever read was The Man Who Was Too Lazy to Fail - Robert A. Heinlein. He does a much better job in explain the reasoning, but essentially, it comes down to finding anything that you do more than once, and removing all friction from it.

In the talk, I decided to demonstrate, live, how this is done. I asked people to give me an idea about a new feature for NH Prof. After some back and forth, we settled on warning when you are issuing a query using a like that will force the database to use a table scan.  I then proceed to implement the scenario showing what I wanted:

public class EndsWith : INHibernateScenario
{
    public void Execute(ISessionFactory factory)
    {
        using(var s = factory.OpenSession())
        {
            s.CreateCriteria<Blog>()
                .Add(Restrictions.Like("Title", "%ayende"))
                .List();
        }
    }
}

Implemented the feature itself, and tried it out live. This showed off some aspects about the actual development, the ability to execute just the right piece of the code that I want by offering the ability to execute individual scenarios easily.

We even did some debugging because it didn’t work the first time. Then I wrote the test for it:

public class WillDetectQueriesUsingEndsWith : IntegrationTestBase
{
    [Fact]
    public void WillIssueWarning()
    {
        ExecuteScenarioInDifferentAppDomain<EndsWith>();

        var statementModel = model.RecentStatements.Statements.First();

        Assert.True(
            statementModel.Alerts.Any(x=>x.HelpTopic == AlertInformation.EndsWithWillForceTableScan.HelpTopic)
            );
    }
    
}

So far, so good, I have been doing stuff like that for a while now, live.

But it is the next step that I think shocked most people, because I then committed the changes, and let the CI process takes care of things.  By the time that I showed the people in the room that the new build is now publically available, it has already been download.

Now, just to give you some idea, that wasn’t the point of this talk. I did a whole talk on different topic, and the whole process from “I need an idea” to “users are the newly deployed feature” took something in the order of 15 minutes, and that includes debugging to fix a problem.

Comments

Jason
12/01/2010 06:43 PM by
Jason

Dude, when are you coming to Chicago? That sounds like a great session!

fschwiet
12/01/2010 07:11 PM by
fschwiet

That is impressive, well done.

Alex Simkin
12/01/2010 07:33 PM by
Alex Simkin

What product do you use for CI?

Ayende Rahien
12/01/2010 07:42 PM by
Ayende Rahien

Alex,

I wrote my own, it is called Texo

Tom
12/01/2010 08:59 PM by
Tom

Awesome, looking forward to the yow talk next week!

Scooletz
12/01/2010 10:42 PM by
Scooletz

15 minutes to get the feature published. Nice proof of skills :]

Howard Pinsley
12/01/2010 11:02 PM by
Howard Pinsley

Oren,

Bring this talk to the NYC alt.net group!

Michael Shimmins
12/02/2010 09:20 AM by
Michael Shimmins

Was very impressive - and a great talk as well.

Jamie
12/02/2010 09:28 AM by
Jamie

Any chance this talk has ever been recorded?

Erik van Brakel
12/02/2010 09:44 AM by
Erik van Brakel

I did the same thing essentially, but I use TeamCity for that combined with a WinSCP script. In essence, this is what happens:

Poll the VCS, if there's a new version, run project build sequence

project build consists of a psake script (taken from the dotlesscss.org project, which has based build scripts on other work by Ayende, among others I think)

When build is successful, run winSCP script which uploads the artifacts to an FTP location. This location can then be published using a php script, asp.net website or whatever.

The build itself runs a standard release build, runs the tests (NUnit), merges stuff using ILMerge (to reduce DLL clutter), builds a setup if needed (using WiX) and zips the whole thing using 7-zip.

What this gives me is essentially the same thing I think. When I drop something into my git repository (when I push it to my release repo that is) it will run all builds, test it, drop me an e-mail on fails and publishes when the build is successful. And I agree, this does feel amazing, and it gives you time to worry about the important things - building software.

Steve Py
12/02/2010 10:19 AM by
Steve Py

Looking to get the evening off to come see you in Brisbane next week, might be conflicting with the wife's Christmas party though. :(

Moore's Law does pose a bit of a shadow over this in larger organizations. Case being when one or two developers invests the time to work through the perfect automated CI environment. This saves everyone time which gets used up with other more important tasks rather than ensuring everyone is up to speed with how the CI environment works. Of course at first it works reliably until something changes (incompatible tools, upgrade dev environment/platform, new OS, etc.) The original architects of the platform either aren't there any more or have forgotten much of what they did to set it up.

Not to argue against investing in it, but be aware of Moore's Law and be sure that everyone reviews and understands the optimizations, even continues to improve on them. Otherwise they'll leave the rest of the company drifting dead in space, kidnapping engineers. "He is smart. He can make it go."

Alex K
12/02/2010 09:17 PM by
Alex K

I guess it's nice not to have to worry about code reviews :)

Comments have been closed on this topic.