Herbolario en Gelves

Aunque las hierbas se han utilizado para la curación mental y física durante siglos, es realmente sólo recientemente que han comenzado a ser reconocidas en la cultura occidental. Ahora, más y más…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Contributing to Caravan

Being my first time entering the open source scene, I had a little trouble looking for projects where I felt I could add something of substance. There are many tags for beginner friendly issues on certain open source projects, so how do you go about choosing which one to dive into first? Depending on the issue, you might have to take a deep dive on the inner workings of the app, which even if you didn’t need to for a certain issue, it’s best to know what the app is doing.

Luckily I was working with a great team, Andrew Jeffery, Matt Milton, and myself, to find an open source project that had interesting issues. One of the teammates, found an app called Caravan, which provides people with the ability to record and report the status of local transportation stations and lines. The app was birthed at a Chicago hackathon and later implemented into their local civic tech meeting Chi Hack Night. It was at a sweet spot for being large enough to require some deep diving into the code base, but not so big that it was monolithic. Overall a good place to start adding in some contributions.

Upon looking through the issues, there were three that seemed easy to knock out. One issue was asking for a template for the pull requests and issues, another was asking for a seed file so that people could run the app locally on their machine, and the last was asking for test coverage to be brought above 90%. One teammate tackled the templates, while another teammate and I decided to pair up on the seed file.

After looking into the other pull requests we found that someone had already created a seed file and made a pull request, but the Travis CLI build was failing. This piqued our interest, so we copied the what was in the pull request onto our machines and ran the seed, after getting it all set up. Immediately the seed failed. The first failure in the seed file had to do with a joins model, that didn’t exist, which to the both of was rather odd, so we decided to dive into the schema to have a look at what exactly was being seeded.

Once we had a better understanding of what was needed in the file, we went about refactoring the seed file so that it would pass. Along the way we came into some errors with mismatching data types and odd behavior with the faker gem, but in the end we were able to refactor the file to both seed and pass Travis CLI build.

After finishing up the seed file, I decided to tackle the testing since it didn’t look all that difficult and there were only two controllers that were not really being tested. What I did not expect was that the app was using ActiveDispatch for integration tests. I had only worked with minitest and rspec in the past, so this was rather foreign to me, but the documentation on the Rails site was thorough and had many examples to reference. After a bit of toying around with the test suite, I finally hit a nice groove and added in tests for all the actions in the issues controller and the lines controller, bringing the tests up from 64% coverage to a nice 95%.

After our work was done, we all reviewed each others work and made a pull request to the main repository detailing all the contributions we made with the referenced issue numbers.

In all this little foray into open source contributions was rather fun, and provided me with a greater sense of empathy for the developers in question. I could have decided to rewrite all the tests in rspec, implement capybara, and factory bot, but that would have not been very empathetic to the original creators. Instead I decided to learn what the app was working with and see if I could add to the existing code base without changing too much of the behavior.

Trrransition… Overall great time. Solid 5/7.

Add a comment

Related posts:

Time managment

Last semester I co-founded the Kuwaiti Students Association at Temple University (KSAT). I’m the Vice President of this organization. Usually am not a very good at schedules and time management which…

Future problems that Machine learning can solve

Machines have far superior computational abilities than humans. They can sort through enormous amounts of data and use it to make better decisions. So the general idea behind AI is to have machines…

Her Best Friend is a Guy? Leave Her.

There was a question I answered on Quora awhile back that needs to be fleshed out a bit more. The question was: What’s Something in a Woman’s Apartment that Sets Off Red Flags? I dated a woman in my…