| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Open | None | T280990 Run phan as part of composer test, rather than in bespoke CI jobs | |||
| Resolved | Jdforrester-WMF | T270632 Provide AST on the image on which LibUp runs so it can handle phan | |||
| Resolved | Daimona | T203651 Optimize phan-taint-check speed | |||
| Open | None | T358357 Add support to LibUp to run phan for extensions/skins |
Event Timeline
Unless we make the php-ast dependency optional (or support older, packaged versions) and embrace the polyfill parser, I think this going to be difficult. Installing the correct version of php-ast and then switching it based on which branch you're working on is really annoying and divergent from our general standard of just being able to use the latest distro PHP packages and it just works. (from an end user/dev perspective, not LibUp)
Hmmmm fair point. I don't have up-to-date metrics about taint-check + polyfill, but the last time I checked (a few months ago), it was quite slower. So I think using php-ast would be much better.
I think that is based on the assumption that all repos use the same version of phan (or at least that the difference is small enough). In turn, this is guaranteed by the fact that we don't run phan on release branches. I also don't have data about compatibility of phan with older/newer versions of php-ast. I think it should mostly work, unless there's a difference with the AST version (e.g. version 70 which changed AST_CLASS_NAME to AST_CLASS_CONST for MyClass::class).
My other qualm about this is that composer test is supposed to be self-contained, just applying to what's in the repo, except phan is dependent on your version of MW core, and any other dependencies. For LibUp I think we/I just need to get it to 1) check out core (easy, covers most things), 2) check out dependencies (hopefully via extension.json?) 3) run composer phan (if set) right after whenever we run composer test. And maybe add the --automatic-fix flag.