Once a Maintainer: Alessandro Rodi
how keeping an abandoned gem alive became a force for good for the entire Rails ecosystem
Welcome to Once a Maintainer, where each week we highlight an OSS maintainer doing great work in the community.
This week we’re talking to Alessandro Rodi, maintainer of CanCanCan. CanCanCan is an authorization gem for Ruby that restricts what resources a user is allowed to access. CanCanCan grew out of its predecessor, CanCan, an abandoned gem that was so useful the community refused to let it die. Alessandro is originally from Italy and now lives in Zürich with his family where he works for Renuo AG, a software development agency that is now a sponsor of CanCanCan.
How did you get into programming?
I was a kid. My dad is a programmer who’s now retired. I would go into his office and he would put me in front of Minesweeper for a few hours and I just stayed there. From there I developed an interest in programming. I was really keen on Access, Excel, and very basic html. You could build forms! When I was 14 or 15 I could already build something useful and I even got paid for it - I got a mobile phone with the money I earned. From there it evolved to php and then university. I did a bachelors in computer science at the University of Bologna for three years and I was in the middle of doing my thesis when this company called me up and said “Would you like to do an internship? It’s in web development.” It was next door to the university so I said why not.
So I was a java developer and after five years I didn’t want to be a java developer anymore and I started learning Ruby on Rails on my own (this was 2011 or so), and now I’ve used Ruby for the past 12 years or so.
Now I am a web developer, but when I was in university I hated web development. I didn’t even take the course for web technologies because I was really not interested in it. But then I started working and I realized that it was something I was good at. There is the saying “follow your passion” and I think, yes and no. Sometimes a thing will become your passion when you realize you are good at it.
What made you interested in contributing to CanCanCan?
CanCanCan was not my gem, as many know, it was from Ryan Bates. It was abandoned and then it was taken over by the CanCan community. The main person leading the project was Richard Wilson, and then at some point I joined the group because I was interested in the library and started opening pull requests and contributing.
It’s interesting, I don’t really remember why I chose CanCanCan, but I was using it constantly. I was using it in all my personal projects and the company where I work now (for last 10 years, Renuo AG) it was in our default setup, so if we encountered an issue or something then we contributed. After I joined I started contributing and also reviewing, and after a while Richard wrote to me and said you know what, I think we should drop the gem. There are more modern solutions and alternatives like pundit, so I’m going to deprecate the gem. And I said “no, please” because I didn’t want to have to refactor all my applications, and I actually think CanCanCan works better from certain points of view. So I said I will take over the lead of maintaining this gem and at least keep it up to date so that it works if a new Rails version comes out or something.
At the beginning we didn’t plan to implement new features because I had zero time. But then from my company the work I was doing was received very well, and I received a lot of support. They said hey, whatever time you have to spend on CanCanCan, you can book it as company time. And in exchange we’ll put the company logo in the readme as a supporter. So for quite a few years this was the setup, and this was also very good for the company (linkbacks, visibility within the Rails ecosystem) so since then the company has paid whatever time I was spending and then after some years I also opened for donations. That actually made things harder, because the moment you start accepting donations, it feels like you owe something more to the people who donate to the library. So there is a bit more pressure. It’s a nice thing as well, it’s cool that people are willing to donate, but it puts a bit of pressure on you when you already have a full time job. In the past few years we have had two kids and now there’s even less time, but I enjoy it.
I realized during these years that a lot of big, important projects use CanCanCan, like Spree, New Relic, Proton Mail which is quite a big Swiss email provider, OpenStreetMap. I was like “whoa, thankfully we didn’t drop it!”
What’s your favorite ruby package and why?
I’ve been using a lot of blazer recently, we install it in almost all of our projects. The guy behind it develops a lot of gems for Rails, Andrew Kane. Blazer is one of these very small simple BI tools that you can install in your Rails app. This makes us shine compared to our competitors, because customers come to us with questions about their data and we can run sql instantly and export it to a csv or show them a dashboard with some statistics. This is something that’s very good for customers and for us. It also changed how we monitor our applications because we can put some checks on the data. We do this often because as an agency we have many apps, so we put some validations on our data so we get notifications right away if some data are wrong. I think it’s a very powerful tool.
I don’t know if it counts as a gem, but now that Rails 7 is out we’re using turbo and the turbo rails gem. It changes completely the way you think about the architecture of your application. You have to rethink it from the ground up. It’s very different, it changes the mindset, you have to pull back, think differently. I like this. It somehow continues to evolve the framework but still fits me.
How do we get more people into open source?
I think companies play a key role in that. Basically all the companies use open source and if each company would push a bit to give back I think this would change a lot.
In the last few years I also became a partner in my company Renuo AG, and at the end of the year we don’t only support CanCanCan but we take 10% of the company profits and we split it: 5% goes to charities and the other 5% goes to open source projects. Being an owner of the company, this hurts a bit at the end of the year, to take 10% of the profits and give them away. But we think this is exactly why it’s right. It has to hurt a little bit. If it doesn’t hurt, you’re probably not doing enough. So the fact that you see all this money going out, it means that it’s right. We can do it, we are first world. How lucky are we that we can do that?
I mention it not to brag, but to say we can do it, you can do it as well. That would change a lot I think. We do also try to put as much open source out as possible. If we have the budget, we say ok, let’s take this part of the source code, extract it and turn it into a gem. It’s the best way to obtain open source code. That’s how Rails was shaped, out of an existing platform.
Who’s someone you think is doing really interesting work?
@marcoroth (Marco Roth) maintains stimulus. Marco is a friend, he’s Swiss. We teach together at bootcamps, we are in touch when there are meetups in Switzerland. We’ve been planning to go watch Super Mario Bros. together. He’s been doing a lot for the rails ecosystem and focusing a lot on open source for the past year.
@adrianthedev (Adrian Marin) is doing an amazing job with Avo. It’s kind of a Rails admin but much nicer. It’s an entire app where you can look at your database tables but more user friendly, you have a lot of tools where can export the data, manage them, filter them, search them, etc. He’s really fond of this ecosystem and I think he’s doing a great job.
Once a Maintainer is written by the team at Infield, an app that helps dev teams keep their open source dependencies up to date. To share, hit the button below:
Subscribe to receive new posts each week.