Slide 1

Slide 1 text

@fat Jul 2012 OSCON Thursday, July 19, 12

Slide 2

Slide 2 text

I’m @fat Thursday, July 19, 12

Slide 3

Slide 3 text

I work at twitter Thursday, July 19, 12

Slide 4

Slide 4 text

I write libraries Thursday, July 19, 12

Slide 5

Slide 5 text

Bootstrap, Ender, Hogan.js Thursday, July 19, 12

Slide 6

Slide 6 text

MooTools-flot, Stache, snapysnap Thursday, July 19, 12

Slide 7

Slide 7 text

Sometimes when I’m feeling saucy I open pull requests Thursday, July 19, 12

Slide 8

Slide 8 text

These are largely rejected or backed out after a merge Thursday, July 19, 12

Slide 9

Slide 9 text

I’ve been #1 on hacker news twice Thursday, July 19, 12

Slide 10

Slide 10 text

Thursday, July 19, 12

Slide 11

Slide 11 text

This is my real avatar on the internet Thursday, July 19, 12

Slide 12

Slide 12 text

People always think I’m high when I give these presentations Thursday, July 19, 12

Slide 13

Slide 13 text

People always think I’m High when i give these presentations Thursday, July 19, 12

Slide 14

Slide 14 text

Don’t tweet that, it hurts my feelingz Thursday, July 19, 12

Slide 15

Slide 15 text

I say “like” a lot Thursday, July 19, 12

Slide 16

Slide 16 text

I curse Thursday, July 19, 12

Slide 17

Slide 17 text

The only thing which consistently impresses me is 4chan Thursday, July 19, 12

Slide 18

Slide 18 text

I live in the tenderloin Thursday, July 19, 12

Slide 19

Slide 19 text

I have a .xxx domain Thursday, July 19, 12

Slide 20

Slide 20 text

And perhaps worst of all I read books Thursday, July 19, 12

Slide 21

Slide 21 text

And not particularly good ones Thursday, July 19, 12

Slide 22

Slide 22 text

One of the authors I read a fair amount of is Karel Čapek Thursday, July 19, 12

Slide 23

Slide 23 text

Thursday, July 19, 12

Slide 24

Slide 24 text

ČČapek wrote a number of works on brutal fascist dictatorships Thursday, July 19, 12

Slide 25

Slide 25 text

But he’s most famous for a sci-fi play he wrote in 1920 R.U.R. Thursday, July 19, 12

Slide 26

Slide 26 text

A dystopian work about a factory populated with androids Thursday, July 19, 12

Slide 27

Slide 27 text

Thursday, July 19, 12

Slide 28

Slide 28 text

It start’s with a story about a man named Rossum Thursday, July 19, 12

Slide 29

Slide 29 text

Who accidentally discovers a chemical similar to protoplasm Thursday, July 19, 12

Slide 30

Slide 30 text

Rossum attempts to make a real dog and man, but fails Thursday, July 19, 12

Slide 31

Slide 31 text

Old Rossum was trying to prove God not just useless, but absent Thursday, July 19, 12

Slide 32

Slide 32 text

Nephew comes to visit uncle and argues with old uncle Rossum Thursday, July 19, 12

Slide 33

Slide 33 text

Young Rossum just trying to… Thursday, July 19, 12

Slide 34

Slide 34 text

Eventually, Young Rossum locks his uncle in a laboratory Thursday, July 19, 12

Slide 35

Slide 35 text

And uses the formula to build robots Thursday, July 19, 12

Slide 36

Slide 36 text

Soon he’s building factories and robots by the thousands Thursday, July 19, 12

Slide 37

Slide 37 text

By the 1950s, you can get robots on the cheap Thursday, July 19, 12

Slide 38

Slide 38 text

The economy is amazing and so is the quality of life Thursday, July 19, 12

Slide 39

Slide 39 text

Then this girl Helena shows up Thursday, July 19, 12

Slide 40

Slide 40 text

Thursday, July 19, 12

Slide 41

Slide 41 text

what if computers don't like being programmed prince M I L Ǝ S @iano 25 JUN Thursday, July 19, 12

