Contributions to Homebrew - Google Summer of Code 2020
This summer I contributed to Homebrew as a part of the Google Summer of Code program. This was my first venture into the world of FOSS and I'm grateful to the Homebrew community for being so welcoming, helpful and encouraging! I worked on setting up Sorbet, a static type checker in our codebase.
Here is a gist of everything that we've worked on during the GSoC period:
During the community bonding period, I worked on setting up
byebug, a popular and easy to use debugger for Ruby. It can be used with any spec and it's usage is similar to the
:focusinclusion filter in rspec. Check out the PR here. I also read through the Sorbet documentation during this period to get a deeper understanding of my project and explored the Homebrew codebase.
Our next goal was to get
srb tcup and running. This involved adding relevant gems to our gemfile (in a separate
HOMEBREW_SORBETenvironment initially), setting up
tapiocaand setting up all gem RBI files. Here are the relevant pull requests for the above tasks:
srb tcwas running, Sorbet reported a lot of type errors initially. My goal now was to reduce these errors and solve as many type errors as possible. We also had to update
hidden-definitionsregularly and update
tapiocagem definitions of recently bumped gems. Here are the relevant PRs:
A very vital part of Sorbet is the
files.yamlfile which contains a list of every Ruby file in the codebase divided into 4 strictness levels, ignore, false, true and strict. Initially we had only 35 files set as
true. In the next phase, we worked on getting all files from
falseand also moving as many files to
true. We now have 76 files set as true. In the following set of pull requests, we worked on adding new files to
files.yaml, moving existing files to
trueand solving the subsequent type errors.
Updating tapioca definitions for recently bumped gems was proving to be a tedious chore, hence we worked on adding a new github action which runs periodically and updates all tapioca definitions and hidden-defintions. Link to the PR.
Our goal for the third month was to introduce a new developer command,
brew typecheck, add documentation, and introduce more developers to Sorbet. This was also the right time to drop the separate
HOMEBREW_SORBETenvironment. Here are the links to the relevant pull requests:
Now, I will be working on getting the remaining files to true. Another thing that
we've got to give a little more thought into, is how we're going to automate adding
new files to the list of in
files.yaml, and more specifically deciding which
sigil we'd want the file to be a part of. I look forward to being an active open source
contributor at Homebrew.
This summer has been extremely fun and jam packed with important lessons. I've learnt how to approach a problem, how to ask the right questions and I've gained so much confidence in myself as a developer! All of this would have never been possible without the support from my mentors @issyl0, @mistydemeo and @MikeMcQuaid. They've been extremely kind and helpful throughout my GSoC journey. I'm grateful to my mentors for taking out time from their weekends for our weekly video calls (something that I looked forward to all week long!).
I’d also like to thank Google for giving me the opportunity to be a part of such an amazing community!
Working with the Homebrew community has been a privilege for me and I'm definitely
looking forward to making more positive contributions in the future!