To simplify daily work for TYPO3 contributors and reduce the time for onboarding of new contributors Composer scripts can be used to define details of CLI tasks once and for all.
There is a change pending which already adds a few scripts and serves as a starting point:
We need to discuss if we agree on this in general and if there are still issues to be tackled before this can be merged.
Impact
For example running unit tests becomes as simple as executing composer t:p:u or possibly just composer test. Setting up the Gerrit post commit hook is done automatically upon composer install.
Composer has automatic switching if you use xdebug, it then spawns another PHP process that has xdebug disabled - which means that you cannot debug through the composer scripts. The xdebug shared object is not loaded at all.
While it isn’t directly a con as long as the original scripts remain in place, it does mean that there is one more difference to be aware of and two ways of calling the same script, each with its own implications. I’m not sure it is common knowledge that composer does this…
If this is not sufficient enough, please propose changes (as issues) or make them yourself
It might be a good idea to communicate this more, but we are still working on some changes for the Contribution Guide and I think it is a good idea to wait until this is done and then post a news entry about it.
And I agree with Mathias, having good docs and good command shortcuts are not 2 competing approaches, I think there should be both.
Another thing about docs: Documentation not only needs to be written, it needs to be maintained as well and kept up-to-date. So I wouldn’t go and document all the various ways you can setup your environment. What we have now is - I think - already pretty sufficient.
What I find most important about this patch right now:
Does it in any way disrupt the current workflow?
Does it do any other harm, e.g. if the commands are confusing or do not work?
and, is it helpful?
About 1: It would be important to look at it closely and very thoroughly test it. Because it does things automatically on composer install, namely copying the commit hook. I have excessively tested this, e.g. removed hook directory entirely and run composer install.
About 2: That would be a clear “no” from me.
The unit test commands and everything else works like a charm.
We actually removed some of the commands, where there where objections (e.g. running functional tests, command for opening docs in browser) and things that might break or were not entirely portable. The current version is a very minimal subset of possible commands.
About 3: There are a number of commands to be executed, if you want to setup your sytem for core contribution.
Conclusion: If there are no serious concerns, why not merge it?
I like the idea of installing commit hook on composer install.
It simplifies the setup for new contributors, and TYPO3 is considered not easy to set up for the first time. So I’m +1 for this.