Slide 42

Slide 42 text

maybe computers just want to chill and play screen savers all day prince M I L Ǝ S @iano 25 JUN Thursday, July 19, 12

Slide 43

Slide 43 text

Then there’s a robot revolt and it turns into a whole thing Thursday, July 19, 12

Slide 44

Slide 44 text

But what about dat quality of life thing? Thursday, July 19, 12

Slide 45

Slide 45 text

A few months ago I was at Thursday, July 19, 12

Slide 46

Slide 46 text

Between sessions I was talking to TJ Holowaychuk Thursday, July 19, 12

Slide 47

Slide 47 text

We bonded over having panic attacks about github notifications Thursday, July 19, 12

Slide 48

Slide 48 text

Thursday, July 19, 12

Slide 49

Slide 49 text

Turns out, this is a pretty common problem Thursday, July 19, 12

Slide 50

Slide 50 text

It’s a good problem Thursday, July 19, 12

Slide 51

Slide 51 text

But still a problem Thursday, July 19, 12

Slide 52

Slide 52 text

What makes it worse is github doesn’t offer maintainers much help Thursday, July 19, 12

Slide 53

Slide 53 text

Out of desperation you begin to see things like… Thursday, July 19, 12

Slide 54

Slide 54 text

Thursday, July 19, 12

Slide 55

Slide 55 text

Thursday, July 19, 12

Slide 56

Slide 56 text

But I still found myself spending 3-5 hours a week on issues alone Thursday, July 19, 12

Slide 57

Slide 57 text

What’s worse, most of these issues aren’t issues with the library Thursday, July 19, 12

Slide 58

Slide 58 text

They are support questions, duplicates, incomplete reports, etc. Thursday, July 19, 12

Slide 59

Slide 59 text

This becomes both exhausting and incredibly discouraging Thursday, July 19, 12

Slide 60

Slide 60 text

What’s worse, we get so overrun that we forget to innovate Thursday, July 19, 12

Slide 61

Slide 61 text

I can close 50+ issues without committing a single line of code ಠ_ಠ Thursday, July 19, 12

Slide 62

Slide 62 text

I’ve seen a few solutions to this problem Thursday, July 19, 12

Slide 63

Slide 63 text

Some projects add contributors who only manage tickets Thursday, July 19, 12

Slide 64

Slide 64 text

But it’s hard to find people, let alone the right people Thursday, July 19, 12

Slide 65

Slide 65 text

Some projects begin moving ticketing off network Thursday, July 19, 12

Slide 66

Slide 66 text

But this means inconsistent ticket locations and implementations Thursday, July 19, 12

Slide 67

Slide 67 text

Instead, what if we could just clone ourselves? Thursday, July 19, 12

Slide 68

Slide 68 text

This of course is the Old Rossum approach Thursday, July 19, 12

Slide 69

Slide 69 text

But wut if we focused on really simple tasks a la Young Rossum? Thursday, July 19, 12

Slide 70

Slide 70 text

The evening after I wrote some docs for a new service Thursday, July 19, 12

Slide 71

Slide 71 text

A bot which would implement Necolas’s issue-guidelines Thursday, July 19, 12

Slide 72

Slide 72 text

But it shaped up to be a huge undertaking with limited value Thursday, July 19, 12

Slide 73

Slide 73 text

Which is to say, value for Nicolas and I, but no one else Thursday, July 19, 12

Slide 74

Slide 74 text

About a month later Thursday, July 19, 12

Slide 75

Slide 75 text

how did your github bot thing go? TJ Holowaychuk @TJHolowaychuk 1:10 AM Thursday, July 19, 12

Slide 76

Slide 76 text

Translation Can i use ur robot pls? Thursday, July 19, 12

Slide 77

Slide 77 text

@tjholowaychuk sadly haven't had time to finish it yet :( I added @sayer to the project but we've both been pretty busy ♒∆✝ @fat 1:11 AM Thursday, July 19, 12

Slide 78

Slide 78 text

Translation I abandoned it, but blame @sayrer Thursday, July 19, 12

