
Show HN: When my builds fail I pay money to charity - jvardy
https://medium.com/football-whispers-engineering-and-data-sci/failed-builds-cost-more-than-just-time-4e7c196cc8bc
======
brudgers
The interesting thing about this project is how the incentives align. The
premise requires the view that donating to charity is a bad thing. Or
conversely, writing build failing code is a good thing. Otherwise --if
donating _and_ buildable code are good -- there is no self reinforcing cycle.
The system architecture is closed...a finite pie if you will. Successful
builds and charitable donations have a reciprocal relationship. An increase in
one comes at the expense of the other. A win-win system architecture would
have a positive correlation between charitable donations and successful
builds. The charities and the developer would both benefit or suffer together.
If both successful builds and charitable donations are good, the system
architecture encourages the Shirky Principle
[https://en.wikipedia.org/wiki/Clay_Shirky#Shirky_principle](https://en.wikipedia.org/wiki/Clay_Shirky#Shirky_principle)

~~~
paulsutter
Neither of your requirements are true in the least. It’s a great idea because
he’s penalizing himself for failed builds in a really fun way, with no waste
because it’s going to a good purpose. It’s called “win-win” and it’s a good
thing.

~~~
dubcanada
"penalizing himself"

Implies that OP is correct. In order to penalizing yourself you need to do
something you consider a punishment. In this case donating to charity...

~~~
fouc
OP and yourself are perhaps engaging in what could be termed as "semantic
trolling"

Fortunately it isn't working because as others pointed out, "penalize himself"
and "donate to charity" concepts aren't directly tied together. Where the
donation actually goes is immaterial, so it's not possible to argue that
"punish himself" implies "donate to charity" is punishment.

~~~
tnegoshi
The only misuse of semantics I see is where an attempt to obscure a concretely
causal relationship occurs:

mistake > punish himself > donate to charity to punish himself

Donating to charity as a method to achieve the punishment goal is precisely
material in this case.

GP is asking if this method, which contains both a gain and loss, actually
results in a punishment with an intended loss.

~~~
zumu
The punishment isn't donating to charity. The punishment is losing money.

------
michaelmior
I'm curious why you need to pay for a load balancer when you're running this
as a service just for yourself. Sure it could fail, but it's not something
critical and a LB just seems like unnecessary complexity/cost.

------
flipp3r
Everytime my build fails I effectively donated money to Amazon.

~~~
neolefty
Ah, I was wondering who was subsidizing my free shipping. Thank you!

------
modsec
I am missing the point of the article. Why does build failing require any
incentive or punishment?

If a build fails, nothing changes in the production environment. The developer
can troubleshoot and fix the build. Pretty much like when local compilation
fails due to a syntax error.

Why does such a routine thing as a build failure need to be rewarded or
punished?

~~~
vorpalhex
Once upon a time, builds used to be very expensive and take forever. Entire
development teams shared a single single-pipe build server, and builds could
not even be built locally first.

We're (mostly) past those times now, but "breaking the build" is still in the
mind of many devs as a negative behavior.

~~~
aeorgnoieang
I'd imagine 'breaking the build' is, for almost everyone nowadays (and in most
situations), a _very_ minor issue. But it's still, _all else equal_ , a net
negative, however small.

Breaking a build once, for whatever reason, probably _isn 't_ a big deal. But
breaking a build frequently certainly could be.

~~~
sli
If you break our build, your pipeline fails and your code is not merged.
Simple as that. The master branch doesn't break, because we don't merge broken
code into it.

------
crsv
Not sure if I'm in to equating charity with failure or mistakes, but I suppose
it's better than a complete lack of charity.

~~~
pavanred
A few years ago, I had this idea of paying a small amount to charity every
time I hit snooze on my alarm clock. I forked into an android alarm app,
started working on it (but never completed it). My rationale then was that if
I feel lazy and would prefer to sleep in further, I would penalize myself but
in a way that would benefit someone else.

