Skip to content

ci: fix PHPStan not using result cache - #2234

Merged
brendt merged 12 commits into
tempestphp:3.xfrom
staabm:patch-1
Jul 27, 2026
Merged

ci: fix PHPStan not using result cache#2234
brendt merged 12 commits into
tempestphp:3.xfrom
staabm:patch-1

Conversation

@staabm

@staabm staabm commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

CI debug first, why it doesn't work.. than we will see how a fix looks like

ok, findings are

  • we had a bug in PHPStan result cache handling, when projects had composer.lock on gitignore, which we fixed with Result cache fully invalidated when composer.lock changes without any installed package change phpstan/phpstan#14984
  • CI should build the cache on the 3.x branch, so new PRs immediately benefit from a warm cache
  • updating to latest PHPStan unlocks new performance level (cold cache takes 10 seconds on my local machine to scan ~2600 files; previosly PHPStan 2.1.40 took 20s)
  • after updating PHPStan, I fixed upcoming new errors and cleaned up no longer necessary ignore rules

relevant changes are in

  • .github/workflows/coding-conventions.yml
  • composer.json

everything else is handling of PHPStan errors to get the build green

@staabm
staabm marked this pull request as ready for review July 27, 2026 05:59
Comment thread .github/workflows/coding-conventions.yml
Comment thread packages/container/src/GenericContainer.php
@brendt

brendt commented Jul 27, 2026

Copy link
Copy Markdown
Member

Thanks for looking into it!

So should I still merge this branch? I reckon I can since there are some code fixes in it as well?

@staabm

staabm commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

the branch is ready to merge, indeed.

I will watch PRs coming in after the merge to make sure it works now as expected

@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown

Benchmark Results

Comparison of patch-1 against 3.x (b7e88b2353a88f17af07e14985afd3b88b5d6b1d).

Open to see the benchmark results
Benchmark Set Mem. Peak Time Variability
ViewRenderBench(benchPlainHtml) - 22.015mb +0.00% 504.891μs -5.06% ±1.99% -9.45%

Generated by phpbench against commit 6675c72

@brendt brendt changed the title Fix PHPStan not using result cache ci: fix PHPStan not using result cache Jul 27, 2026
@brendt

brendt commented Jul 27, 2026

Copy link
Copy Markdown
Member

@xHeaven could the failing tests here have something to do with your refactor in #2238 ?

@staabm

staabm commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

I think we also need to update rector for compat with the latest PHPStan release.

rector depends on non API internals of PHPStan, which usually means it easily breaks right after a PHPStan release, see rectorphp/rector-src#8208

@xHeaven

xHeaven commented Jul 27, 2026

Copy link
Copy Markdown
Member

@xHeaven could the failing tests here have something to do with your refactor in #2238 ?

I don't think so, or at least I don't see anything related. It's likely what @staabm mentioned above.

@staabm If @brendt gives his blessing, I think you can upgrade Rector in this same PR, as it's sort of related.

Comment thread rector.php
@staabm

staabm commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

(fixed the rector update from my company laptop, therefore commited with a different github.com account)

@brendt
brendt merged commit 738e0c4 into tempestphp:3.x Jul 27, 2026
140 of 141 checks passed
@brendt

brendt commented Jul 27, 2026

Copy link
Copy Markdown
Member

Thanks! Appreciate it :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants