Skip to content

Comments

feat: add new migration recipes#2135

Open
zepfred wants to merge 6 commits intoTimefoldAI:mainfrom
zepfred:chore/score-recipe
Open

feat: add new migration recipes#2135
zepfred wants to merge 6 commits intoTimefoldAI:mainfrom
zepfred:chore/score-recipe

Conversation

@zepfred
Copy link
Contributor

@zepfred zepfred commented Feb 20, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 20, 2026 14:39
@zepfred zepfred requested a review from triceo as a code owner February 20, 2026 14:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 ScoreClassesMigrationRecipe to automate migration from deprecated score class locations to new package structure
  • Added comprehensive test coverage for the migration recipe
  • Integrated the recipe into the ToLatest migration workflow with automatic import cleanup
  • Removed reference to non-existent FromOptaPlannerToTimefoldSolver recipe

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:

@zepfred zepfred changed the title feat: add new recipe for score classes feat: add new recipes Feb 20, 2026
@zepfred zepfred changed the title feat: add new recipes feat: add new migration recipes Feb 20, 2026
Copilot AI review requested due to automatic review settings February 20, 2026 18:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

"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}"));
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
"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}"));

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants