Back in 2019, Tymoteusz Motylewski talked to me during the TYPO3 Initiative Week. He had the idea to apply for a budget to create best practices for the TYPO3 community. This would involve things like linting (for translation files, TypoScript, etc), how to write extensions, how to host TYPO3 projects and so on. Until then, every freelancer and company followed their own best practices, and knowledge was more or less only exchanged during user groups and camps. Sometimes this created situations where some people were left behind. Those people felt unprofessional or overwhelmed by some changes. In addition, breaking changes within TYPO3 were sometimes frustrating for some integrators and developers, because they weren’t aware of the recommended best-practice.
Tymoteusz Motylewski is already involved in so many ways in the community, so he didn’t submit the idea himself... but he did convince me to apply for a budget. It was a first for me. The community liked the idea and the budget request was approved.
Initial Budget Idea
Our initial idea was to use the budget to travel to TYPO3 camps to collect and discuss the different best practices. We intended to then hold a documentation sprint to create a report out of the collected information.
How the Pandemic Changed the Approach
Thanks to the pandemic, we had to adapt our idea. We talked to the association and discussed within the team, and came up with a solution that consumed less money and created more output. Instead of traveling and talking, a very small team was founded which started to implement the best practices as showcases. We committed ourselves to always do code reviews and provide solutions for GitLab CI and GitHub Actions. We aimed to have proper documentation for all the existing showcases. People can have a look and hopefully copy and paste existing solutions. There are also plans to release the CI workfor GitHub Actions, so people can just include them instead of copying the solutions.
You can view the results and current process at:
See the readme file for a full a feature list, but here is an overview:
We started with Oliver Klee’s extension “tea” as a base, which was already covering some best practices. Thanks to Oliver for moving the extension into the typo3-documentation and qa groups / organizations on the platform. It saved quite some time to have existing examples.
We then focused on the continuous integration (CI) parts, as there are many different solutions and possible setup. We thought it would be a great place to start to come up with some best practices thatothers could use right away. The outcome in that area covers:
- Linting PHP Files with php native functionality
- Checking code style via php-cs-fixer and php codesniffer
- Checking for copy and paste code via php copy and paste detector
- Linting JSON via jsonlint
- Linting YAML via yaml-lint
- Linting TypoScript via typoscript-lint
- Running unit tests via PHPUnit
- Running functional tests via PHPUnit
- Documentation on how to execute tests with PHPStorm
- Documentation on how to run acceptance tests
- Note about why extensions and libraries don’t need to check for security issues in their dependencies
- How to render documentation
- Mention of further helpful resources and projects
We haven’t yet started work on best practices for projects. We think focussing on improving the quality of extensions is way more important, as they will be used in thousands of TYPO3 projects. They also mostly work as inspiration for developers at companies and are therefore a big factor.
We Will Continue in 2021
The budget for 2021 was granted and we will continue to work on this project.
Thanks to the Team
We’d like to express our gratitude to the association and community for sponsoring the work. Also we’d like to say thanks to the people who actually did the work: Łukas Uznański and Oliver Klee. Also thanks to everyone involved by providing further ideas and feedback like Tymoteusz Motylewski.
In total, we spent €2,408.90 last year. The money was used to compensate the working time of the two people actively integrating and reviewing all the work.
We hope you find the current outcome helpful. You are free to open issues on the repositories, but we prefer the GitHub repository for issues. And anyone is welcome to join the slack channel #qa-best-practices.