Don’t have a job yet? FOSS it with Symfony2

Today I did not know what to do. I tried some options to get fancy but failed miserably. After some time thinking I went onto the issues list of the symfony/symfony repository looking for something I could do. Usually one waits for Ryan or a hacking day to start looking where to help, but this time it was different. I just needed to survive and feel like I learned that new thing everyday. So this is called `contribute not because my product needs it but because is about passion and moving as a community`.

So I found this (notice @stof has not slammed me yet on the reviews but so far so good):
Screen Shot 2013-06-27 at 1.33.32 AM

Since it was about the console component I thought maybe if I was able to reproduce it I could be in a better shape to at least comment on github with words. At first @stof’s english did not make sense to me, even though it is clear I did not have the background to muster an attempt. I had to reproduce, so I took a pet project folder, write a command on my src bundle folder, read the documentation for the DialogHelper which he mentioned http://symfony.com/doc/current/components/console/helpers/dialoghelper.html and then passed the flag –no-interaction or just -n. Then bingo! First goal was achieved.

Then I knew if I was going to touch code that is on this repo I better make sure I don’t break other tests doing that. I hate PEAR so I would not try to install phpunit on my machine. So I downloaded it as a phar, chmod it and put it on `/usr/bin/phpunit`, cd to the vendor/symfony/…/Console component folder and run composer install –dev. Then run the test suite just for the component and see that it works ok. Later I did add my changes to my now new branch sprouting off of master and then committed and reran the suite to ensure all was good. But lest we skip explaining an important step I will not continue with the changes but with what to do after the problem is reproduced. So after the problem is at hand I stop and search for the class that does have the functionality I was going to modify i.e. DialogHelper. Then I moved to its test class `DialogHelperTest` and start skimming over the tests there. Once I found a pattern to write the failing test that I was interested in things started to unfold. After this red light from TDD I was able to touch the code, add the `$input` argument on the helper dialog methods make it green and also fix the tests that I had broken with this change set.

Finally I ran the command I first wrote to ensure no messups mess my final PR.

Then something interest I saw github gifted me with:

Screen Shot 2013-06-27 at 1.22.05 AM

Here is the link to the PR:
https://github.com/symfony/symfony/pull/8366

Funny as I did not do anything basically. I write this to illustrate how easy could be contributing, even contributions that probably would or would not get accepted such as this one. I know @stof will beat me to death, but it is ok.

Thankful, hope that this helps some of you out there.

Leave a Reply

Your email address will not be published. Required fields are marked *