~~~
kreetx
There was a study (referenced from a few books -- never read the study itself)
where parents were required to pay if they didn't pick up their children from
the kindergarten. Since setting this up reduced guilt (they were now paying
for the care-takers' extra time) the average time of being late actually
increased -- instead of decreasing as thought initially.

~~~
toomuchtodo
Freakonomics mentioned this. It took place in Israel. It took a social faux
pax and converted it to an economic transaction, thereby reducing/removing the
stigma of being late.

[http://freakonomics.com/2013/10/23/what-makes-people-do-
what...](http://freakonomics.com/2013/10/23/what-makes-people-do-what-they-
do/)

~~~
fjsolwmv
Which is _great_! The daycare discovered a lucrative business growth
opportunity that help improve their customers' lives. Next step shout be to
set a fair price for being late, so caregivers and parents can make mutually
beneficial exchanges of time for money. Social mores are crude heuristics.
Explicit prices can do better.

~~~
toomuchtodo
I would not say great. I would say it’s useful and efficient in some
circumstances, and unhelpful in others. There are some things that don’t
scale, and social moores might act as a safety valve in those cases versus an
economic transaction.

Some human interactions are only a few A/B tests away from turning into a
Black Mirror episode.

------
kevincox
It seems weird to have a constantly running a server and database for what
could be implemented as a cron job which just calls an API for last
week's/month's data.

But it guess if it is just for fun who cares :)

~~~
thefifthsetpin
I would think that the consequences need to be pretty immediate to have a
psychological effect. Seeing at the end of the month, "Wow, I broke the build
8x. I should be more careful." just doesn't carry the same sting as "Oops;
there went today's coffee budget!"

~~~
kevincox
Presumably you get an email or other notification when the build fails. So
even though the deduction isn't immediate you still get the immediate feedback
that you will be deducted.

------
unit91
Nice write-up. Strikes me as a little strange to donate to charity as negative
reinforcement though.

~~~
phyzome
Depends how much you donate.

Another approach is donating to a charity you despise. Some friends of mine
use a mutual donation pact to get things done. Each sets a goal they need to
accomplish by the end of the month, and hands the other a signed check for $50
for a charity or political campaign they hate. If they don't accomplish the
goal, the other person drops the envelope in the mail.

It's very effective. :-X

~~~
jawns
This is the proper way to set up the disincentive, and you'll find it
recommended in many places.

For instance, stickK sets up its commitment contracts with the option to
donate to an "anti-charity":

[https://www.stickk.com/faq/charities/Commitment+Contracts](https://www.stickk.com/faq/charities/Commitment+Contracts)

It also allows you to donate to fan clubs of sports teams you despise :)

------
closeparen
Wouldn't you always compile and test locally before uploading to CI? I
understand that CI can provide some confidence about working in a standard
hermetic environment, vs. potentially only on one developer's laptop, in a
team environment. But why would a CI build ever fail for a personal project?

~~~
w0m
As an example, if you forget a file before pushing; all local tests will pass
and abject failure remotely. You can do local checks for that sort of thing,
but it's ~impossible or at least impractical to catch every case through
automation even when developer does due diligence.

~~~
hinkley
Impractical is the key.

So many people focus on how often the build is broken. That’s not the
important part in CI. The important part is how often (% of day) the codebase
is broken.

It’s not how often you break the build that kills the team. It’s how long it
stays that way. Breaking it twice a week for five minutes each is better than
breaking it once a month for an hour or two.

~~~
closeparen
Why would a broken build affect the team? Are you pushing changes to master
that don’t pass CI?

~~~
hinkley
What don't you like about the other 5 answers you got to this question?

The point of CI is to identify integration issues, not a blame assignment
system (the loaded way you ask the question is really not helpful). So we can
work faster. Not so we can spend all day second guessing our push being afraid
we will make the build red.

Any commit can have integration issues. With enough people committing, there
is a build going on all day long. It won't always be ships passing in the
night.

~~~
closeparen
The answers given above are 1) forgetting to “git add” and 2) test suite takes
too long. These are fine reasons to offload testing of your PR to a CI system,
but why would you be _merging_ changes that potentially break the build? Our
highest-commit-volume repos have a queue system doing test-then-land. There’s
still no way a change set that breaks the build gets in the way of one that
doesn’t.

------
wglb
I take a different approach. I keep a file for each project and make an entry
each time I resolve an issue. This helps me understand how I created the bug.

Donating to charity, while an incentive, won't help me see the detailed lesson
a year from now.

------
segmondy
Solution looking for a problem.

~~~
mythrwy
Is it a solution though?

------
ibdf
Pretty neat project. I guess the only question left is, how much did you
donate to get it done?

------
pc86
I don't think a 9-paragraph Medium post is appropriate for "Show HN."

Does seem like a neat idea, but you'd probably be more likely to avoid failed
builds if (a) the donation was immediate and irreversible; and (b) went to a
charity or organization you vehemently disagreed with.

~~~
pvg
You should mail the mods if you want stuff like that looked into.