Slide 79

Slide 79 text

haha ok cool, I could definitely use something like that these repo issues are getting out of control TJ Holowaychuk @TJHolowaychuk 1:15 AM Thursday, July 19, 12

Slide 80

Slide 80 text

Translation FML. ok. I’ll write my own. Thursday, July 19, 12

Slide 81

Slide 81 text

bahaha my bot backfired on me and started closing the wrong shit, definitely needs a dry- run mode TJ Holowaychuk @TJHolowaychuk 2:26 AM Thursday, July 19, 12

Slide 82

Slide 82 text

Translation fuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu Thursday, July 19, 12

Slide 83

Slide 83 text

Naturally, I first lol’d at all the wrongly closed issues Thursday, July 19, 12

Slide 84

Slide 84 text

Then got obsessively interested in actually building this thing Thursday, July 19, 12

Slide 85

Slide 85 text

But with a new, goal: I wanted it to be “Universal” Thursday, July 19, 12

Slide 86

Slide 86 text

To begin I started researching bots Thursday, July 19, 12

Slide 87

Slide 87 text

Chatterbots, spambots, botnets, gaming bots, votebots, etc. Thursday, July 19, 12

Slide 88

Slide 88 text

I found Bots are just apps that run automated tasks over the web Thursday, July 19, 12

Slide 89

Slide 89 text

But I wanted something slightly different Thursday, July 19, 12

Slide 90

Slide 90 text

An app that ran automated tests over the web Thursday, July 19, 12

Slide 91

Slide 91 text

I was hoping this would offer more flexibilty and be easier to evolve Thursday, July 19, 12

Slide 92

Slide 92 text

So for the past two months, i’ve been working on just that Thursday, July 19, 12

Slide 93

Slide 93 text

And today I’m happy to be open sourcing it Thursday, July 19, 12

Slide 94

Slide 94 text

Haunt something similar to Rossum’s protoplasm Thursday, July 19, 12

Slide 95

Slide 95 text

Which is to say, a node module for creating robots || services Thursday, July 19, 12

Slide 96

Slide 96 text

Haunt allows you to run unit tests against issues and pull-requests Thursday, July 19, 12

Slide 97

Slide 97 text

Then make decisions about closing, tagging, and commenting Thursday, July 19, 12

Slide 98

Slide 98 text

All programmatically Thursday, July 19, 12

Slide 99

Slide 99 text

For bootstrap I wrote the following simple assertions Thursday, July 19, 12

Slide 100

Slide 100 text

Pull-Requests should always be made against -wip branches Thursday, July 19, 12

Slide 101

Slide 101 text

Pull-Requests should always be made from feature branches Thursday, July 19, 12

Slide 102

Slide 102 text

Pull-Requests should always include a unit test if changing js files Thursday, July 19, 12

Slide 103

Slide 103 text

Issues should include a jsfiddle/jsbin if tagged as JS Thursday, July 19, 12

Slide 104

Slide 104 text

These 4 tests invalidate 37 of 42 pull requests and 63 of 88 issues Thursday, July 19, 12

Slide 105

Slide 105 text

Issues which I would have had to manually comment and close Thursday, July 19, 12

Slide 106

Slide 106 text

But it doesn’t stop there Thursday, July 19, 12

Slide 107

Slide 107 text

You could write more complex assertions to check for duplicates Thursday, July 19, 12

Slide 108

Slide 108 text

Or already resolved issues in your code Thursday, July 19, 12

Slide 109

Slide 109 text

You could even use it to run your actual test suite Thursday, July 19, 12

Slide 110

Slide 110 text

Or use it to run a linter like jshint Thursday, July 19, 12

Slide 111

Slide 111 text

Or simple things like tagging all issues with >10 +1’s as “popular” Thursday, July 19, 12

Slide 112

Slide 112 text

Because this is just JS the potential is limitless Thursday, July 19, 12

Slide 113

Slide 113 text

So just checkout http://git.io/haunt to find out how it works Thursday, July 19, 12

Slide 114

Slide 114 text

thx and follow @fakeangus <3 Thursday, July 19, 12