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
Inconsistent cache key is generated for ruby 3.1.4 #12076
Comments
I have the same issue. Does anyone know how to fix it? |
@K-S-A Yeah! Please open a patch with a reproduction test. |
I have the same issue. Also, changing a single file within the project seems to invalidate the entire cache, is this related? |
…Cache The "fileutils.rb" item is dynamically added to the `$LOADED_FEATURES` due to the autoloading when calling the `RuboCop::Server::Cache.dir`. Explicit require is added to achieve idempotency when initializing the `RuboCop::ResultCache.rubocop_required_features`. This change resolves the issue where the top level cache folder was named differently during two consecutive runs of rubocop.
@meric426, the rubocop cache consists of several "layers". Its invalidation can be caused neither by changed dependencies, nor by configuration changes, nor by updating the content of the scanned file(s). Please, share the minimum reproduction gist/repo to confirm if your case is related. |
The "fileutils.rb" item is dynamically added to the `$LOADED_FEATURES` due to the autoloading when calling the `RuboCop::Server::Cache.dir`. Explicit require is added to achieve idempotency when initializing the `RuboCop::ResultCache.rubocop_required_features`. This change resolves the issue where the top level cache folder was named differently during two consecutive runs of rubocop.
Expected behavior
For ruby 3.1.x the value of the cache key should not depend on the presence of the server cache directory.
More precisely, the
RuboCop::ResultCache.rubocop_required_features
value should not change if theRuboCop::Server::Cache.dir
already exists.Actual behavior
The cache key is changed for two consecutive
rubocop
command executions and depends on the<rubocop_cache_root>/server
directory existance.Steps to reproduce the problem
RuboCop version
Workaround
I would be happy to submit the patch for this issue.
The text was updated successfully, but these errors were encountered: