[Caching] Add CacheMetaExtensionInterface for custom cache invalidation - #7933
Conversation
Same mechanism as PHPStan's ResultCacheMetaExtension — extensions implement getKey() and getHash() to provide additional metadata that is folded into the file cache key. When any extension's hash changes, all cached files are reprocessed.
|
Great! Is it possible to test this phar locally? Then I can confirm that it actually works end-to-end. |
|
There is e2e dir in case you can create a stub test for it https://github.com/rectorphp/rector-src/tree/main/e2e then you can register in e2e workflow, something like this one https://github.com/rectorphp/rector-src/tree/main/e2e/timeout-file-not-cached and register the directory and if needed command here https://github.com/rectorphp/rector-src/blob/main/.github/workflows/e2e_with_cache.yaml to test the output |
Proves the extension actually invalidates cache by using a conditional rule that only triggers when an external file changes value.
|
@samsonasik I pushed another commit with e2e tests. Thanks for the hint. Hope this makes sense! |
|
Looks good, thank you 👍 |
…on (#7933) * [Caching] Add CacheMetaExtensionInterface for custom cache invalidation Same mechanism as PHPStan's ResultCacheMetaExtension — extensions implement getKey() and getHash() to provide additional metadata that is folded into the file cache key. When any extension's hash changes, all cached files are reprocessed. * Add e2e test for CacheMetaExtensionInterface cache invalidation Proves the extension actually invalidates cache by using a conditional rule that only triggers when an external file changes value.
|
Thanks for the merge. Is there an ETA for the release? |
|
This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work. |
Same mechanism as PHPStan's ResultCacheMetaExtension: extensions implement getKey() and getHash() to provide additional metadata that is folded into the file cache key. When any extension's hash changes, all cached files are reprocessed.
My use case is that I have a rector that operates on cache file that is generated by another process. Whenever the file changes, Rector should pick it up and re-process all files.