Skip to content

Fix BatchVisit over-attributing RecipesThatMadeChanges marker#6987

Merged
knutwannheden merged 1 commit intomainfrom
ivory-toucan
Mar 16, 2026
Merged

Fix BatchVisit over-attributing RecipesThatMadeChanges marker#6987
knutwannheden merged 1 commit intomainfrom
ivory-toucan

Conversation

@knutwannheden
Copy link
Contributor

Summary

  • flushBatch unconditionally added all recipes in a batch to the RecipesThatMadeChanges marker when any recipe modified the tree. A batch of 10 recipes where only 1 made changes would incorrectly attribute all 10.
  • Now only recipes whose BatchVisitResult.modified is true get added to the marker.

Test plan

  • Added batchOnlyAttributesRecipesThatActuallyMadeChanges test in RewriteRpcTest that creates a batch of 3 RPC recipes (ChangeText, Find with no match, ChangeText) and asserts only ChangeText appears in the marker
  • All existing RewriteRpcTest tests pass

flushBatch unconditionally added all recipes in the batch to the
RecipesThatMadeChanges marker when any recipe modified the tree.
Now only recipes whose BatchVisitResult.modified is true get attributed.
@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Mar 16, 2026
@knutwannheden knutwannheden changed the title Fix BatchVisit over-attributing RecipesThatMadeChanges marker Fix BatchVisit over-attributing RecipesThatMadeChanges marker Mar 16, 2026
@knutwannheden knutwannheden merged commit ada9de6 into main Mar 16, 2026
1 check passed
@knutwannheden knutwannheden deleted the ivory-toucan branch March 16, 2026 08:34
@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenRewrite Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant