Make the DtoGenerator deterministic #784
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
It makes the DtoGenerator generate deterministic files. Currently, the DtoImpl files generated differ between runs, as methods are unordered and are thus added in a nondeterministic order. This is now fixed and generated files from the same source code are now identical.
Looking at the current Che server PR builds performance, this fix should shorten the builds where Dtos aren't changed by additional ~3m.
This was highlighted after you've merged PR #781, which connected the project to Develocity. I have investigated cache misses and saw there are differences in generated files, causing the calculated cache key be different and thus not getting cache hits on all Surefire goals. I was able to reproduce it locally and fix it. The scan comparison with the fix is visible here, where no DtoImpls are detected as different - there is one additional cache miss, which is outside of scope of this PR.
Screenshot/screencast of this PR
Before:

After:

What issues does this PR fix or reference?
This relates to Issue eclipse-che/che#23358, as it will improve build performance.
How to test this PR?
Build che-server and observe the generated
Dto*Impls.javafiles.PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or referenceandHow to test this PRcompletedRelease Notes
DtoImpls.javafiles are now deterministic.Reviewers
Reviewers, please comment how you tested the PR when approving it.