Skip to content

Restore recipe hierarchy rows in SourcesFileResults#6764

Merged
timtebeek merged 3 commits intomainfrom
restore-hierarchy-in-sources-file-results
Feb 18, 2026
Merged

Restore recipe hierarchy rows in SourcesFileResults#6764
timtebeek merged 3 commits intomainfrom
restore-hierarchy-in-sources-file-results

Conversation

@timtebeek
Copy link
Copy Markdown
Member

@timtebeek timtebeek commented Feb 18, 2026

Summary

Problem

  • The Sankey visualization shows recipe execution hierarchies by reading (parentRecipe, recipe) pairs from the SourcesFileResults data table. PR Align estimated time savings between Result and SourcesFileResults #6022 removed the recursive recording of hierarchy rows to fix non-summable estimatedTimeSaving values. This caused the Sankey to only show 1-2 levels instead of the full drill-down (5+ levels for migrations like Java 25).

Solution

Restore the recordSourceFileResult() method but pass 0L for estimatedTimeSaving on all non-leaf hierarchy rows. Only the leaf recipe that actually made the change carries its effort value. This gives the Sankey all the edges it needs while keeping the effort column summable.

Test plan

  • Existing SourceFileResultsTest.hierarchical passes unchanged
  • Existing RecipeEstimatedEffortTest.estimatedTimeSavingsForMultipleRecipes passes unchanged (effort sums still correct)
  • New SourceFileResultsTest.deepHierarchyRecordsAllLevels verifies hierarchy rows are produced with zero effort

PR #6022 removed the recursive hierarchy recording in RecipeRunCycle to
fix non-summable estimatedTimeSaving values. This had the side effect of
breaking the Sankey visualization, which needs (parentRecipe, recipe)
rows at every level to draw the full drill-down from top-level recipes
through to leaf recipes that made changes.

Restore the recursive recordSourceFileResult() method but pass 0 for
estimatedTimeSaving on hierarchy rows, so that only leaf recipes carry
effort values and the column remains summable.
@timtebeek
Copy link
Copy Markdown
Member Author

Any immediate thoughts here @pstreef given your involvement with

@timtebeek timtebeek requested a review from pstreef February 18, 2026 13:58
@pstreef
Copy link
Copy Markdown
Contributor

pstreef commented Feb 18, 2026

yeah, perhaps we should just have a different data-table if this is just for 1 visualization? The reason for removal was more than just being able to sum. It was also confusing.

I would involve @jkschneider and/or @sambsnyd here for opinions

@timtebeek timtebeek added bug Something isn't working recipe Requested Recipe labels Feb 18, 2026
Copy link
Copy Markdown
Member

@sambsnyd sambsnyd left a comment

Choose a reason for hiding this comment

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

I think this is reasonable. Peter's comments about it being a bit confusing are perfectly fair, but recording the hierarchy is a more accurate description of what happens when a recipe makes changes. Maybe mentioning the nature of the 0-savings rows in the data table description would help - although we don't surface those descriptions many places.

@github-project-automation github-project-automation Bot moved this from In Progress to Ready to Review in OpenRewrite Feb 18, 2026
@timtebeek
Copy link
Copy Markdown
Member Author

Thanks both! I'll merge as we're one to one restoring what was removed in #6022, with the exception of the effort which is explicitly set to zero and documented as such. I want to acknowledge that Peter suggested an alternative data table, but seeing how it would have to hook into RecipeRunCycle, and be attached for every run I think it'd be better not to introduce a near duplicate if the zero-time rows here work as well.

@timtebeek timtebeek merged commit d6d17e5 into main Feb 18, 2026
1 check passed
@timtebeek timtebeek deleted the restore-hierarchy-in-sources-file-results branch February 18, 2026 23:44
@github-project-automation github-project-automation Bot moved this from Ready to Review to Done in OpenRewrite Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working recipe Requested Recipe

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants