Skip to content

Fix unchanged Quark files appearing in changeset results#7130

Merged
shanman190 merged 3 commits intomainfrom
tim/fix-yaml-mapping-entry
Mar 25, 2026
Merged

Fix unchanged Quark files appearing in changeset results#7130
shanman190 merged 3 commits intomainfrom
tim/fix-yaml-mapping-entry

Conversation

@timtebeek
Copy link
Copy Markdown
Member

@timtebeek timtebeek commented Mar 24, 2026

Summary

  • Result.isLocalAndHasNoChanges() calls printAll() to compare before/after, but Quark throw UnsupportedOperationException from printAll(). The catch block returns false, so unchanged files (e.g. .jks keystores) are incorrectly reported as changed.

  • Add explicit handling: Quarks are compared by source path.

  • Wrapper update recipes (e.g. UpdateMavenWrapper) are unaffected because they replace QuarkRemote, which doesn't match the new Quark-to-Quark check.

  • Fixes UpdateMavenWrapper is reported as changing a lot of files (but it does not) #3948

Test plan

  • Added unit tests for unchanged Quark (same path) and changed Quark (different path)
  • Existing tests pass (./gradlew :rewrite-core:test)

Quark.printAll() and Binary.printAll() throw UnsupportedOperationException,
causing Result.isLocalAndHasNoChanges() to incorrectly report them as
changed. Add explicit handling for these types before calling printAll().

Fixes #3948
@timtebeek timtebeek requested a review from sambsnyd March 24, 2026 22:32
@timtebeek timtebeek added the bug Something isn't working label Mar 24, 2026
@timtebeek timtebeek requested a review from shanman190 March 24, 2026 23:42
@timtebeek
Copy link
Copy Markdown
Member Author

Feel free to immediately merge this if you see it and agree, such that this can make it into the release to fix a long standing issue.

@timtebeek timtebeek moved this from In Progress to Ready to Review in OpenRewrite Mar 24, 2026
Removed binary file comparison logic from Result class.
@timtebeek timtebeek requested a review from shanman190 March 25, 2026 00:35
@shanman190 shanman190 changed the title Fix unchanged Quark and Binary files appearing in changeset results Fix unchanged Quark files appearing in changeset results Mar 25, 2026
@shanman190 shanman190 merged commit 48d403b into main Mar 25, 2026
1 check passed
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Mar 25, 2026
@shanman190 shanman190 deleted the tim/fix-yaml-mapping-entry branch March 25, 2026 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

UpdateMavenWrapper is reported as changing a lot of files (but it does not)

2 participants