-
Notifications
You must be signed in to change notification settings - Fork 424
RecipeRunStats several times counts the same recipe runs with different params #5408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
rewrite-core/src/test/java/org/openrewrite/table/RecipeRunStatsTest.java
Outdated
Show resolved
Hide resolved
Checked a new version on the same repo #4876 (comment) |
rewrite-core/src/main/java/org/openrewrite/scheduling/RecipeRunCycle.java
Outdated
Show resolved
Hide resolved
d12300e
to
43b40a9
Compare
I'm not clear on whether this table is shared across repositories and whether then it will undercount source file paths that reoccur across repos. |
@jkschneider I've tested the |
@arodionov would you check on what Jonathan asked about -
|
@okundzich I thought that running recipes across an organization with multiple repositories should check this. |
please make sure you have same file names across repos while testing |
After the source code analysis for For For |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for confirming, and the helpful link into moderne-worker. With that I'm leaning towards a merge: we're copying a pattern we already used for sourceFileChanged
to add a sourceFileVisited
, with both the CLI and worker only using those per repository from what we've seen here. Nice to see this fixed.
We can of course wait a day or two before we merge in case Jonathan or Olga has any concerns (there's a US public holiday), as there's no rush getting this out.
When the same recipe is executed several times with different parameters, the
tag("name", recipe.getName())
will be the same, and it will produce wrong (n-times bigger) stats forsource-files
("The number of source files the recipe ran over") inRecipeRunStats
.As a fix, a HashSet was introduced to track all visited sources.