-
-
Notifications
You must be signed in to change notification settings - Fork 400
[Kaizen] Save kaizen applied rules into cache to make works on parallel #7046
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
Conversation
77e8380
to
72d91ac
Compare
register directory register directory
72d91ac
to
b53b595
Compare
I've added e2e test for it with Ref https://github.com/rectorphp/rector-src/actions/runs/16101183170/job/45430530419?pr=7046 It can possibly due to on CI, the cache overlapped call |
I got it, it seems due to default CI use |
All checks have passed 🎉 @gharlan @TomasVotruba it is ready for review. |
@TomasVotruba let's merge to have faster feedback to test ;) |
$cachedValue = $this->loadRules(); | ||
|
||
$appliedRectorClasses = array_unique(array_merge($cachedValue, [$rectorClass])); | ||
$this->cache->save($this->getCacheKey(), CacheKey::KAIZEN_RULES, $appliedRectorClasses); |
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.
Nice trick 👏 🥳
Thanks! I tried it in my project (via rector/rector dev-main, which is already updated: rectorphp/rector@c243796). The first run of
But the next run only "looks" at the 16 changed files:
|
@gharlan thank you for verify, that's expected, or we may need to force clear cache when The combination with Please create new feature request for that so this can be discussed further. |
nvm, I created PR for that :) |
Ref #7045 (comment)
Closes #7045
Closes Closes rectorphp/rector#9231