Conversation
tools/migration/src/main/resources/META-INF/rewrite/ToLatest.yml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
This PR adds an automated migration recipe for the score class restructuring in Timefold Solver 2.0.0. The migration moves score classes from the buildin subpackages to the top-level score package, and consolidates Long-based variants into their base types.
Changes:
- Added
ScoreClassesMigrationRecipeto automate migration from deprecated score class locations to new package structure - Added comprehensive test coverage for the migration recipe
- Integrated the recipe into the
ToLatestmigration workflow with automatic import cleanup - Removed reference to non-existent
FromOptaPlannerToTimefoldSolverrecipe
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tools/migration/src/main/java/ai/timefold/solver/migration/ScoreClassesMigrationRecipe.java | Implements migration recipe that transforms 12 score class types from buildin subpackages to top-level score package, consolidating Long variants into base types |
| tools/migration/src/test/java/ai/timefold/solver/migration/ScoreClassesMigrationRecipeTest.java | Adds test validating that all score types are correctly migrated with proper import statements |
| tools/migration/src/main/resources/META-INF/rewrite/ToLatest.yml | Integrates new score class migration recipe into migration workflow and removes reference to non-existent recipe |
Comments suppressed due to low confidence (1)
tools/migration/src/main/resources/META-INF/rewrite/ToLatest.yml:6
- The removal of 'ai.timefold.solver.migration.FromOptaPlannerToTimefoldSolver' from the recipe list is not mentioned in the PR title or description. This recipe does not exist in the current codebase, suggesting it may have been a placeholder or leftover reference. However, if this recipe was intentionally present for a reason (even if not yet implemented), removing it without explanation could be a mistake. Consider documenting this removal in the PR description.
- org.openrewrite.properties.ChangePropertyKey:
...s/migration/src/main/java/ai/timefold/solver/migration/GeneralChangeTypeMigrationRecipe.java
Show resolved
Hide resolved
| "package ai.timefold.solver.core.api.score.buildin.bendablelong; public class BendableLongScore {}", | ||
| "package ai.timefold.solver.core.api.score.buildin.bendablebigdecimal; public class BendableBigDecimalScore {}", | ||
| "package ai.timefold.solver.core.api.solver; public class ProblemFactChange {}", | ||
| "package ai.timefold.solver.core.config.solver; public enum EnvironmentMode {FAST_ASSERT, REPRODUCIBLE}")); |
There was a problem hiding this comment.
The enum stub only defines FAST_ASSERT and REPRODUCIBLE, but the test expects these to be replaced with STEP_ASSERT and NO_ASSERT which are not defined in the stub. Add STEP_ASSERT and NO_ASSERT to the enum stub so OpenRewrite can properly resolve the target constants during migration.
| "package ai.timefold.solver.core.config.solver; public enum EnvironmentMode {FAST_ASSERT, REPRODUCIBLE}")); | |
| "package ai.timefold.solver.core.config.solver; public enum EnvironmentMode {FAST_ASSERT, STEP_ASSERT, NO_ASSERT, REPRODUCIBLE}")); |
|



No description provided.