Overview

#3591245: DX: Introduce `composer run lint` that runs PHPCS + PHPStan (sibling to `npm run lint`) improves the DX, and makes it consistent between PHP (composer run …) and everything else (npm run …).

#3538439: Running tests locally is difficult to match with the CI introduced composer run phpstan and immediately optimized it for running on CI: it set up caching, then runs it twice.

(Meaning the intent is the same as #3589565: Make `npm run lint` output easier for humans to parse: optimize this for developer use, rather than CI.)

Proposed resolution

Make composer run phpstan run it only once, this makes a very noticeable difference (with caches primed, i.e. as you would use this during development):

HEAD: ~30 seconds
$ time composer run phpstan
…
real	0m18.920s
user	0m7.768s
sys	0m12.244s
MR: ~15 seconds
$ time composer run phpstan
…
real	0m8.723s
user	0m3.655s
sys	0m5.315s

User interface changes

None.

Issue fork canvas-3591249

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

wim leers created an issue. See original summary.

wim leers’s picture

Title: [PP-1] DX: stop running `phpstan` twice for local development, only do this on CI » [PP-1] DX: stop running `phpstan` twice for local development: ~30s → ~15s, only run twice on CI
wim leers’s picture

Title: [PP-1] DX: stop running `phpstan` twice for local development: ~30s → ~15s, only run twice on CI » [PP-1] DX: Faster feedback loop: stop running `phpstan` twice for local development: ~30s → ~15s, only run twice on CI
wim leers’s picture

Title: [PP-1] DX: Faster feedback loop: stop running `phpstan` twice for local development: ~30s → ~15s, only run twice on CI » DX: Faster feedback loop: stop running `phpstan` twice for local development: ~30s → ~15s, only run twice on CI
Assigned: Unassigned » wim leers
Status: Postponed » Active

Actually, it need not be postponed.

wim leers’s picture

Title: DX: Faster feedback loop: stop running `phpstan` twice for local development: ~30s → ~15s, only run twice on CI » DX: Faster feedback loop: stop running `phpstan` twice for local development: ~30s → ~15s, only run twice on CI instead (currently 4!)
Priority: Normal » Major

Well … turns out we can make CI 20–30 seconds faster too: https://git.drupalcode.org/project/canvas/-/merge_requests/1139/diffs?co...

→ screenshot illustrating the problem on the MR.

wim leers’s picture

Assigned: wim leers » justafish
Status: Active » Needs review
justafish’s picture

Status: Needs review » Reviewed & tested by the community