Skip to content

Conversation

ribafish
Copy link
Contributor

@ribafish ribafish commented Sep 2, 2025

This change is required for failures coming from the japicmp-gradle-plugin to be correctly classified as verification failures when they happen due to detected binary changes.

reportLink = null;
}
StringBuilder message = new StringBuilder("Detected binary changes.\n")
StringBuilder message = new StringBuilder("Verification failed: Detected binary changes.\n")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to add this string? Looks that the verification is already encoded in the exception type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it shouldn't be strictly necessary, but it does make it more explicit.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I'm a bit worried though, because we can have scripts which search in the logs for that particular line.

Copy link
Contributor Author

@ribafish ribafish Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed and verified it's still classified as a Verification failure 👍

Copy link
Contributor Author

@ribafish ribafish Sep 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @melix, I saw tests are failing on Gradle <7.4 - VerificationException is only available from Gradle 7.4+, so to properly support down to Gradle 6.6 (your current min supported version), I had to change back to GradleException and modify the exception message - that is done in commit 2da8088. I'm very flexible about the wording of the modification, as long as it's something from this list 😄

I did try to search for any other mention of Detected binary changes in the code to fix any tests relying on that message, but I couldn't find anything. Could you point me to those scripts you mentioned so I can verify they still work and fix them if necessary?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are internal tools, not public.

@ribafish ribafish force-pushed the gk/fixVerificationFailure branch from 4f3ea34 to e57f1b5 Compare September 18, 2025 10:39
@ribafish ribafish requested a review from melix September 18, 2025 10:39
@ribafish ribafish requested a review from melix September 23, 2025 16:44
Copy link
Owner

@melix melix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahem...

@ribafish
Copy link
Contributor Author

Hi @melix, I had thought about this a bit more, and I believe there are only two ways to handle this:

  1. Modify the exception message, which was done in commit 2da8088 and explained more in depth here, or:
  2. Detect which Gradle version is running, if it's >7.4, throw VerificationException, if not, throw a regular GradleException. This would, however, mean that the Gradle version would need to be passed down to the correct place, and VerificationException would need to be returned using reflection in order to not get issues with Gradle <7.4.

Unfortunately, I don't see a different fix for this, and we'd recommend going with the first option, as it covers all Gradle versions. I am happy to address anything that breaks because of the changed exception message if necessary.

@melix
Copy link
Owner

melix commented Sep 30, 2025

Ok let's proceed with 1. Hopefully our internal tooling won't break :)

@melix melix merged commit 460eb5b into melix:master Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants