using ratchetFrom in a branch fails to detect the previous index in origin/main
See original GitHub issueHi,
I’m using maven (wrapper) 3.8.4
with spotless-maven-plugin 2.27.1
with the configuration defined as follows
<configuration>
<ratchetFrom>origin/main</ratchetFrom>
<java>
<palantirJavaFormat>
<version>xxx</version>
</palantirJavaFormat>
<removedUnusedImports/>
</java>
<upToDateChecking>
<enabled>true</enabled>
<indexFile>${project.basedir/.spotless-index</indexFile>
</upToDateChecking>
</configuration>
So I have been working on main
for a while, and it already has a .spotless-index
file with the checksum and the listing of all the files. So far, no issue with that. But recently, I created a branch off my main
called feature-a
, and after the first commit in feature-a
branch, I ran spotless:apply
, then the .spotless-index
file now has a new checksum
and only listing files that was changed in feature-a
branch.
Imagine in main
branch
ajoicjaicjoiajscoijasjc098-
// listing all my source files (say 50 lines)
Then in feature-a
branch (after a commit, and ran spotless:apply)
osdjvoidjsoyfboudf0bd= // new checksum
// listing 3 files (those that was changed in this new branch commit)
There was a log indicating
[INFO] Up-to-date checking enabled
[INFO] Fingerprint mismatch in the index file. Fallback to an empty index
I can’t have the full logs pasted as this occurs in an air-gapped repo, so if there is further information required, please let me know.
However, based on one of my previous feature branch, it doesn’t seem to suffer the same issue. So I don’t quite understand if there was something that I did wrong when creating the branch, or some mis-configuration on my end.
Thanks!
Issue Analytics
- State:
- Created a year ago
- Comments:10 (4 by maintainers)
Thanks for reporting this problem and sorry for the delay! I will investigate this week.
I understand that
Fingerprint mismatch ...
is to be expected when I changespotless
configuration, and I generally agree with the approach as you have explained previously.But I’m more concerned on how to use
spotless
when working with others, and what to expect. Given that, thisindex
file can change quite frequently (with the current setup) and whatevertracked changes
may frequently get reset, and thus, making theindex
file pretty much “not as useful” as one might have thought.I think as you have explained before,
fingerprint
mismatch should only happen whenspotless
plugin configuration changes and not any other configuration withinpom.xml
which should greatly reduce the chance for theindex
file to keep resetting.And I still have concern when using with large codebase, if the
index
file resets, how much impact would it make (as it needs to rebuild the index again each time spotless version gets upgraded - non-configuration change)? And how would it work in amonorepo (maven multi-module)
project setupThanks for investigating, and answering to my queries. Appreciate it.