-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DX: Introduce Composer scripts as common DX #6839
Conversation
c87dd92
to
e0e3660
Compare
Pull Request Test Coverage Report for Build 5771227596
💛 - Coveralls |
9201924
to
c04223e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we for a start go with only scripts that will be used in README.md
, CONTRIBUTING.md
and GitHub Actions?
@kubawerlos I don't understand why? This PR is a proposal for unified way of invoking dev-related scripts, I want to use them while working on Fixer and from my experience it's good when there's common DX for working with the project. When you have such scripts you can change them under the hood while entry point remains the same. Which scripts you would like to remove for now? |
9c2acd5
to
cde063b
Compare
Is it to have in unified way or in your way?
No doubt about it is useful to have some shortcuts, yet I believe there is a reason why there are no such shortcuts in the repo yet. @keradus already mentioned |
It is based on my experience and of course may be subjective, but general idea is universal - having common, simple entrypoints for dev actions, that can change under the hood over time (options, arguments, converting single command to group of commands etc.) without changing the entrypoint itself.
Just like proper Dependency Injection, yet we're considering introducing it, right? 😉
The good thing is that you really don't need to memorise everything. Just run It's also easier to maintain because, as mentioned, you can include those commands in documentation and they rather won't change, while you can tweak what's under the hood. I believe the assumption that people won't use it is not an argument against merging it. In the same way probably people don't use Docker setup which is included in the repo, but it's here. Since those commands are in the contributing guideline, I think many people will start to use them, I don't know why my assumption should be less important 😉. |
cde063b
to
bc2b92a
Compare
f204d3d
to
468a8a5
Compare
1b152b9
to
c2fe138
Compare
76703ef
to
a040380
Compare
@keradus ⏳ 👀 |
Always analyse and fix whole codebase (focus on built-in cache mechanism).
Since ParaUnit was introduced (after rebase I've changed underlying commands) I believe we can drop `test:branch` and `test:diff` completely. With fast linter `composer test` takes about 30s, which is totally fine to run every time before commit/push.
bf437f9
to
dcab5d4
Compare
I am going to merge this, because all discussions were resolved, it has approval and I just want to use these scripts (current approach drives me mad). If @keradus decides it should be reverted or improved, we can do it later before next release. |
The goal of this change is to provide common entrypoints for dev tasks required during development. This way we can ensure everybody runs the same command, and we can change underlying commands without changing dev flow (Composer scripts' names are our contract).
I have doubts about some of these commands (e.g. scripts included in
dev-tools:check
), but we can clean this in separate PR after some discussion. At this point I just migrated existing calls to Composer scripts.Usage
Usage is straightforward: scripts are called via
composer
, for examplecomposer qa
will run QA suite.Running tests
In terms of tests there are 3 scripts and their intention is rather clear. However I would like to emphasise that
test
runs all tests (basically it's a proxy tovendor/bin/paraunit run
), but it's still possible to limit tests execution just like in regular ParaUnit call, the only thing is that--
must be used between Composer script and the list of arguments passed to actual script, like: