spotless: using ratchetFrom in a branch fails to detect the previous index in origin/main

Hi,

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!

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (9 by maintainers)

Most upvoted comments

Published in plugin-maven 2.30.0.

A new release will be cut in a few days, and I post the release version into all affected issues and pr’s so you’ll get a notification if you’re subscribed to this issue.

Thanks for reporting this problem and sorry for the delay! I will investigate this week.