A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/2355 below:

[doc] Improve documentation about incremental analysis · Issue #2355 · pmd/pmd · GitHub

See gitter chat:

KroArtem:

  1. The other question is about incremental cache. Recently we've switched to gitlab ci and are running pipelines there. However, we check only changed files by getting list of these files against master. I'm planning to do the following: after merging to master a job checks the project and gets up-to-date state. This cache is saved in gitlab ci artifacts and is available for another runs. This way we'll eliminate our crutches that help to check only changed files. Another branch uses the cache, somehow (I don't know how PMD does this) understands what files should be checked and voila! It's not clear, though, what will happen if branchA doesn't have master?
    Also another question got to my mind, wouldn't the cache be overriden by these runs... I mean, we need to get the information from cache but we don't need to update its state

adangel:

I'm not sure, I understand this: "if branchA doesn't have master?"
PMD itself checks, whether files have been modified by using a checksum. If the file has not been modified, the rules are not executed, but the cached violations are reported. If the file has been modified, then the rules are executed and found violations are reported + added to the cache. In the end, a updated analysis cache file is written to disk.
So, you can mix branches and master, it should work. PMD will run the rules for any new or modified file. In the end, the cache file is just a file (some java serialized data), that you can copy/move around.
When you are using maven and m-pmd-p, then by default, the cache file is inside the target directory. This means, you should configure the plugin, to store it somewhere else, so that it won't be cleaned if you run mvn clean install. See property https://maven.apache.org/plugins/maven-pmd-plugin/pmd-mojo.html#analysisCacheLocation

Maybe this is something we can explain better on https://pmd.github.io/latest/pmd_userdocs_incremental_analysis.html ?

KroArtem:

  1. The idea was that I have master with up-to-date cache and branchA that is behind master. The question was How would PMD understand which files would be processed? I have read https://pmd.github.io/latest/pmd_userdocs_incremental_analysis.html before asking it here and do believe this topic could be explained more verbose (you did it better than those article)

Juan:

  1. as Andreas said, PMD will compute a checksum on each file. You can think of the cache as a Map where the filepath is used as the key, and the violations found in previous runs are the value. For each file being analyzed, we look it up in the map (see if it's new or not), and if not, we compute a checksum and see if the file was modified since the last run or not. If not changed, we don't even look at the file and simply keep the saved violations. If it's changed, we parse it again and rerun all rules for that single file. After we are done, we update the cache. So basically, PMD will only analyze files that changed between runs. If your previous run was on branch A and then you run on branch B using the same cache file, it will only look at files that are different between the 2 branches.

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4