For our Turing Mod 4 open source contribution, I wanted to really contribute to the Boulder Food Rescue robot code (Link to GitHub).
This is a work I have started a few months earlier. As soon as we started learning Rails, I wanted to be exposed to code written by others and try to get to the level where not only I feel comfortable modifying code written by others, but others are also comfortable merging in my contribution.
Hasn’t happened yet, but work in progress.
Personal take:
Testing being my main focus item in software development, I figured what best way there is to get familiar with a codebase, then writing some tests? Not really touching the codebase, but adding code that would “only” exercise it, yet it will force me to go through various sections of the codebase in a very detailed way, so I can write efficient tests.
I could bring up a long list of reasons why I haven’t been able to stay as strongly engaged as I originally planned, but to save everyone’s time let me focus on outlining my approach here instead. :-)
My process:
1. Read the documentation: let’s understand what details are already available, if there are instructions to create a local set up, are there any other non-obvious, but important details highlighted.
2. Follow the documentation to create a local set up: I thought I was pretty good at following instructions. I was able to set up a local version and get it up and running, yet I missed an important details: that the database.yml.dist
file that is included in the repo is only for common starting point, everyone should update it based on their own environment, but we should NOT check in the updated and customized database.yml
file. Clearly an error on my part…
3. Run tests locally and make sure the results match with everyone else: here I saw different results. All existing tests were supposed to pass, yet I had 13 errors. When I reached out for confirming if I have the latest code and confirm other details, we identified that setting up my local environment with SQLite
instead of PostgreSQL
made a difference. All tests were passing and I got the same results once I updated my database configuration. So I will be using PostgreSQL
. :-)
4. Let the team know which item I will be working on first (we had a list of features which had no test coverage at all): straight forward. I also opened a [WIP]
pull request to get my PR in the queue.
5. Review the codebase myself and collect questions: I just that and collected a long list of questions. To review them, I met up with the team here in Boulder, CO. Due to a complex database structure, the conversation went slower than expected, but it was definitely very helpful. I walked away with a much better general understanding of how the site is set up and most importantly full confidence in the capabilities of the team members already supporting this effort. Hats off to all the patience and support that the volunteer developers demonstrated!!!
6. Ask for confirmation after writing one simple test: this step that I thought was going to be simple and straight forward has proved to be a longer chain on conversation both through GitHub as well as through Slack. First I made very much rookie mistakes that I never thought I would make by now. Starting with checking in the previously mentioned “customized database.yml
file”, then changing a few lines of code, then commenting them out to switch to some other piece that I ended up checking in along with the sprinkled in commented out code. How messy is that? Come on Laszlo, you can do better!!!
7. Adjust based on feedback: concluding our first round of conversations, I started focusing on writing a happy path, “simple” test case: volunteer with assignments to schedule an absence. And this is where I am right now.
…STAY TUNED…
Going forward:
My plan is to set aside at least a couple hours each week to dedicate working on this project. That will be the best for everyone involved. It will help me to stay on track with my planned contribution and on the receiving end finally the enthusiastic team that is already working on this project can see some real progress and contribution from me…