Contribute to Symfony: my experience
Just over a year ago, my first pull request was merged in Symfony. Three months were elapsed between the opening of this PR and the merge. Here’s my personal feedback.
My first Symfony contact was in 2011 with Symfony 1.4. I used it in a webagency then in a IT services company and now in a software editor company, 8 hours a day, for years. It was time to contribute.
In fact, this issue evoked a well-known “deprecated logs” problem and a technical solution to fix it. Having encountered this problem before, I decided to join the Symfony contribution adventure.
An adventure (in latin adventura) is a series of twists and turns […]; it can also be a fortuitous event, of a singular or surprising nature, which concerns one or more persons.
The first step was to retrieve the latest version of Symfony and run tests otherwise I won’t be able to determine if my changes are causing any bug. I lost a little time here by intentionally run the tests without referring to the documentation of the contributions, especially on the tests.
For the second step, I modified the Symfony Demo project to get a configuration similar to the one I was trying to solve: this consists in having deprecated during the construction of the container, and no longer having them. Easy peasy!
And then, I started: I modified the logger, I looked on the container side, containerBuilder, dataCollector and so on … I searched, I thought. I found solutions and discovered new problems: it advances and sometimes it goes back. When finally I had a solution, I cleaned my code, refactored it and removed my debug code. The tests passed again, forward for the last modifications before the PR
And, now I was in doubt… How should I name this variable? Is this method not too long? Shouldn’t I create a dedicated class? How do I call it? Where do I put it? Then after a while, not without stress, I submited my PR on Github and go!
After only ten minutes, I got “Stofed”: it’s a common practice when dealing with issues and symfony/symfony PRs. In fact, it’s not obvious to realize it at first, but it’s one of the best part of the Symfony contribution. Yes that’s it! Every comment remined me that I‘ve missed something. A hidden interdependence between components. The fact that “standard Symfony coding” is more advanced than PSR-2. A questionable variable name choice, a probable BCBreak, bad pattern used and also security issue …
This is the time when the open source shakes you, the moment you realize that each non-final class may be extended by a developer somewhere, and that one wouldn’t like you to break his project with your PR. The moment you realize that someone may have added their own DataLogger to the WebProfiler, and you don’t have any idea about what you’re going to serialize. So you re-discover the Symfony code, and you perceive details that can sometimes expand its capabilities and sometimes preserve them.
At this time, I feel a little helpless, especially because a feature request is always subject to interpretation and making choice on a worldwide project as Symfony can put into a cold sweat.
And that’s where the Symfony Slack is really helpful: it makes it easy to get in touch with the core-contributors team. This is how I was able to exchange and comment the pull request. Each exchange allowed me to iterate by refining the implementation of the feature in Symfony. Most of the exchanges were with Nicolas Grekas, who manages almost all the issues and PRs. On several occasions he was able to unblock the situation, whether take functional choices or unblock technical constraints.
Nicolas could have done this PR in few minutes himself, so I wondered why let a new contributor do it ? Today I realized that it’s an investment in the community.
And then it’s the end, the ultimate Fabien message to thank the participants, and here we’re! It’s merged! And since it was a new “consequent” feature, Javier Eguiluz has created a “New in Symfony 3.3” blog post for it. Thank you Javier!
With a little perspective, this experience was really beneficial to me for several reasons:
- First of all I really “own” Symfony, and on a daily basis, when in certain situations the use of the framework seems to me to be improvable, I do not hesitate to get started and create one or two PRs.
- Then I got some skills: on the components I worked on, in Symfony itself and also in PHP. I discovered a lot of things (technical / practical) in a short time. Stepping out of your comfort zone and interacting with the “ninja” of the profession is a real boost.
- I also spend more time looking at Symfony issues to find out what’s going on before the official communication. PRs are always commented, and I encourage you to participate (or let a reaction if you are too shy). And we find the advice of “core contributors” to other contributors, which are always excellent readings.
So, I hope this post has made you want to participate and contribute to Symfony if you have not done so yet.